make no CMD`s in DM
#1

Hi, i have my deathmatch area that works fine but i dont know how to make it so you cant do commands in there.
Please can someone tell me how to do this
Thanks
Cameron
Reply
#2

this in the top of your script:

new in_dm[MAX_PLAYERS];
this in OnPlayerCommandText

if(strcmp(cmdtext,"/dm",true));
{
dm[playerid]=1;
}

put this where you wanna block command:

if(in_dm[playerid]==1)return SendClientMessage(playerid,0xFF0000FF,"You Cant Use Commands In Dm Area!!");

Reply
#3

or put a check at top of onplayercommandtext..
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
  if(iamatdm == 0)
  {
  // commands
  }
  else
  {
    SendClientMessage(playerid,0xFF0000FF,"You Cant Use Commands In Dm Area!!");
  }
  return 0;
}
Reply
#4

Thanks For reply!
Reply
#5

Your welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)