25.05.2013, 10:09
hey guys when im killing someone in my srv i will get score but when i relog it will gone so how can i save my scres in sript files ladmin\user\ini.sav
#include <dini>
enum pInfo
{
score
}
public OnPlayerConnect(playerid)
{
SetPlayerScore(playerid,0);
}
SStats(playerid)
{
dini_IntSet(Pos(playerid),"Score",GetPlayerScore(playerid));
}
LoadStats(playerid)
{
SetPlayerScore(playerid, dini_Int(Pos(playerid),"Score"));
}
public OnPlayerDeath(playerid, killerid, reason)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
PlayerInfo[i][Score] +=25;//or what you want
}
}
public OnGameModeInit()
{
LoadStats(playerid);
}