job system help -
div - 18.06.2018
Hello, im making a job system.. but there's a problem..
I have used pInfo[playerid][pJobSelected] = 0/1
0 = not selected
1 = selected
When i restart the server, they get reset.. I've used them when a player registers = 0(Not selected any job)
when 1, job is selected.. when i relog, the jobs do not get RESET.. but when i restart, they get reset..
Re: job system help -
div - 18.06.2018
when i restart the server*
Re: job system help -
Exhibit - 18.06.2018
Are you saving these in your enum?
Show us where you save this.
Edit: Next time you post a help topic you should add a code which is causing the problem. It makes stuff eaiser.
Re: job system help -
div - 19.06.2018
saving in MySQL.. if it were enums, then if i would relog, data would get lost, wouldn't it?
When a player disconnects, mysql will set pjobselected(which means the player has selected his job) to 1..
Код:
new query[24];
format(query, sizeof(query), "UPDATE `playerdata` SET `pjobselected` to 1");
mysql_tquery(dbHandle, query);
And it works fine.. when i relog the GAME, my stats are saved, but as i restart the server using /RCON GMX... it resets the stats..
Re: job system help -
Gameluner - 19.06.2018
Hi,
Because you aren't saving it at OnGameModeExit().
You can do it with the
for command to save it for all players. But you also should make a saving command which saves it In-Game and everytime you restart you server tell all players to use that command.
Bye.
Re: job system help -
Banditul18 - 19.06.2018
Quote:
Originally Posted by div
Код:
new query[24];
format(query, sizeof(query), "UPDATE `playerdata` SET `pjobselected` to 1");
mysql_tquery(dbHandle, query);
|
May i ask you, is this your actual query that you use or is just a representation? Because is wrong
Re: job system help -
Logic_ - 19.06.2018
Use the edit button (
) instead of double posting, it's there for a reason.
Re: job system help -
div - 19.06.2018
Quote:
Originally Posted by Logic_
Use the edit button ( ) instead of double posting, it's there for a reason.
|
link please, and read the thread, and check what is *WRITTEN* in it.
Re: job system help -
GTLS - 19.06.2018
Код:
new query[60];
format(query, sizeof(query), "UPDATE `playerdata` SET `pjobselected` = 1 WHERE = SOMETHING HERE...");
mysql_tquery(dbHandle, query);
Problem was your size of query. If you had posted MySQL Logs, it would show you that Query is empty because destination array is too small. Query was size of 24 while clearly, there are more than 24 characters.
Re: job system help -
div - 19.06.2018
fixed myself
thank you for your time btw..