SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help (/showthread.php?tid=580608)



help - RuNBoY - 06.07.2015

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


Re: help - Lynn - 06.07.2015

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.


Re: help - RuNBoY - 06.07.2015

how it can loo like a command


Re: help - Lynn - 06.07.2015

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;
}



Re: help - RuNBoY - 06.07.2015

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


Re: help - RuNBoY - 06.07.2015

??


Re: help - Lynn - 06.07.2015

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.


Re: help - RuNBoY - 06.07.2015

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