OnPlayerText -> do an action at a word? -
Rodri99 - 16.07.2015
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
Re: OnPlayerText -> do an action at a word? -
notime - 16.07.2015
What do you want to happen, explain in detail? o.O
Re: OnPlayerText -> do an action at a word? -
Rodri99 - 16.07.2015
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.
AW: OnPlayerText -> do an action at a word? -
Mencent - 16.07.2015
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
Re: OnPlayerText -> do an action at a word? -
nezo2001 - 16.07.2015
under OnPlayerText
PHP код:
if(strfind(text,"commands help",true) != -1)
{
//Your code
}
Re: OnPlayerText -> do an action at a word? -
lwilson - 16.07.2015
You mean /help will automatically send a message "use /cmds" ?
AW: OnPlayerText -> do an action at a word? -
Mencent - 16.07.2015
@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
Re: OnPlayerText -> do an action at a word? -
Rodri99 - 16.07.2015
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