Checking for a nickname - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checking for a nickname (
/showthread.php?tid=224079)
Checking for a nickname -
Zack9764 - 11.02.2011
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.
Re: Checking for a nickname -
Tee - 11.02.2011
pawn Код:
GetPlayerName(playerid,PlayerInfo[playerid][pAdmName],sizeof(PlayerInfo[playerid][pAdmName]);
  if(strfind(PlayerInfo[playerid][pAdmName],"Insanity",true) != 1)
  {
    //Whatever here
  }
Re: Checking for a nickname -
Pooh7 - 11.02.2011
pawn Код:
if(!strcmp(PlayerInfo[playerid][pAdmName], "Insanity", true))
{
  SendClientMessage(playerid, 0xFF9900FF, "Your name is Insanity!");
}
else
{
  SendClientMessage(playerid, 0xFF0000FF, "You are not Insanity!");
}