[HowTo] Activate Variable W/ PassWord.
#10

Quote:
Originally Posted by sbґ
So something along with this?

I removed the AdminPW because you could just use the STRCMP line for both the password and the variable?

pawn Код:
dcmd_auth(playerid, params[])
{
  if(!strlen(params)) return SendClientMessage(playerid, COLOR_MSG ,"Error: No Input.");

  if(strcmp(params, "testpass", true) == 0)
  {
    Admin[playerid] = 1;
    SendClientMessage(playerid, COLOR_MSG,"You Have Logged As: Admin.");
    SendClientMessage(playerid, COLOR_MSG,"/Kick(id), /Ban(id), /Slap(id), Launch(id),/Explode(id)");
    SendClientMessage(playerid, COLOR_MSG,"/Goto(id), /Get(id), /Stfu(id),");
  }

  return 1;
}
Very close! Watch your return values, remember the function returns zero if the strings are equal. You were correct in removing the additional password declaration, and just using strcmp.

I changed the fourth line if you are having difficulty finding the alteration.
Reply


Messages In This Thread
[HowTo] Activate Variable W/ PassWord. - by shitbird - 05.06.2009, 17:08
Re: [HowTo] Activate Variable W/ PassWord. - by russiany - 06.06.2009, 20:28
Re: [HowTo] Activate Variable W/ PassWord. - by shitbird - 06.06.2009, 21:32
Re: [HowTo] Activate Variable W/ PassWord. - by samgreen - 06.06.2009, 21:41
Re: [HowTo] Activate Variable W/ PassWord. - by Weirdosport - 06.06.2009, 21:44
Re: [HowTo] Activate Variable W/ PassWord. - by shitbird - 06.06.2009, 21:45
Re: [HowTo] Activate Variable W/ PassWord. - by cigo - 06.06.2009, 21:48
Re: [HowTo] Activate Variable W/ PassWord. - by samgreen - 07.06.2009, 05:39
Re: [HowTo] Activate Variable W/ PassWord. - by shitbird - 07.06.2009, 10:20
Re: [HowTo] Activate Variable W/ PassWord. - by samgreen - 07.06.2009, 13:30

Forum Jump:


Users browsing this thread: 3 Guest(s)