SA-MP Forums Archive
Disabling Commands In DM - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Disabling Commands In DM (/showthread.php?tid=395383)



Disabling Commands In DM - Threshold - 26.11.2012

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.


Re: Disabling Commands In DM - dr.lozer - 26.11.2012

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;



Re: Disabling Commands In DM - RenSoprano - 26.11.2012

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;
}



Re: Disabling Commands In DM - cosbraa - 26.11.2012

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.