Help voting system not working properly [URGENT] - 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: Help voting system not working properly [URGENT] (
/showthread.php?tid=598444)
Help voting system not working properly [URGENT] -
legho - 12.01.2016
i have made a simple map voting system, player presses enter votes for there map then when the voting is finished the server loads the map.
when the player votes for say map 2 it says map 0 loaded
can anybody help me please
im willing to give a small donation if anyone can help
http://pastebin.com/yUR3LUFN
Re: Help voting system not working properly [URGENT] -
-CaRRoT - 13.01.2016
Quote:
Originally Posted by legho
i have made a simple map voting system, player presses enter votes for there map then when the voting is finished the server loads the map.
when the player votes for say map 2 it says map 0 loaded
can anybody help me please
im willing to give a small donation if anyone can help
http://pastebin.com/yUR3LUFN
|
Код:
for (new i=0; i <sizeof(MapVoted); ++i)
{
if (MapVoted[i] > value) value = MapVoted[i]+1; //+1 because map ids start from 1 and not 0
Why do you start the loop from 0 then? Plus I've never seen ++i in a loop before, its usually i++, I am not sure if it would make a difference.
Re: Help voting system not working properly [URGENT] -
BiosMarcel - 13.01.2016
it does, one is a postdecrement and one a predecrement
Re: Help voting system not working properly [URGENT] -
legho - 13.01.2016
Quote:
Originally Posted by -CaRRoT
Код:
for (new i=0; i <sizeof(MapVoted); ++i)
{
if (MapVoted[i] > value) value = MapVoted[i]+1; //+1 because map ids start from 1 and not 0
Why do you start the loop from 0 then? Plus I've never seen ++i in a loop before, its usually i++, I am not sure if it would make a difference.
|
Ive just tried what you said, still not working properly