20.10.2011, 18:02
How can I make a Playing hour System where the player levels up every hour
Thanks
Thanks
// under OnGameModeInit
SetTimer("LevelUp",3600000,1); // 60 minutes
// bottom of script
forward LevelUp(playerid);
public LevelUp(playerid)
{
// use your variables / playerinfo information here like if(PlayerInfo[playerid][LoggedIn] == 1) etc..
SendClientMessage(playerid,-1,"You've Played For An Hour! Received +1 Score.");
SetPlayerScore(playerid,GetPlayerScore(playerid) +1);
return 1;
}
Something like this I guess:
pawn Код:
|
SetTimer("Time", 60000, true); //gamemodeinit.
public Time()
{
new hour, minute, second; // variables
gettime(hour, minute, second); // current time
foreach(Player, i) //loops through all the players
{
SetPlayerTime(i, hour, minute); //set game time.
PlayerInfo[i][pTime]++; //+1 minute
SetPlayerScore(i, floatround(CharInfo[i][cTime] / 60, floatround_floor)); // updating score (shows in hours)
}
return 1;
}