Disabling commands?
#1

Hello there!
I'm trying to create a command that disables temporarily other commands.
For example I'd like to have /teles deactivated when I type /telesoff and to activate it again when I type /teleson.
I'm using LuxAdmin and I was wondering if I can make it available only for admins.. Or if a command like that exists already!
Thank you!
Reply
#2

You should use variable for it.

Add this variable top of the script

pawn Код:
teleDisabled = 0; // Creating variable with a value of 0
This below OnPlayerCommandText()

pawn Код:
if (strcmp("/telesoff", cmdtext, true, 10) == 0)
{
    teleDisabled = 1; // commands are disabled 1 = disabled
    SendClientMessageToAll(0xFF0000FF, "Teleports is now disabled."); // a message for all
    return 1;
}
if (strcmp("/teleson", cmdtext, true, 10) == 0)
{
    teleDisabled = 0; // Commands are actived 0 = activated
    SendClientMessageToAll(0xFF0000FF, "Teleports is now activated."); // a message for all
    return 1;
}
Now you should add this line top of your command example you have cmd /sfa for teleport to San Fierro Airpot

pawn Код:
if (strcmp("/sfa", cmdtext, true, 10) == 0)
{
    if(teleDisabled == 1) return SendClientMessage(playerid, 0xFF0000FF, "This command is disabled."); // command is disabled, we send a text to player who he uses this command
    // This is your script
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, blabla);
    return 1;
}
Reply
#3

It doesn't work unfortunately, it says "Unknows commmand" in game.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];

    if (strcmp(cmd, "/telesoff", true) == 0) {
        teleDisabled = 1; // commands are disabled 1 = disabled
        SendClientMessageToAll(0xFF0000FF, "Teleports are now disabled."); // a message for all
        return 1;
    }

    if (strcmp(cmd, "/teleson", true) == 0) {
        teleDisabled = 0; // Commands are actived 0 = activated
        SendClientMessageToAll(0xFF0000FF, "Teleports are now activated."); // a message for all
        return 1;
    }
    return 0;
}
I have this in a filterscript, cannot find the error though. I've also tried it like that but the result was the same:
pawn Код:
if (strcmp("/telesoff", cmdtext, true, 10) == 0)
{
    teleDisabled = 1; // commands are disabled 1 = disabled
    SendClientMessageToAll(0xFF0000FF, "Teleports is now disabled."); // a message for all
    return 1;
}
if (strcmp("/teleson", cmdtext, true, 10) == 0)
{
    teleDisabled = 0; // Commands are actived 0 = activated
    SendClientMessageToAll(0xFF0000FF, "Teleports is now activated."); // a message for all
    return 1;
}
My whole FS is this
pawn Код:
//>> [Tutorial]:How to make a "Teleport in Dialog" - ZCMD
//>> Credit to , Zeex -ZCMD , SA-MP Dev Team - a_samp

//>> include's
#include a_samp
#include zcmd
#define FILTERSCRIPT
//>> color's define
#define COLOR_GRAY 0xCECECEFF
#define COLOR_BRIGHTRED 0xFF0000AA

#if defined FILTERSCRIPT

new teleDisabled = 0; // To disable /tele

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Teleport System by giuliocame");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif



//---------------------------------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];

    if (strcmp(cmd, "/telesoff", true) == 0) {
        teleDisabled = 1; // commands are disabled 1 = disabled
        SendClientMessageToAll(0xFF0000FF, "Teleports are now disabled."); // a message for all
        return 1;
    }

    if (strcmp(cmd, "/teleson", true) == 0) {
        teleDisabled = 0; // Commands are actived 0 = activated
        SendClientMessageToAll(0xFF0000FF, "Teleports are now activated."); // a message for all
        return 1;
    }
    return 0;
}
       
