SA-MP Forums Archive
Simple round changer, works perfectly but only for id 0 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Simple round changer, works perfectly but only for id 0 (/showthread.php?tid=316858)



Simple round changer, works perfectly but only for id 0 - Kontrol - 08.02.2012

Ok so ive created like a round changer for my cod gm which will change the map .etc but it only works for id 0 ive realized its the timers i think, ive used SetTimer when it should be SetTimerEx but i dont know how to edit it all with the new times for it all to work still so if someone could help me out it would be greatly appreciated.

http://pastebin.com/r9wQrDq7

I would really appreciate it if somebody can help


Re: Simple round changer, works perfectly but only for id 0 - Kontrol - 09.02.2012

Bump


Re: Simple round changer, works perfectly but only for id 0 - Sufyan - 09.02.2012

use for loop

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


}

or use this tutorial
https://sampforum.blast.hk/showthread.php?tid=269336


Re: Simple round changer, works perfectly but only for id 0 - Kontrol - 09.02.2012

I do use loops


Re: Simple round changer, works perfectly but only for id 0 - Lorenc_ - 09.02.2012

Do you realise how poor that loop is initiated? BTW, that's not dynamic, it's a static map changing system lol. Kind of off-topic but when I first said to you, is your map system dynamic you said yes :O

Consider using foreach or use this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) if( IsPlayerConnected( i ) )
                {
}



Re: Simple round changer, works perfectly but only for id 0 - Kontrol - 09.02.2012

Yeah I know I need to check if the player is connected that's something I need to add into the whole gm but initially I would like to get this working then I can make the relevant changes within the gm


Re: Simple round changer, works perfectly but only for id 0 - Ballu Miaa - 09.02.2012

Dynamic means that the particular FS will work same as it will work in mine or your's. Its designed in such a way that it will work on every Server. Static needs us to set settings manually or change it according to the Usage!


Re: Simple round changer, works perfectly but only for id 0 - Kontrol - 09.02.2012

Yes I know that? All I need help with is fixing it so it just doesn't work for ID 0


Re: Simple round changer, works perfectly but only for id 0 - Universal - 09.02.2012

You are using
pawn Код:
SetTimer("SetupPlayerForPlaying", 60000, true);
Which is wrong way to call a timer for a specified player. Use this instead:
pawn Код:
SetTimerEx("SetupPlayerForPlaying", 60000, true, "d", i);
And put this inside the loop block, because whe need that "i", which we'll get from the "for" loop.


Re: Simple round changer, works perfectly but only for id 0 - Kontrol - 09.02.2012

Ok il try that when I get home