[Help] Undefined symbol "i" -
ApolloScripter - 19.11.2018
Someone can help me? when i compile my GM he gives me this error below:
error 017: undefined symbol "i"
Complete Code:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
if(e_Participando[i] == true)
{
TogglePlayerControllable(i, 0);
}
Error Line:
pawn Код:
TogglePlayerControllable(i, 0);
if someone can help me, I would be grateful, thanks in advance.
Re: [Help] Undefined symbol "i" -
Mencent - 19.11.2018
Hello!
PHP код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(e_Participando[i] == true)
{
TogglePlayerControllable(i, 0);
}
}
Try this.
Re: [Help] Undefined symbol "i" -
ApolloScripter - 19.11.2018
It works, thank you very much.
Re: [Help] Undefined symbol "i" -
ApolloScripter - 19.11.2018
Just one more thing, if you can help me, I posted here to avoid posting another unnecessary Thread, the whole command is this:
pawn Код:
ACMD:congelarevento[1](playerid, params[])
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(e_Participando[i] == true)
{
TogglePlayerControllable(i, 0);
}
}
new str[544];
format(str, sizeof(str), "[ > ] O Administrador {FFFFFF}%s{00D0F6} congelou todos participantes do evento!", name);
SendClientMessageToAll(COLOR_LIGHTBLUE, str);
return 1;
}
it is meant to freeze only those who are participating in the event, so I did a check, in case you are participating in the event is as (true), following the command, it was for everyone who is participating to be frozen, but that does not happen, you know why?
Re: [Help] Undefined symbol "i" -
Leaky - 20.11.2018
Quote:
Originally Posted by ApolloScripter
Just one more thing, if you can help me, I posted here to avoid posting another unnecessary Thread, the whole command is this:
pawn Код:
ACMD:congelarevento[1](playerid, params[]) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name));
for(new i = 0; i < MAX_PLAYERS; i++) { if(e_Participando[i] == true) { TogglePlayerControllable(i, 0); } }
new str[544]; format(str, sizeof(str), "[ > ] O Administrador {FFFFFF}%s{00D0F6} congelou todos participantes do evento!", name); SendClientMessageToAll(COLOR_LIGHTBLUE, str); return 1; }
it is meant to freeze only those who are participating in the event, so I did a check, in case you are participating in the event is as (true), following the command, it was for everyone who is participating to be frozen, but that does not happen, you know why?
|
Show how did u define
"e_Participando" and show the code where you set
"e_Participando" to a value.
Re: [Help] Undefined symbol "i" -
ApolloScripter - 20.11.2018
The definition on top of GM
pawn Код:
new bool:e_Participando[MAX_PLAYERS];
Player command that checks if he wants to go to the event
pawn Код:
CMD:irevento(playerid)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[ > ] Vocк estб participando, aguarde o evento comeзar!");
e_Participando[playerid] = true;
checkirevento = true;
return 1;
}
And here, its a timer that i set to event start by himself, which also has "e_Participando"
pawn Код:
forward IniciarEvento();
public IniciarEvento()
{
foreach(new i : Player)
{
if(e_Participando[i] == true)
{
e_Participando[i] = false;
SetPlayerPos(i, e_Pos[0], e_Pos[1], e_Pos[2]);
SetPlayerVirtualWorld(i, e_VW);
SetPlayerInterior(i, e_Int);
checkirevento = true;
}
}
SendClientMessageToAll(COLOR_LIGHTBLUE, "[ EVENTO ] Todos os participantes foram puxados.");
return 1;
}
Re: [Help] Undefined symbol "i" -
ApolloScripter - 20.11.2018
Can someone help me?
Re: [Help] Undefined symbol "i" -
Electrifying - 20.11.2018
Quote:
Originally Posted by ApolloScripter
Can someone help me?
|
Where are you using IniciarEvento();?