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.