SA-MP Forums Archive
block special command - 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: block special command (/showthread.php?tid=583632)



block special command - sirvanec - 29.07.2015

hi guys,

i have problem with bot attack. it have special command like !kill or something like this.. i added this under onplayertext:

Quote:

public OnPlayerText(playerid, text[])
{
if(strfind(text, "!kill", true) != -1)
{
Ban(playerid);
return false;
}

but they can write it with bot program and it's not ban them.. so how can i do that it ban them and command be return 0


Re: block special command - sirvanec - 30.07.2015

JuanStone, that will ban player but did that return 0 i mean player has been banned but command must be returned 0.. can i make it like this?

Quote:

if (!strcmp(text, "!kill", true)){
BanEx(playerid, "crasher");
return false;
}




Re: block special command - Abagail - 30.07.2015

Yes. Note returning 0 simply stops the text from being by default send, if you're using a custom talking script(most gamemodes + especially roleplay ones do), you will need to take a look and configure it to work with your script specifically.


Re: block special command - sirvanec - 30.07.2015

It's not working..


Re: block special command - sirvanec - 30.07.2015

anyone else?