It seem to work but there are too many techincal issues that occurs upon running the server with players… I wouldn’t recommend using this until further notice from the author itself imo.
if someone can help me put something into my data base on zap hosting I would be so grateful!
kaidenz123#3817
anyone still getting
Error resuming coroutine: citizen:/scripting/lua/json.lua:397: bad argument [#1](https://github.com/KASHZIN/kashacters/pull/1) to 'strfind' (string expected, got nil)
stack traceback:
[C]: in function 'string.find'
citizen:/scripting/lua/json.lua:397: in upvalue 'scanwhite'
citizen:/scripting/lua/json.lua:553: in function citizen:/scripting/lua/json.lua:551
(...tail calls...)
@esx_kashacters/server/main.lua:50: in upvalue 'handler'
citizen:/scripting/lua/scheduler.lua:219: in function citizen:/scripting/lua/scheduler.lua:218
how can i fix this issue
Error resuming coroutine: citizen:/scripting/lua/json.lua:397: bad argument #1 to 'strfind' (string expected, got nil)
stack traceback:
[C]: in function 'string.find'
citizen:/scripting/lua/json.lua:397: in upvalue 'scanwhite'
citizen:/scripting/lua/json.lua:553: in function <citizen:/scripting/lua/json.lua:551>
(...tail calls...)
@esx_kashacters/server/main.lua:27: in upvalue 'handler'
citizen:/scripting/lua/scheduler.lua:169: in function <citizen:/scripting/lua/scheduler.lua:168>
I’m also having this issue. Character creation is fine, but selecting an existing character doesn’t work. I’ve had this working fine on a ZAP Hosting server, but installing this on a VPS, no dice. Not that it should matter.
Best bet is to just make sure everything in your DB is correct.
Redo the install again.
Server.lua : Line 27 refers to the spawn coords and pulling that with async.
Make sure you get the latest version of async as well.
I have the latest async but getting this still
Error resuming coroutine: citizen:/scripting/lua/json.lua:397: bad argument #1 to 'strfind' (string expected, got nil)
stack traceback:
[C]: in function 'string.find'
citizen:/scripting/lua/json.lua:397: in upvalue 'scanwhite'
citizen:/scripting/lua/json.lua:553: in function <citizen:/scripting/lua/json.lua:551>
(...tail calls...)
@esx_kashacters/server/main.lua:50: in upvalue 'handler'
citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218>
Look at line 50 for your error.
What function is it?
Thanks for the reply, @Twittchter.
When you refer to doing the installation again, is this just of Kashacters, ESX, or the whole server?
Thanks again.
Just kashacters, if its just this one throwing you an error.
If it was working for you when you were on your Zap host, and just not now on the vps, its probably just a super small detail you skimmed over during the install.
Just confirm you have all the tables it needs in your DB under the right names.
We all do it after we’ve done something before.
This is lines 43 to 56
RegisterServerEvent("kashactersS:CharacterChosen")
AddEventHandler('kashactersS:CharacterChosen', function(charid, ischar)
local src = source
local spawn = {}
SetLastCharacter(src, tonumber(charid))
SetCharToIdentifier(GetPlayerIdentifiers(src)[1], tonumber(charid))
if ischar == "true" then
spawn = GetSpawnPos(src)
else
TriggerClientEvent('skinchanger:loadDefaultModel', src, true, cb)
spawn = { x = 195.55, y = -933.36, z = 29.90 } -- DEFAULT SPAWN POSITION
end
TriggerClientEvent("kashactersC:SpawnCharacter", src, spawn)
end)
looked at database… doesnt look to be saving last position
Line 48 to 56 is this…
function GetLastCharacter(source)
local LastChar = MySQLAsyncExecute("SELECT `charid` FROM `user_lastcharacter` WHERE `steamid` = '"..GetPlayerIdentifiers(source)[1].."'")
if LastChar[1] ~= nil and LastChar[1].charid ~= nil then
return tonumber(LastChar[1].charid)
else
MySQLAsyncExecute("INSERT INTO `user_lastcharacter` (`steamid`, `charid`) VALUES('"..GetPlayerIdentifiers(source)[1].."', 1)")
return 1
end
end
so it should now be
RegisterServerEvent("kashactersS:CharacterChosen")
AddEventHandler('kashactersS:CharacterChosen', function(charid, ischar)
local src = source
local spawn = {}
SetLastCharacter(src, tonumber(charid))
function GetLastCharacter(source)
local LastChar = MySQLAsyncExecute("SELECT `charid` FROM `user_lastcharacter` WHERE `steamid` = '"..GetPlayerIdentifiers(source)[1].."'")
if LastChar[1] ~= nil and LastChar[1].charid ~= nil then
return tonumber(LastChar[1].charid)
else
MySQLAsyncExecute("INSERT INTO `user_lastcharacter` (`steamid`, `charid`) VALUES('"..GetPlayerIdentifiers(source)[1].."', 1)")
return 1
end
end
end)
No…
The resource within the github link, in the original post.
The main.lua under the server folder.
The lines you told me are there are different to what is posted.
So either;
A) Reinstall this resource from the link or files you used or,
B) Download the original in the original post and just try again.
Hello, i have a problem with the GCphone. If i create a second Charakter then the phone is synchronized with the first one. Also the Number is the same. And users cant call the police or the ambulance.
Hope anyone can help me!
Thanks
SOLVED
did you find solution?
If your characters are sharing information, you need to make sure you added GCPhones identifying tables into kashacters server side lua, where it asks for all tables to be listed.
If needed, redo the install again, step by step.
For the other things, read the original source of GCPhone the solution for the police/ambulance and calls has been posted multiple times.
Something is causing the last coords to not be saved to your characters.
Most likely an issue with your database or in the server lua of kashacters.
I strongly recommend you just reinstall this resource again, following each step religiously.
I solved the problem. It was from GCPhone .
But thanks anyway
Anyone got any solution’s to the instancing?