Disabling Commands In DM
#1

Greetings,
Help. Ive disabled all the commands i want disabled for when player in DM. Etc. But how do i disable my Vehicle spawner FS? Im confused. So players can't spawn cars while in a DM Arena.
Reply
#2

Just put this in your cmd at first of all codes
pawn Код:
if(InDM[playerid] == 1)  // <---- I use this but you use your own Symbol :P
   return 0;
Reply
#3

Show us your script where it's can't spawn cars

To disabled it's very easy

pawn Код:
new InDM[MAX_PLAYERS]; // we declare the params

public OnPlayerConnect(playerid)
{
    InDM[playerid] = 0; // This will reset the params
    return 1;
}

CMD:veh(playerid, params[])
{
    if(InDM[playerid] == 0) return SendClientMessage(playerid, -1, "You are not allowned to use this command right now");
    return 1;
}
Reply
#4

If the spawn vehicle commands are in a filter script, you'll probably have to use PVars.

When a player joins the DM arena, SetPVarInt(playerid, "InDMArena", 1);
Then edit the filterscript spawn vehicle command, and make it
pawn Код:
if(GetPVarInt(playerid, "InDMArena") == 1) return SendClientMessage(playerid, -1, "You can't spawn a vehicle in the DM arena!");
Then SetPVarInt(playerid, "InDMArena", 0); when they leave the DM arena.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)