SA-MP Forums Archive
how to compare string cell to character? - 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)
+--- Thread: how to compare string cell to character? (/showthread.php?tid=438915)



how to compare string cell to character? - HurtLocker - 22.05.2013

I want to make this check (detect if player enters command):
pawn Код:
if(text[0]=='/')
I tried exactly the code above, gets compiled but has no effect.


Re: how to compare string cell to character? - Richie© - 22.05.2013

You can use strfind for that.
https://sampwiki.blast.hk/wiki/Strfind


AW: how to compare string cell to character? - HurtLocker - 22.05.2013

Quote:
Originally Posted by Richie©
Посмотреть сообщение
You can use strfind for that.
https://sampwiki.blast.hk/wiki/Strfind
This is not what I asked. Title is pretty clear I think.

******: Yes, I used it under onplayertext. Now what?
EDIT: I go test it under OnPlayerCommandText

EDIT: damn, same thing. What can I do now?


Re: how to compare string cell to character? - Vince - 22.05.2013

OnPlayerCommandText gets called for every input that starts with a forward slash. What is so hard to understand about that?


AW: how to compare string cell to character? - HurtLocker - 22.05.2013

Ok I did this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (Jailed[playerid]==true) return SendClientMessage(playerid, 0xFF0000AA, "blabla");
return 0;
}
doesn't work