how to compare string cell to character?
#1

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.
Reply
#2

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

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?
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)