SA-MP Forums Archive
Some Onplayertext help - 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: Some Onplayertext help (/showthread.php?tid=532990)



Some Onplayertext help - ThatThoseTheThy - 21.08.2014

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.


Re: Some Onplayertext help - Kyance - 21.08.2014

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 ....


Re: Some Onplayertext help - ThatThoseTheThy - 21.08.2014

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


Re: Some Onplayertext help - ThatThoseTheThy - 21.08.2014

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


Re : Some Onplayertext help - XDamienX007 - 21.08.2014

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


Re: Some Onplayertext help - ThatThoseTheThy - 21.08.2014

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.