ZCMD string problem
#7

Quote:
Originally Posted by Airman123
Посмотреть сообщение
Код:
CMD:clan(playerid,params[]){
if(sscanf(params,"s",TinyString)) return MSG(playerid,C_RED,"/Clan [Invite/Kick/Join/Leave/SetRank/SetTag]");
if(strval(TinyString) == strval("Invite")) return MSG(playerid,C_RED,"Invite");
else if(strval(TinyString) == strval("Kick")) return MSG(playerid,C_RED,"Kick");
return 1;}
this may work, i just used "else" in 2nd case.
Quote:
Originally Posted by DarkLouis
Посмотреть сообщение
It will not work. You try to check NUMBER with letters!

You need STRCMP. Ex: if(strcmp(s, "Invite")) return MSG(playerid,C_RED,"Invite");
Still not working

pawn Код:
CMD:clan(playerid,params[]){
if(sscanf(params,"s",TinyString)) return MSG(playerid,C_RED,"/Clan [Invite/Kick/Join/Leave/SetRank/SetTag]");
if(strcmp(TinyString, "Invite")) return MSG(playerid,C_RED,"Invite");
if(strcmp(TinyString, "Kick")) return MSG(playerid,C_RED,"Kick");
return 1;}
Reply


Messages In This Thread
ZCMD string problem - by Lirbo - 05.05.2015, 09:28
Re: ZCMD string problem - by DarkLouis - 05.05.2015, 09:38
Re: ZCMD string problem - by Airman123 - 05.05.2015, 09:39
Re: ZCMD string problem - by Lirbo - 05.05.2015, 09:41
Re: ZCMD string problem - by DarkLouis - 05.05.2015, 09:42
Re: ZCMD string problem - by DarkLouis - 05.05.2015, 09:44
Re: ZCMD string problem - by Lirbo - 05.05.2015, 09:44
Re: ZCMD string problem - by Misiur - 05.05.2015, 09:44
Re: ZCMD string problem - by Lirbo - 05.05.2015, 09:49

Forum Jump:


Users browsing this thread: 1 Guest(s)