Client Message
#1

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

strcmp/strfind under OnPlayerText. AI is complicated though.
Reply
#3

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;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)