Need help - 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: Need help (
/showthread.php?tid=76807)
Need help -
Bearfist - 06.05.2009
I created a makeadmin command and i want to add that when the password is 0987654321 he gets the admin status
and when its not..then not ^^
But I get these errors->
warning 206: redundant test: constant expression is non-zero
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Код:
if(strcmp("madmin",cmd,true) == 0)
{
new pass[256];
format(string,sizeof(string),"0987654321");
pass = strtok(cmdtext,index);
if(!strlen(pass))
{
SendClientMessage(playerid,COLOR_RED,"Usage:/madmin[password]");
return 1;
}
if(pass,string,true) == 0) //this line !
{
pAdmin[playerid] = 1;
SendClientMessage(playerid,COLOR_WHITE,"Succesful indentified as Admin!");
}
else if(pass,string,false) == 0)
{
SendClientMessage(playerid,COLOR_RED,"->!WRONG PASSWORD!<-");
}
return 1;
}
SOLUTION FOUND !!
TOPIC CAN BE CLOSED
Re: Need help -
Weirdosport - 06.05.2009
Once you have num_hashed or done w/e to the password, use strcmp:
if(!strcmp(password, "0987654321")) //This guy used the correct password
else //this tard is not worthy.