How to set SetTimerEx to all players ?
#1

I got this

SetTimerEx("vabReklaam1", 10000, false, "i", playerid);

But it works only for player himself, how to set timer to make such effect that when timer is started then all players are getting it's influence
Reply
#2

Add this to beginning of your vabReklaam1 timer:

for(new i=0; i < MAX_PLAYERS; i++)
{

And then when there is for instance SetPlayerHealth(playerid, 100);
change it to SetPlayerHealth(i, 100);

And that for every actoin in vabReklaam1.

I'm not sure if thats the best way, but it works.
Reply
#3

do you mean you want just one timer for everyone or you want a timer to start for everyplayer?
Reply
#4

To everybody, it denies to use command for 10 seconds
Reply
#5

Quote:
Originally Posted by Johnson_boy
Add this to beginning of your vabReklaam1 timer:

for(new i=0; i < MAX_PLAYERS; i++)
{

And then when there is for instance SetPlayerHealth(playerid, 100);
change it to SetPlayerHealth(i, 100);

And that for every actoin in vabReklaam1.

I'm not sure if thats the best way, but it works.
Using:
pawn Код:
for(new u = 0; u < MAX_PLAYERS; u++) SetTimerEx("vabReklaam1", 10000, false, "i", u);
would cause lag.

Use one timer (SetTimer-function) and make a loop for all players inside it.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)