25.09.2011, 16:04
How can i make that it saves the playing hours and puts every hour +1 level
If i played 1h my score on tab should show 1 ?
If i played 1h my score on tab should show 1 ?
//under OnGameModeInit
SetTimer("gScore",3600000,1);
//Anywhere (out of any callback)
forward gScore();
public gScore()
{
foreach(Player,i)
{
SetPlayerScore(i,GetPlayerScore(i)+1);
}
return 1;
}
pawn Код:
Then, you could use Y_INI to save the players data. https://sampforum.blast.hk/showthread.php?tid=175565 |
pawn Код:
Then, you could use Y_INI to save the players data. https://sampforum.blast.hk/showthread.php?tid=175565 |
Thanks !! yes im using forearch and Y_Ini but like Cameltoe said i need this too
" As well, he should save every minute so that the player does not need to play 1 hour at once too reach level 1. " |
new ScoreTimer[MAX_PLAYERS];
new PlayerScore[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
ScoreTimer[playerid] = SetTimerEx("ScoreAdd", 1000 * 60, true, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(ScoreTimer[playerid]);
return 1;
}
forward ScoreAdd(playerid);
public ScoreAdd(playerid)
{
PlayerScore[playerid]++;
SetPlayerScore(playerid, floatround(PlayerScore[playerid], floatround_floor));
}