Now I have another question.
Your fix works good, but after map vote is done, the server crashes.... I'll send you the public where it goes after ending the vote, tell me why is that..
PHP Code:
/* Global Variable in this code */
new changemapto
/* Global... */
public EndVote()
{
new x = 0;
new c = 0;
while ((x != 5) && (c != 5))
{
if (gVotes[x] >= gVotes[c])
{
if ((x == 4) && (c == 4))
{
client_print(0, print_chat, "%s The current map will be extended for this match. Match will start in 10 seconds.", PREFIX)
set_task(10.0, "StartMatch")
continue;
}
else if ((x == 0) && (c == 4))
{
client_print(0, print_chat, "%s The map will be changed within 10 seconds. The map that was chosen is: %s.", PREFIX, mapschosen[0])
changemapto = 0
set_task(10.0, "ChangeMap")
continue;
}
else if ((x == 1) && (c == 4))
{
client_print(0, print_chat, "%s The map will be changed within 10 seconds. The map that was chosen is: %s.", PREFIX, mapschosen[1])
changemapto = 1
set_task(10.0, "ChangeMap")
continue;
}
else if ((x == 2) && (c == 4))
{
client_print(0, print_chat, "%s The map will be changed within 10 seconds. The map that was chosen is: %s.", PREFIX, mapschosen[2])
changemapto = 2
set_task(10.0, "ChangeMap")
continue;
}
else if ((x == 3) && (c == 4))
{
client_print(0, print_chat, "%s The map will be changed within 10 seconds. The map that was chosen is: %s.", PREFIX, mapschosen[3])
changemapto = 3
set_task(10.0, "ChangeMap")
continue;
}
c++
}
else
{
x++
c = 0
}
}
}
public ChangeMap()
{
new maptochangeto[25]
copy(maptochangeto, 24, mapschosen[changemapto])
server_cmd("changelevel %s", maptochangeto)
}