help me with this error
#1

i have this command
pawn Код:
dcmd_ban(playerid, params[])
{
    if(GetPVarInt(playerid, "Admin") >= 1) //vede se и + di lvl 1
    {
        new id, tmp[128],string[128];
        if(sscanf(params, "uz", id, tmp)) return SendClientMessage(playerid, RED, "[AIUTO]: /BAN [ID / NOME] [MOTIVO]");
        if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, RED, "Questo player и offline o sei tu");
        format(string, sizeof string, "Player: %s и stato bannato da %s [Morivo :%s]",Name(id),AdminName(playerid),tmp);
        SendClientMessageToAll(YELLOW, string), print(string),
        format(string,sizeof(string),"Bannato da %s",AdminName(playerid));
        SendCommandMsg(playerid,"ban");
    }
    return BanEx(id,tmp);
}
i get one error
pawn Код:
error 017: undefined symbol "id"
but id is defined :/:/:/:/:/:/
Reply
#2

pawn Код:
dcmd_ban(playerid, params[])
{
    new id,tmp[128];
    if(GetPVarInt(playerid, "Admin") >= 1) //vede se и + di lvl 1
    {
        new string[128];
        if(sscanf(params, "uz", id, tmp)) return SendClientMessage(playerid, RED, "[AIUTO]: /BAN [ID / NOME] [MOTIVO]");
        if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, RED, "Questo player и offline o sei tu");
        format(string, sizeof string, "Player: %s и stato bannato da %s [Morivo :%s]",Name(id),AdminName(playerid),tmp);
        SendClientMessageToAll(YELLOW, string), print(string),
        format(string,sizeof(string),"Bannato da %s",AdminName(playerid));
        SendCommandMsg(playerid,"ban");
    }
    return BanEx(id,tmp);
}
Try that id is only defined inside the block of code so banex cant use it same with tmp. Tmp and id scope was inside the block of code.
Reply
#3

which line?
Reply
#4

oh my bad -_- now work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)