[Help] Undefined symbol "i"
#1

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

Hello!
PHP код:
for(new 0MAX_PLAYERSi++)
{
    if(
e_Participando[i] == true)
    {
        
TogglePlayerControllable(i0);
    }

Try this.
Reply
#3

It works, thank you very much.
Reply
#4

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?
Reply
#5

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

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;  
}
Reply
#7

Can someone help me?
Reply
#8

Quote:
Originally Posted by ApolloScripter
Посмотреть сообщение
Can someone help me?
Where are you using IniciarEvento();?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)