Some Onplayertext help
#1

Here is the deal I want people in my server to be kicked each time they say "rcon" I have something for that but it doesnt kick people for usuing the /rcon command



Here is my code:

Quote:

public OnPlayerText(playerid, text[])
{
new pText[144];
format(pText, sizeof (pText), "(%d) %s", playerid, text);
SendPlayerMessageToAll(playerid, pText);
if(strfind(text,"rcon", true) != -1)
{
Kick(playerid);
}

return 0; // ignore the default text and send the custom one
}

Thanks to those who will help in advance.
Reply
#2

pawn Код:
CMD:rcon(playerid, params[]) {
    Kick(playerid);
    return 1;
}
But uhm.. You do know that this will disable /rcon ENTIRELY, right?
No more /rcon login, /rcon gmx, /rcon reloadfs ....
Reply
#3

That's great, i'll try that. I tried first with OnPlayerCommandText, but it didnt work.



Could you do me a favour and Explain abit about "strfind" I didnt quite understand the Wiki.



Thanks again
Reply
#4

Quote:

CMD:rcon(playerid, params[])
{

new a[128], b[128];
format(a, sizeof(a), "Player %s was banned due to the use of Rcon", GetName(playerid));
format(b, sizeof(b), "Player %s used /rcon command", GetName(playerid));
SendAdminMessage(GREY,b);
SendClientMessageToAll(RED, a);
Ban(playerid);
return 1;
}

This doesn't work. it just till recongnizes rcon as rcon
Reply
#5

Try this:
https://sampwiki.blast.hk/wiki/OnRconLoginAttempt
And this:
https://sampwiki.blast.hk/wiki/OnRconCommand
Reply
#6

Doesn't help I need someone to get a Kick the moment he types /rcon in chat. I have a autoban for those who use rcon login and so.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)