Lil question
#2

You can try to create player variables. You know what, I will try it for you


Add this at OnPlayerConnect(playerid)
pawn Код:
new hour, minute, second, starts[MAX_PLAYERS][3];
printf("2-hours score has started for %d. The time currently is %02d:%02d:%02d", hour, minute, second);
starts[playerid][0] = hour;
starts[playerid][1] = minute;
starts[playerid][2] = second;
Add this at OnPlayerUpdate
NOTE: If your server gets laggy, create a global timer with OnPlayerUpdateEx and set the time you want to update the player

pawn Код:
new hour, minute, second;
getTime(hour, minute, second));
if(hour == starts[playerid][0]+2 && minute == starts[playerid][1] && second = starts[playerid][2])
{
/* EXPLANATION FOR ABOVE
Since you want it only 2 hours. You don't need to edit the minutes or seconds because you want it once 2 hours
It just checks if the player since he connected is 2 hours long on the server
*/

    SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
    printf("Player %d has received an extra score for being online on the server for 2 hours. Time is %02d:%02d:%02d", getTime(hour, minute, second));
}
Add this at OnPlayerDisconnect
pawn Код:
starts[playerid][0] = 0;
starts[playerid][1] = 0;
starts[playerid][2] = 0;
Reply


Messages In This Thread
Lil question - by Tanush123 - 17.08.2011, 18:19
Re: Lil question - by KingTurtle - 17.08.2011, 18:21
Re: Lil question - by Tanush123 - 17.08.2011, 18:57
Re: Lil question - by Tanush123 - 17.08.2011, 21:04
Re: Lil question - by =WoR=Varth - 18.08.2011, 02:39
Re: Lil question - by Tanush123 - 18.08.2011, 03:16
Re: Lil question - by =WoR=Varth - 18.08.2011, 03:21
Re: Lil question - by Tanush123 - 18.08.2011, 14:59
Re: Lil question - by Pinguinn - 18.08.2011, 15:39

Forum Jump:


Users browsing this thread: 5 Guest(s)