public OnPlayerText(playerid, text[])
{
if (strfind(text, "lifterman") != -1)
{
new string[80], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "lifterman: What do you want %s?", name);
SendClientMessageToAll(0xFFFFFFFF, string);
}
else if (strfind(text, "who are you?") != -1)
{
new string[80], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "lifterman: I am your worst nightmare!", name);
SendClientMessageToAll(0xFFFFFFFF, string);
}
else if (strfind(text, "fuck you") != -1)
{
new string[80], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string),"lifterman: You talking to me %s? or did you just got owned? haha", name);
SendClientMessageToAll(0xFFFFFFFF, string);
}
return 1;
}
"OnPlayerText" is called BEFORE the text is shown, the "return 1" signals the server to show it, which is how "return 0" can cancel text. To do this you would need to set a 0ms timer to show the reply.
|