OnPlayerText -> do an action at a word?
#1

How can i send a client message of lock when a player tell a specify word?
I just need the line and i will make stocks, thanks
Reply
#2

What do you want to happen, explain in detail? o.O
Reply
#3

For example if a player tell: commands help, automatically a message will appear on chat telling : use /cmds, how can i do an action on a player word, it's some hard to explain? That's easy man, otherwise thanks.
Reply
#4

Hello!

This have to be in OnPlayerText and then you can to undertake your action.
PHP код:
if(!strcmp(text,"hello",true))
{
    
SendClientMessage(playerid,-1,"You have to put in: hello");

- Mencent
Reply
#5

under OnPlayerText
PHP код:
if(strfind(text,"commands help",true) != -1)
{
//Your code

Reply
#6

You mean /help will automatically send a message "use /cmds" ?
Reply
#7

@nezo2001:
If you will write an message with the words "commands help" you will be do the action. But if you only explain something with these words you will do this action too.
It doesn't the same as you use strcmp.


- Mencent
Reply
#8

watch guys

if(strfind(text, "sony commands help", true) != -1 || strfind(text, "commands help", true) != -1){
if(sony[playerid] == 1){
if(stringContainsIP(text))
{
SendClientMessage(playerid, white, "Sir, i am just a ChatBot i can't play other Servers");
return 1;
}
new str[128];
format(str, sizeof(str), "Sir %s, to watch Server Commands use /cmds, /ohelp, /help or /sdcteles", PlayerName2(playerid));
SendClientMessage(playerid, white, str);
} else {
SendClientMessage(playerid,white,"Sorry Sir, but i cannot understand very well your request, make a simple word");
return 1;
}
}


but when sony = 1 no message appears, and when sony = 0 appear the : i cant understand your request, i am making a bot but it doesnt work like i want
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)