public OnPlayerUpdate(playerid)
{
new file[128];
new uCash = GetPlayerMoney(playerid);
dini_IntSet(file,"AdminLevel", PlayerInfo[playerid][AdminLevel]);
dini_IntSet(file,"Cash", uCash);
dini_IntSet(file,"Kills", PlayerInfo[playerid][pKills]);
dini_IntSet(file,"Deaths", PlayerInfo[playerid][pDeaths]);
dini_IntSet(file,"Locked", PlayerInfo[playerid][pLocked]);
dini_IntSet(file,"Local", PlayerInfo[playerid][pLocal]);
dini_IntSet(file,"Int", PlayerInfo[playerid][pInt]);
}
new name[MAX_PLAYER_NAME];
format(file, sizeof(file), "%s.ini", name);
Originally Posted by WESTre
You didn't open the file of the player.
Assuming you use the .ini extension, use this. pawn Код:
|
public OnPlayerConnect(playerid)
{
//Set a timer for the player that repeats every 2 seconds to update the player's stats...
SetPVarInt(playerid, "UpdateTimer", SetTimerEx("UpdatePlayer", 2000, true, "i", playerid));
}
public OnPlayerDisconnect(playerid)
{
//Kill the update timer for the player...
KillTimer(GetPVarInt(playerid, "UpdateTimer"));
}
//Called every 2 seconds for a player
stock UpdatePlayer(playerid)
{
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "%s.ini", name);
new uCash = GetPlayerMoney(playerid);
dini_IntSet(file,"AdminLevel", PlayerInfo[playerid][AdminLevel]);
dini_IntSet(file,"Cash", uCash);
dini_IntSet(file,"Kills", PlayerInfo[playerid][pKills]);
dini_IntSet(file,"Deaths", PlayerInfo[playerid][pDeaths]);
dini_IntSet(file,"Locked", PlayerInfo[playerid][pLocked]);
dini_IntSet(file,"Local", PlayerInfo[playerid][pLocal]);
dini_IntSet(file,"Int", PlayerInfo[playerid][pInt]);
return 1;
}
error 017: undefined symbol "SetPVarInt" error 017: undefined symbol "GetPVarInt"
Originally Posted by kujox32
http://forum.sa-mp.com/index.php?topic=171553.0
Is that the problem then pot? Код:
error 017: undefined symbol "SetPVarInt" error 017: undefined symbol "GetPVarInt" |
Originally Posted by [___
PotH3Ad ]
Quote:
I don't really think that's the problem in the video though, but the onplayerupdate callback will cause a lot of lag when saving shit every time its called so you should use the timer instead. |