#1

How to make when player goes to deathmach he cant type any other command but when leaves deathmatch he can ?
Reply
#2

When the player starts enters the Death matching arena;
SetPlayerPVInt(playerid, #DM_Arena, 1);

Inside of your commands do:
if(GetPVarInt(playerid, #DM_Arena) == 1) return SendClientMessage, -1, # >> Commands are unavailable at this time.);

Leave this out of the DM arena exit command though. Then once he exits, Delete the PVar.
Otherwise he'll never be able to exit.
Reply
#3

how it can loo like a command
Reply
#4

Example command.

pawn Код:
CMD:kill(playerid, params[]) {
    new Float:hp;
    GetPlayerHealth(playerid, hp);
    if(GetPVarInt(playerid, #DM_Arena) == 1) return SCM(playerid, -1, # >> Commands are unusable at this time.);
    if(hp >= 50)
    {
        DeletePVar(playerid, #HackOn);
        SetPlayerHealthEx(playerid, 0);
    }
    else return SCM(playerid, C_WHITE, #ERROR: You can not kill yourself with 50 health or less.);
    return true;
}
Reply
#5

Код:
if(hp >= 50)
	{
	    DeletePVar(playerid, #HackOn);
	    SetPlayerHealthEx(playerid, 0);
	}
That means player can exit DM when he have 50+ hp?
Reply
#6

??
Reply
#7

No...
if(GetPVarInt(playerid, #DM_Arena) == 1) return SCM(playerid, -1, # >> Commands are unusable at this time.);
That's what prevents him from being able to use the command.

That other part means he can't kill himself if he has lower than 50HP.
Ignore everything else, that's part of my script. It was intended as a Example.
Reply
#8

so this if(GetPVarInt(playerid, #DM_Arena) == 1) return SCM(playerid, -1, # >> Commands are unusable at this time.);
should i add to DM join command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)