#4

Nope, money and xp not saved
Now code look:
Quote:

public OnPlayerDisconnect(playerid, reason)
{
ResetPlayerInfo(playerid);
SavePlayerInfo(playerid);
return 1;
}
////////////////////////////
ResetPlayerInfo(playerid)
{
sInfo[playerid][kazkas] = 0;
sInfo[playerid][id] = 0;
sInfo[playerid][adminlevel] = 0;
sInfo[playerid][XP] = 0;
sInfo[playerid][pinigai] = 0;
return 1;
}
SavePlayerInfo(playerid)
{
if(sInfo[playerid][kazkas] == 0) return 1;

sInfo[playerid][XP] = GetPlayerScore(playerid);
sInfo[playerid][pinigai] = GetPlayerMoney(playerid);

if(sInfo[playerid][kazkas] == 0) return 1;
new query[256];
format(query, sizeof(query), "UPDATE `user` SET XP='%i', pinigai='%i', adminlevel='%i' WHERE id='%i'", sInfo[playerid][XP], sInfo[playerid][pinigai], sInfo[playerid][adminlevel], sInfo[playerid][id]);
mysql_function_query(manomysql, query, false, "", "");
return 1;
}

Reply


Messages In This Thread
Help - by Heress - 30.10.2018, 09:14
Re: Help - by Tenka - 30.10.2018, 09:34
Re: Help - by TheToretto - 30.10.2018, 09:35
Re: Help - by Heress - 30.10.2018, 09:43
Re: Help - by Heress - 30.10.2018, 14:11
Re: Help - by UFF - 30.10.2018, 14:22
Re: Help - by Heress - 30.10.2018, 14:30
Re: Help - by TheToretto - 30.10.2018, 14:33
Re: Help - by UFF - 30.10.2018, 14:39
Re: Help - by Heress - 30.10.2018, 14:41
Re: Help - by Heress - 30.10.2018, 14:45

Forum Jump:


Users browsing this thread: 1 Guest(s)