multi strcmp - 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: multi strcmp (
/showthread.php?tid=87787)
multi strcmp -
Mikeses - 22.07.2009
hello... my command is the /nrg .....
Код:
.......
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/nrg", cmdtext, true))
{
SendClientMessage(playerid, 0xAA3333AA, "You spawned nrg");
.....
return.........
and i need send client message when player type /nrg a; /nrg b; /nrg 165498; /nrg kolokolomlynsky;
HOW ?
Re: multi strcmp -
James_Alex - 22.07.2009
try
pawn Код:
if(strcmp("/nrg", cmdtext, true) == 0 || strcmp("/nrga", cmdtext, true) == 0 || strcmp("/nrgb", cmdtext, true) == 0...)
Re: multi strcmp -
Westie - 22.07.2009
...or you could use something like
this.
Re: multi strcmp -
Mikeses - 22.07.2009
Quote:
Originally Posted by James_Alex(Coder)
try
pawn Код:
if(strcmp("/nrg", cmdtext, true) == 0 || strcmp("/nrga", cmdtext, true) == 0 || strcmp("/nrgb", cmdtext, true) == 0...)
|
NO !
commands are random...
Код:
e. g. /nrg a; /nrg fuck; /nrg dfz8h4s7h; /nrg blabla
Re: multi strcmp -
Mikeses - 22.07.2009
pls it is possible
Re: multi strcmp -
yezizhu - 22.07.2009
I think I get what you mean
Код:
if(!strcmp("nrg",cmdtext[1]) \\ !strcmp("nrg ",cmdtext[1],true,4)){
//bla...
}
Re: multi strcmp -
Mikeses - 22.07.2009
i complete this