25.04.2011, 09:16
You've missed quite a lot here.
1) You've not included the appropriate variables for the OnPlayerText callback: playerid and text
2) strcmp requires the 2 parameters be enclosed in the function in the if statement, and you need to use quotation marks to contain the message
3) strcmp isn't a wise choice for this, I suggest usage of strfind instead.
Here's the working code:
1) You've not included the appropriate variables for the OnPlayerText callback: playerid and text
2) strcmp requires the 2 parameters be enclosed in the function in the if statement, and you need to use quotation marks to contain the message
3) strcmp isn't a wise choice for this, I suggest usage of strfind instead.
Here's the working code:
pawn Код:
public OnPlayerText(playerid, text[]) {
if(strfind(text, "fuck admin", true) != -1) {
Ban(playerid);
}
return 1;
}