How to..
#1

How to make a payday to give me on every round hour to give me award and need to played 20 minutes in server?
Reply
#2

you need to use a timer

search for function SetTimer or SetTimerEx
Reply
#3

On player connect

SetTimerEx("payday", 1200000, true, "i", playerid);

Creating public

forward payday(playerid);

public payday(playerid)
{
GivePlayerMoney(playerid, 500);
return 1;
}
Reply
#4

Код:
SetTimer("paytime", 3600000, 1);
This is my timer it is for only round hour or?
Reply
#5

Yes, you can do something like that if you are not sure:
Код:
1000 * 60 * 60
In timer:
Код:
for(new A,B = GetMaxPlayers(); A < B; A++)
{
	if(IsPlayerConnected(A))
	{
		//Code for all players after every one hour.
	}
}
Reply
#6

So it's ok the timer? And this a,b for what it?
Reply
#7

It's loop for all players. If you want for one player you need to use SetTimerEx. Same time but other parameters.
https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#8

Where to add it, i have 2 timers on ongamemodeinit and onfilterscriptinit..?
Reply
#9

Код:
SetTimerEx("paytime",3600000,1,"i",playerid);
In OnPlayerConnect.
And that callback somewhere:
Код:
forward paytime(playerid);
public paytime(playerid)
{
	//Code for player every one hour.
}
Reply
#10

Yeah but the timers it's not work.. Dont give me money on round hour..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)