How to prevent this
#1

Hi,
In my gamemode i have weapon spawner, and now when i made dm, i m getting a problem. The problem is, when i go to dm, player can spawn another weapon. but how to prevent this. i want something like, when u do /dm, you are not allowed to use any command withour /leave . Any idea ? please reply
Reply
#2

REDIT:
Reply
#3

What ... i got no clue
Reply
#4

You'd need to add a variable such as:
pawn Код:
if(InDM[playerid] == 1) return SencDlientMessage(playerid,COLOR, "You can't use cmds in a death match.");
under every server command you have. To create the variable for a playerid, do this.
pawn Код:
new InDM[MAX_PLAYERS];
EDIT: If you have zcmd, I "think" you may be able to do this. Just add this callback.
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
       if(InDM[playerid] == 1) return SendClientMessage(playerid,COLOR, "You can't use commands while in a DM.");
       return 0;
}
Reply
#5

Or you can make it a global variable...
Reply
#6

Well of course. If I didn't make it clear enough, I apologize. But yes, a global variable - which means placing it outside of a callback, usually at the top of your mode.
Reply
#7

yo guys, thanks a lot , speacially rangerxxll
Reply
#8

Not a problem buddy.
Reply
#9

You always help me, thanks one more time
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)