need help to make a file script(ban after typing somthing) -
BloodyDexter - 13.05.2016
hi to all guys
have a problem in my gamemode(rpg)(b-zone debugged gamemod) playeres use a .cs file and samp funcs then use a command /xkillall then all the playeres will be die (first they go up then they will kill in ground) I have no idea about cleo only thing that I was thinking to do is make a script to ban playeres after typing somthing or some cmds anyone can help me pls?
Re: need help to make a file script(ban after typing somthing) -
Sjn - 13.05.2016
Well, firstly, it's not that easy detecting what kind of cleo mods players are using, but there are some includes or plugins exist that blocks most of the illegal cleo mods from players. You can search on ****** for it.
Secondly, don't you have admins in your server? Administrator team in every samp server exist for a reason. They should check for hackers like those and ban them manually.
PS: I am probably saying this for the 4th time, this section isn't for requesting something like this. It's for "scripting help".
Re: need help to make a file script(ban after typing somthing) -
Dayrion - 13.05.2016
Check this :
PHP код:
public OnPlayerText(playerid, text[]) // When a player type something
{
if(strcmp(text, "/xkillall", true) != -1) // If the text typed is "/xkillall"
{
SendClientMessageToAll(-1, "Someone get banned");
Ban(playerid); // Ban the player
return 0; // Don't send the typed message
}
return 1; // End the function
}
I hope this helped you.
NB : Thanks F1N4L.
Re: need help to make a file script(ban after typing somthing) -
BloodyRP - 13.05.2016
Quote:
Originally Posted by Dayrion
Check this :
PHP код:
public OnPlayerText(playerid, text[]) // When a player type something
{
if(!strcmp(text[0], "/xkillall")) // If the text typed is "/xkillall"
{
SendClientMessageToAll(-1, "Someone get banned");
Ban(playerid); // Ban the player
return 0; // Don't send the typed message
}
return 1; // End the function
}
I hope this helped you.
|
text[0] - is only first char. so u need to check "(text,".
And dunno, is OnPlayerText calling when player enter a command with cleo.
Re: need help to make a file script(ban after typing somthing) -
Dayrion - 13.05.2016
Quote:
Originally Posted by BloodyRP
text[0] - is only first char. so u need to check "(text,".
And dunno, is OnPlayerText calling when player enter a command with cleo.
|
No.
text = "Hey"
text[0] : "Hey"
text[1] : "ey"
-------------------
I don't know too but if the player type something and press enter, I think OnPlayerText is called. It's need to be tested.
Re: need help to make a file script(ban after typing somthing) -
F1N4L - 13.05.2016
or...
Код:
public OnPlayerText(playerid, text[])
{
if(strcmp(text, "/xkillall", true) != -1)
return SendClientMessageToAll(-1, "Someone get banned"),
Ban(playerid);
return 1;
}
Re: need help to make a file script(ban after typing somthing) -
Dayrion - 13.05.2016
Quote:
Originally Posted by F1N4L
or...
Код:
public OnPlayerText(playerid, text[])
{
if(strcmp(text, "/xkillall", true) != -1)
return SendClientMessageToAll(-1, "Someone get banned"),
Ban(playerid);
return 1;
}
|
Yes, it's better. I edited my post with your code.
Re: need help to make a file script(ban after typing somthing) -
BloodyDexter - 13.05.2016
so thank you guys. but after adding this to my pawn I will get this errors
C:\Users\user\Desktop\relog.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerText")
C:\Users\user\Desktop\relog.pwn(3) : error 017: undefined symbol "strcmp"
C:\Users\user\Desktop\relog.pwn(4) : error 017: undefined symbol "SendClientMessageToAll"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
after deleting public I have undifined errors too
Re: need help to make a file script(ban after typing somthing) -
J0sh... - 13.05.2016
Quote:
Originally Posted by Dayrion
No.
text = "Hey"
text[0] : "Hey"
text[1] : "ey"
-------------------
I don't know too but if the player type something and press enter, I think OnPlayerText is called. It's need to be tested.
|
What? Why would [0] be the whole word? But 1 be only ey? That's wrong.
text[0] : H
text[1] : e
text[2] : y
OT: You cannot detect cleo cmds because they register their commands as client side so it doesn't get sent to the server.
Re: need help to make a file script(ban after typing somthing) -
Dayrion - 13.05.2016
Quote:
Originally Posted by Jamester
What? Why would [0] be the whole word? But 1 be only ey? That's wrong.
text[0] : H
text[1] : e
text[2] : y
OT: You cannot detect cleo cmds because they register their commands as client side so it doesn't get sent to the server.
|
Try it. Pawn when you type text[1] it's the whole string starting at the character 1.