29.05.2015, 23:48
Well, I need help because i am new in mysql scripting. I would be your thankful if you guyz help me.
I'm using.
Now, Help me how to script which save players skin when they relog. Thanks!
I'm using.
PHP код:
enum _PSTATS
{
pLayaName[24],
pPassword[35],
pKills,
pDeaths,
pMoney,
pLevel
}
PHP код:
stock SavePInfo(playerid)
{
if(GetPVarInt(playerid, "LoggedIN") == 1)
{
new
Query[600];
format(Query, sizeof(Query), "UPDATE `playerinfo` SET `kills` = %d, `deaths` = %d, `money` = %d, `Level` = %d WHERE `user` = '%s'", // Also remember to update this...
PVar[playerid][pKills],
PVar[playerid][pDeaths],
GetPlayerMoney(playerid),
PVar[playerid][pLevel],
pName(playerid));
mysql_query(Query);
mysql_free_result();
return 1;
}
else return 0;
}
PHP код:
stock ResetPVars(playerid)
{
PVar[playerid][pLevel] = 0;
PVar[playerid][pKills] = 0;
PVar[playerid][pDeaths] = 0;
PVar[playerid][pMoney] = 0;
}