//------------------------------< ZEEXCOMMANDS >------------------------------//
CMD:tele(playerid, params[])
{
    if(teleDisabled == 1) return SendClientMessage(playerid, 0xFF0000FF, "This command is disabled."); // command is disabled, we send a text to player who he uses this command
    ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_LIST, "Teleport System in Dialog", "San Fierro\nLos Santos\nLas Venturas\nLos Santos Airport\nLas Venturas Airport\nSan Fierro Airport\nChilliad\nOld Airport\nSan Fierro Stunts\nArea 51\nThe Club\nWaterpark\nNrg Basket\nHay Area\nRoof Area\nNrg Skills\nNrg Skills 2", "Teleport", "Close"); // Dialogid 1997 ? you can change it or maybe define it . .
  //ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]);
    return 1;
}
//----------------------------------------------------------------------------//
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1997) // Check the Dialogid
    {
        if(response)
        {
            switch(listitem) //the list of the item you have in the Dialog ..
            {
                case 0: // case 0; is for San Fierro teleport . .
                {
                    new vehicleid = GetPlayerVehicleID(playerid); // check the vehicleID
                    new State = GetPlayerState(playerid); // Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) // this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0); //Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0); //this will set the playerinterior
                    SetVehicleZAngle(vehicleid,227.2756); //this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid); //this will set the camera behind you
                    SetVehiclePos(vehicleid,-1986.5483,305.5474,35.0071); //this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to San Fierro!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,-1969.0593,294.0901,35.1719);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,89.9102); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to San Fierro!"); //this will send u a Message when u was Teleported!. .
                }
                case 1: // case 1; is for Los Santos teleport . .
                {
                    new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
                    new State = GetPlayerState(playerid);// Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) // this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetVehicleZAngle(vehicleid,179.2136);//this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SetVehiclePos(vehicleid,1608.3900,-1719.7670,13.3786); //this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Los Santos!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,1606.3514,-1739.5194,13.5469);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,42.2198); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Los Santos!");//this will send u a Message when u was Teleported!. .
                }
                case 2: //lv teleport
                {
                    new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
                    new State = GetPlayerState(playerid);// Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SetVehiclePos(vehicleid,2128.2754,1333.6340,10.6558);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Las Venturas!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,2096.9543,1322.6205,10.8203);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Las Venturas!");//this will send u a Message when u was Teleported!. .
                }
                case 3: //ls air
                {
                    new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
                    new State = GetPlayerState(playerid);// Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SetVehiclePos(vehicleid,1713.8,-2499.3,13.5);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Los Santos Airport!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,1713.8,-2499.3,13.5);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Los Santos Airport!");//this will send u a Message when u was Teleported!. .
                }
                case 4: //lv air
                {
                    new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
                    new State = GetPlayerState(playerid);// Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SetVehiclePos(vehicleid,1439,1468,10.82);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Las Venturas Airport!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,1439,1468,10.82);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Las Venturas Airport!");//this will send u a Message when u was Teleported!. .
                }
                case 5: //sf air
                {
                    new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
                    new State = GetPlayerState(playerid);// Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SetVehiclePos(vehicleid,-1610,-232,14.15);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to San Fierro Airport!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,-1610,-232,14.15);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to San Fierro Airport!");//this will send u a Message when u was Teleported!. .
                }
                case 6: //chilliad
                {
                    new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
                    new State = GetPlayerState(playerid);// Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SetVehiclePos(vehicleid,-2330.0,-1628.0,483.7);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Chilliad!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,-2330.0,-1628.0,483.7);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Chilliad!");//this will send u a Message when u was Teleported!. .
                }
                case 7: //old air
                {
                    new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
                    new State = GetPlayerState(playerid);// Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SetVehiclePos(vehicleid,401,2498,16.48);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Old Airport!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,401,2498,16.48);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Old Airport!");//this will send u a Message when u was Teleported!. .
                }
                case 8: //sf stunts
                {
                    new vehicleid = GetPlayerVehicleID(playerid);// check the vehicleID
                    new State = GetPlayerState(playerid);// Get the playerState
                    if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)// this will teleport you & your car if you are the driver...
                    //if you are not the driver or you maybe a passenger u will just teleport without car ..
                    {
                    LinkVehicleToInterior(vehicleid,0);//Linkvehicle to interior,this is like SetPlayerInterior . .
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetVehicleZAngle(vehicleid,88.7952);//this is the angle of your vehicle
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SetVehiclePos(vehicleid,-2461.9,1490.5,7.2);//this is the vehicle Pos , Float:X , Float:Y , Float:Z
                    return SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to San Fierro Stunts!");//this will send u a Message when u was Teleported!. .
                    }
                    SetPlayerPos(playerid,-2461.9,1490.5,7.2);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to San Fierro Stunts!");//this will send u a Message when u was Teleported!. .
                }
                case 9: //area 51
                {
                    SetPlayerPos(playerid,212,1908,17.64);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Area 51!");//this will send u a Message when u was Teleported!. .
                }
                case 10: //club
                {
                    SetPlayerPos(playerid,1070.6584,1336.6307,10.8428);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to The Club!"); //this will send u a Message when u was Teleported!. .
                }
                case 11: //waterpark
                {
                    SetPlayerPos(playerid,-2093.0,-2820.3,3.0);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Waterpark!");//this will send u a Message when u was Teleported!. .
                }
                case 12: //nrg basket
                {
                    SetPlayerPos(playerid,1388.5,-1189.0,202.4);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to NRG Basket!");//this will send u a Message when u was Teleported!. .
                }
                case 13: //hay area
                {
                    SetPlayerPos(playerid,1450.214966, -1055.654663, 213.38);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Hay Area!");//this will send u a Message when u was Teleported!. .
                }
                case 14: //roof area
                {
                    SetPlayerPos(playerid,1691.64, -1391.87, 88.17);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Roof Area!");//this will send u a Message when u was Teleported!. .
                }
                case 15: //nrg skills
                {
                    SetPlayerPos(playerid,-1537.8,318.1,53.4);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Bike Skills!");//this will send u a Message when u was Teleported!. .
                }
                case 16: //nrg skills 2
                {
                    SetPlayerPos(playerid,837.1,-2035.8,12.8);//this is the Player Pos , Float:X , Float:Y , Float:Z
                    SetPlayerFacingAngle(playerid,52.1985); //this is the angle of your player
                    SetPlayerInterior(playerid,0);//this will set the playerinterior
                    SetCameraBehindPlayer(playerid);//this will set the camera behind you
                    SendClientMessage(playerid, COLOR_BRIGHTRED, "Teleported to Bike Skills 2!");//this will send u a Message when u was Teleported!. .
                }
            }
        }
    }
    return 1;
}
Reply
#4

