DM problem
#1

Hi i want to make a script part

i want to make a dm system and i dont know something

i'm using zcmd and i dont know how to disable all comands in dm except /exitdm

my code is this

Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(inDM[playerid] == 1)
    {
      SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot use commands while in Jail!");
      return 0;
    }
       return 1;
}
Reply
#2

Put this at the beginning of every command you want to disable:

pawn Код:
if(InDM[playerid] == 1)
   return 0;
Tell me if it works.
Reply
#3

pawn Код:
CMD:command(blabla...
{
if(inDM[playerid] == 1) return SendClientMessage(playerid, -1, "you cannot do that here");
// command stuff

return 1;
}
Works?
Reply
#4

but i have hundreds of commands in gm.

Is there an easier way?

EDIT:nevermind
Reply
#5

Well, I don't think it's much of a effort to copy and paste, see if it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)