07.06.2009, 10:20
Quote:
|
Originally Posted by samgreen
Here is the documentation if you would like to adapt it. Remember, the parameters with equal signs are OPTIONAL.
![]() strcmp(const string1[], const string2[], bool: ignorecase=false, length=cellmax) string1 - The first string in the comparison. string2 - The first string in the comparison. ignorecase - If logically “true”, case is ignored during the comparison. length - The maximum number of characters to consider for comparison. The return value is: −1 if string1 comes before string2, 1 if string1 comes after string2, or 0 if the strings are equal (for the matched length). |
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))
{
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;
}
?


