How to disable a specific command
#1

SO how can i do it? lets say i want to dis able this command "/slap" making no admins use it, without going and removing the command from the script.
Reply
#2

With a variable?
pawn Код:
new bool:gSlapDisabled = false;

CMD:disableslap(playerid, params[])
{
    gSlapDisabled = true;
    return 1;
}

CMD:slap(playerid, params[])
{
    if(gSlapDisabled)
    {
        return 0;
    }
    return 1;
}
Reply
#3

Ok so can u make it for this command to be able to disable it

else if(strcmp(cmdtext, "/rcweaps", true) == 0)
{
GivePlayerWeapon(playerid, 24, 999);
GivePlayerWeapon(playerid, 27, 999);
GivePlayerWeapon(playerid, 31, 999);
PlayerPlaySound(playerid,1054,0,0,0);
return 1;
}
Reply
#4

new bool:tog_rcweaps;

else if(strcmp(cmdtext, "/rcweaps", true) == 0)
{
if(tog_rcweaps == true)
{
GivePlayerWeapon(playerid, 24, 999);
GivePlayerWeapon(playerid, 27, 999);
GivePlayerWeapon(playerid, 31, 999);
PlayerPlaySound(playerid,1054,0,0,0);
}
return 1;
}


else if(strcmp(cmdtext, "/tog_rcweaps", true) == 0)
{
if(tog_rcweaps == true) tog_rcweaps = false;
else tog_rcweaps = true;
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)