Disable a Command [URGENT HELP NEEDED] +rep
#1

Okay so i have to disable a command, my script-er has gone out for few days and i need to disable a command which is bugged and everything gets fucked if someone uses it. Is there a way to block some commands, i dont have the pwn at the time -_- so any filter-script or something which can help me please!

Note* There are few commands.
Reply
#2

You'll need access to the gamemode .pwn file and edit the command but as you said you don't have access to it. The only other thing I can think of is if you create a filterscript so when a player enters the server it sends them a message that tells them not to use the command otherwise they'll be punished severely.

You could maybe also make a filterscipt with the command the exact same as the cmd in the gamemode that bugs your server but make it a kick command so if they use type the bugged command, it kicks them from the server.

Not sure if this will help, but it's probably my best advice mate. Good luck
Reply
#3

Example:

Change
pawn Код:
CMD:command(playerid, params[])
{
    return 1;
}
To:
pawn Код:
/*CMD:command(playerid, params[])
{
    return 1;
}*/
Anything between /* */ will get commented out and won't actually function.
Reply
#4

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Example:

Change
pawn Код:
CMD:command(playerid, params[])
{
    return 1;
}
To:
pawn Код:
/*CMD:command(playerid, params[])
{
    return 1;
}*/
Anything between /* */ will get commented out and won't actually function.
He doesn't have the .pwn file tho
Reply
#5

Not possible without the .pwn file. You can however, make a filterscript to send a message to the player when they connect telling them not to use it.

pawn Код:
#include <a_samp>

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, 0xFF0000FF, "The command '/mycommand' is currently bugged.  Please do not use this command, it will cause issues.");
    return 1;
}
Open pawno.exe, click new, erase everything and paste that in, save it as command.pwn, and click the blue play button to compile it. Drag the .AMX file into filterscripts, and in game type /rcon loadfs command.
Reply
#6

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
Not possible without the .pwn file. You can however, make a filterscript to send a message to the player when they connect telling them not to use it.

pawn Код:
#include <a_samp>

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, 0xFF0000FF, "The command '/mycommand' is currently bugged.  Please do not use this command, it will cause issues.");
    return 1;
}
Open pawno.exe, click new, erase everything and paste that in, save it as command.pwn, and click the blue play button to compile it. Drag the .AMX file into filterscripts, and in game type /rcon loadfs command.
Thanks also all know if we say "Do not do "/blabla" they will do it and cause damage to the server if there would be a way to stop it like the "Sorry this command has been disabled" thing please help me!
Reply
#7

You have to access your gamemode, and only after that you can make this happen.
Reply
#8

Well the best idea was already given by Josh.. just add exact same command to ur other fs with kicing player instead so whosoever uses the cmd will get kicked
Reply
#9

Not sure if it will work, but give it a try.
Make a new filterscript and add this:
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/yourcommandhere", true))
    {
        SendClientMessage(playerid, 0xFF0000FF, "This command cannot be used.");
        return 0;
    }
    return 1;
}
Replace /yourcommandhere with the command you want to disable.
Reply
#10

You could create the same command, do this:
And return something else. (e.g - use return)

pawn Код:
CMD:mycommand(playerid, params[])
{
    return SendClientMessage(playerid, 0xFF0000FF, "This command has been disabled.");
}
This should and will (most likely - haven't tested it) work.
Don't forget to create a filterscript for it and include it in server.cfg.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)