Help voting system not working properly [URGENT]
#1

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
Reply
#2

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.
Reply
#3

it does, one is a postdecrement and one a predecrement
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)