20.02.2014, 17:56
Hello, how can I block commands in dm zone?
new inDM[MAX_PLAYERS];
inDM[playerid] = 1;
CMD:hi(playerid, params[])
{
if(inDM[playerid] == 1) return SendClientMessage(playerid, -1, "You can't use this command while being in dm zone!");
GivePlayerMoney(playerid, 1000);
return 1;
}
new inDM[MAX_PLAYERS]; // On top of the script
CMD:joindm(playerid, params[])
{
// bla bla bla bla
inDM[playerid] = 1; // You will need to place this line inside the code of the "joindm" or "dmzone" whatever it is
// bla bla bla bla ------- To define that the player is inside the DM zone.
return 1;
}
CMD:hi(playerid, params[])
{
if(inDM[playerid] == 1) return SendClientMessage(playerid, -1, "You can't use this command while being in dm zone!");
// The above line is simple, if the player inside the DM zone, it will "return" (A.K.A stopping the command for him)
// Sending that message.
GivePlayerMoney(playerid, 1000);
return 1;
}