[HELP] mysql acc
#1

Hello today I was enter with few friend and all of us we are logged sucesfully and one of them can't logged in. And I go to his account and there is setted on 0 but yesterday he was enter fine if you know what I mean? Thanks
Reply
#2

Could you possibly explain this a little better? What was set to zero?
Reply
#3

for example he was yesterday enter as all variable fine he was lvl 5 he has skin id 7 spawnchachange on 1 registered on variable 1 tutorial on 1 and somehow all of that was become 0 when he was trying to log in to server and then I was go to his account and all of that was 0 skin leader member level money spawnchange registered tutorial admin job jobcontract ... etc. What could be a problem. Thanks
Reply
#4

anyone? thanks
Reply
#5

please anyone? thanks
Reply
#6

mind showing OnPlayerDisconnect
i think i know whats the probelm
Reply
#7

here


pawn Код:
mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `Level` = %d,`Money` = %d,`Registered` = %d,`SpawnChange` = %d,`Sex` = %d,`Years` = %d WHERE `ID` = '%d'",PlayerInfo[playerid][Level],
    PlayerInfo[playerid][Money],PlayerInfo[playerid][Registered],PlayerInfo[playerid][SpawnChange],PlayerInfo[playerid][Sex],PlayerInfo[playerid][Years],PlayerInfo[playerid][ID]);
    mysql_tquery(mysql,query,"","");
   
    mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `Origin` = %d,`Skin` = %d,`Tutorial` = %d,`Member` = %d,`Leader` = %d WHERE `ID` = '%d'",PlayerInfo[playerid][Origin],
    PlayerInfo[playerid][Skin],PlayerInfo[playerid][Tutorial],PlayerInfo[playerid][Member],PlayerInfo[playerid][Leader],PlayerInfo[playerid][ID]);
    mysql_tquery(mysql,query,"","");
   
    mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `Admin` = %d,`GameMaster` = %d,`Quiet` = %d,`AdminPlace` = %d,`Rank` = %d,`Bank` = %d WHERE `ID` = '%d'",PlayerInfo[playerid][Admin],
    PlayerInfo[playerid][GameMaster],PlayerInfo[playerid][Quiet],PlayerInfo[playerid][AdminPlace],PlayerInfo[playerid][Rank],PlayerInfo[playerid][Bank],PlayerInfo[playerid][ID]);
    mysql_tquery(mysql,query,"","");
Reply
#8

so the problem is that if player doesnt login and quits then also OnPlayerDisconnct is called so without logging in his skin and money are not loaded so it saves it as zero so solution to this is --
pawn Код:
new bool:Logged[MAX_PLAYERS];//on top under includes

Logged[playerid]=true;//under OnPlayerSpawn

if(Logged[playerid]==true)//in OnPlayerDiscoonect
{
Logged[playerid]=false;
//now here the saving things onplayerdiscconect
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)