a lil help her
#5

Well, easily create a per-player global variable, set it to 1 when a player in a dm and to 0 if not in dm. Then you can check if it's set to 1 and if true do not execute your cmd. Example:

pawn Код:
// top of script
new Dming[MAX_PLAYERS]; // here's the per-player global variable
// if the value of this variable is 0 then the player isn't in a dm
// else he is in a dm
// ---------------------------------------------------------------
// In your dm command set that variable to 1 (To tell the script that this player is in a dm)
// by putting the following code inside the cmd
Dming[playerid] = 1;
// ---------------------------------------------------------------
// Now you can check as I said above if it's 1
// Example:
if(Dming[playerid] == 1) // checking if it's equal to 1 (In a deathmatch)
{
    SendClientMessage(playerid, -1, "You cannot do that while in a dm!");
    return 1;
}
// ---------------------------------------------------------------
// And to reset it when a player leaves a dm
// The following code should be added in a .. /leavedm command
Dming[playerid] = 0; // 0 = not in a dm
Reply


Messages In This Thread
a lil help her - by I3ullet - 31.07.2012, 21:30
Re: a lil help her - by MaDK1LLA - 31.07.2012, 21:33
Re: a lil help her - by Revo - 31.07.2012, 21:36
Re: a lil help her - by I3ullet - 31.07.2012, 21:40
Re: a lil help her - by [KHK]Khalid - 31.07.2012, 22:05
Re: a lil help her - by Devilxz97 - 31.07.2012, 22:33
Re: a lil help her - by I3ullet - 31.07.2012, 23:16
Re: a lil help her - by I3ullet - 31.07.2012, 23:36
Re: a lil help her - by Devilxz97 - 31.07.2012, 23:48
Re: a lil help her - by CrazyChoco - 31.07.2012, 23:59

Forum Jump:


Users browsing this thread: 1 Guest(s)