if u add ZCMD commands while strcmp commands are there
strcmp command will NOT work..convert em all to Zcmd
Reply
#5

Delete this callback:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];

    if (strcmp(cmd, "/telesoff", true) == 0) {
        teleDisabled = 1; // commands are disabled 1 = disabled
        SendClientMessageToAll(0xFF0000FF, "Teleports are now disabled."); // a message for all
        return 1;
    }

    if (strcmp(cmd, "/teleson", true) == 0) {
        teleDisabled = 0; // Commands are actived 0 = activated
        SendClientMessageToAll(0xFF0000FF, "Teleports are now activated."); // a message for all
        return 1;
    }
    return 0;
}
Add these commands above the others
pawn Код:
CMD:telesoff( playerid, params[ ] )
{
    teleDisabled = 1; // commands are disabled 1 = disabled
    SendClientMessageToAll(0xFF0000FF, "Teleports are now disabled."); // a message for all
    return 1;
}

CMD:teleson( playerid, params[ ] )
{
    teleDisabled = 0; // Commands are actived 0 = activated
    SendClientMessageToAll(0xFF0000FF, "Teleports are now activated."); // a message for all
    return 1;
}
Last, replace these
pawn Код:
#include a_samp
#include zcmd
#define FILTERSCRIPT
//>> color's define
#define COLOR_GRAY 0xCECECEFF
#define COLOR_BRIGHTRED 0xFF0000AA

#if defined FILTERSCRIPT

new teleDisabled = 0; // To disable /tele

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Teleport System by giuliocame");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif
With
pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

//>> color's define
#define COLOR_GRAY 0xCECECEFF
#define COLOR_BRIGHTRED 0xFF0000AA

new teleDisabled = 0; // To disable /tele

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Teleport System by giuliocame");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
Reply
#6

So in one filterscript I cannot use two different cmd systems?

Thanks for the code!
Reply
#7

you can use 2..
for example u can use strcmp and dcmd both...
but YCMD and ZCMD call every time a command is executed and strcmp is forgotten..it cant be used..
Reply
#8

So I can use some of them together but It's not possible for others to work together! Am I right?
Reply
#9

Quote:
Originally Posted by Polonio9
Посмотреть сообщение
So I can use some of them together but It's not possible for others to work together! Am I right?
Correct, but it's better to stick to 1 command system.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)