18.03.2012, 20:56
you will need A Global Player variable to stoer the players time in.
then load & save it every time the player joins becouse you cant just set the timer again just OnPlayerConnect
i cannot show u and exmaple now :X dont have alot of time.
Example
then load & save it every time the player joins becouse you cant just set the timer again just OnPlayerConnect
i cannot show u and exmaple now :X dont have alot of time.
Example
pawn Код:
new PTimer[MAX_PLAYERS];//At the top so its global
//then SetTimerEx on 'OnPlayerConnect'
public OnPlayerConnect(playerid)
{
//Dont know what saving System you use so just load the ''PTimer''
SetTimerEx("AfterTime", PTimer[playerid], false, "i", playerid);
forward AfterTime(playerid);
public AfterTime(playerid)
{
//pLevel=+1;
//Change to your pLevel variable
return 1;
}
}
Then 'OnPlayerDisconnect' make sure to save the time.
public OnPlayerDisconnect(playerid)
{
//This is saved with 'Y_INI'
new name[MAX_PLAYER_NAME], file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/mRegistration/Settings/%s.txt",name);
INI_WriteInt(file,"ServerTime",PTimer[playerid]);
return 1;
}