Client Message - 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: Client Message (
/showthread.php?tid=435627)
Client Message -
lsreskjn - 07.05.2013
Hey guys, I want to know how to make a script that....when player type in chat "how are you" server will send a meesage "i'm good, what about you?'..is that possible?
Re: Client Message -
MP2 - 07.05.2013
strcmp/strfind under OnPlayerText. AI is complicated though.
Respuesta: Client Message -
LoLeRo - 07.05.2013
Lets think that we want a car and we dont know how to, you can make this:
Quote:
public OnPlayerText(playerid, text[])
{
if(strfind(text, "how", true) != -1 && strfind(text, "get car", true) != -1) {
// our code goes here (giving the vehicle)
}
return 1;
}
|
Using your example:
Quote:
public OnPlayerText(playerid, text[])
{
if(strfind(text, "how are you", true) != -1) {
SendClientMessage(playerid, BLUE, "i'm good, what about you?");
return 0;
}
return 1;
}
|