help with vote to give all health !!!
#10

its work TU, but i forget something !!!

i want make if the votes (7/7) , load new map ( for counter strike server )

under: SetPlayerHealth(i, 100.0); i want add this but i didnt know how !!!

This Is The Full Cmd To change map :

Quote:

if(strcmp(cmd, "/nextmap", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 2)
{
SetTimer("Nextmap", 2000, 0);
for(new i = 0; i < MAX_PLAYERS; i++)
{
TogglePlayerControllable(i, 0);
}
}
}
return 1;
}

So I Want Add This To Load New Map After The Votes (7/7)

i try this but didnt work :

Quote:

if(strcmp("/vote", cmdtext, true) == 0)
{
if(IsVoteRunning == 0)
{
SendClientMessage(playerid, COLOR, "There is no vote running!");
}
else if(PlayerHasVoted[playerid] == 1)
{
SendClientMessage(playerid, COLOR, "You have already voted!");
}
else
{
new Name[MAX_PLAYER_NAME], string[64];
PlayerHasVoted[playerid] = 1;
Votes ++;
format(string, sizeof(string), "%s has voted (%d/7)!", Name, Votes);
SendClientMessageToAll(COLOR, string);
if(Votes == 7)
{
KillTimer(VoteTimer);
IsVoteRunning = 0;
Votes = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerHasVoted[i] == 1)
{
PlayerHasVoted[i] = 0;
}
SetPlayerHealth(i, 100.0); // this give all health after votes (7/7)
SetTimer("Nextmap", 2000, 0); //and this to load new map
for(new i = 0; i < MAX_PLAYERS; i++) // and this
TogglePlayerControllable(i, 0);
}

SendClientMessageToAll(COLOR, "Votes have reached 7! Everyone's health has been restored!");
}
}
}
return 0;
}

it show this error :

Quote:

C:\Documents and Settings\789\Desktop\xtream\filterscripts\vote.pwn (82) : warning 219: local variable "i" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Plz Help... :/
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)