SetTimer score
#1

Hey im trying to make a SetTimer

I want it to give a person 12score each 5 mins

But the problem i have, i have no idea where to place the SetTimer and the code.

Would love some help!


If someone could make a quick FS and show me on Pastebin i would be greatful.
Reply
#2

You would have to use SetTimerEx for player-specific timers, and you should start them at OnPlayerConnect for your purpose:

pawn Код:
SetTimerEx( "MyTimer", ( 5 * 60 * 1000 ), true, "i", playerid );
// 5 * 60 * 1000 = 5 minutes, i = integer, playerid is the chosen integer to use as parameter
pawn Код:
forward MyTimer(playerid); //here put the parameter - you may call it whatever you like, but make sure it matches the data you send( in this case: integer)
public MyTimer(playerid)
{
    SetPlayerScore( playerid, ( GetPlayerScore( playerid ) + 12 ));
    return true;
}
And there you have it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)