Checking for a nickname
#1

So, I have it so where admins can have a 'admin nickname'. I'm trying to make it so only someone with a specific admin nickname can access a command. Can anyone help me with this? Here's the line:

Код:
if (PlayerInfo[playerid][pAdmName] == "Insanity")
error:
Код:
error 033: array must be indexed (variable "-unknown-")
I don't know how to set it up exactly and it's even worse because it's late at night.
Reply
#2

pawn Код:
GetPlayerName(playerid,PlayerInfo[playerid][pAdmName],sizeof(PlayerInfo[playerid][pAdmName]);
    if(strfind(PlayerInfo[playerid][pAdmName],"Insanity",true) != 1)
    {
        //Whatever here
    }
Reply
#3

pawn Код:
if(!strcmp(PlayerInfo[playerid][pAdmName], "Insanity", true))
{
    SendClientMessage(playerid, 0xFF9900FF, "Your name is Insanity!");
}
else
{
    SendClientMessage(playerid, 0xFF0000FF, "You are not Insanity!");
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)