26.05.2013, 15:10
First do
at the top of script
Then go on
Now do for save stats
Now go for load stats
After this
in Last do
at the top of script
pawn Код:
#include <dini>
pawn Код:
enum pInfo
{
score
}
pawn Код:
public OnPlayerConnect(playerid)
{
SetPlayerScore(playerid,0);
}
pawn Код:
SStats(playerid)
{
dini_IntSet(Pos(playerid),"Score",GetPlayerScore(playerid));
}
pawn Код:
LoadStats(playerid)
{
SetPlayerScore(playerid, dini_Int(Pos(playerid),"Score"));
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
PlayerInfo[i][Score] +=25;//or what you want
}
}
pawn Код:
public OnGameModeInit()
{
LoadStats(playerid);
}