Setplayerhealth to 0
#1

I want the player that enters this building so when he tries to attack others his health will go down to 0 percent and he dies. "this is a non dm office thats why"

Код:
		else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2015.5587,1106.1138,10.8203)) // Office Near Italian Mafia
        {
            TextDrawShowForPlayer(playerid,officemessage);
            SetPlayerPos(playerid, 290.85040283203, -73.214797973633, 1006.8);
            SetPlayerInterior(playerid, 1);
        }
Reply
#2

Create a variable

pawn Код:
// ontop of script under includes
new bool:IsInOfficeBuilding[MAX_PLAYERS];

//  In the code you provided
IsInOfficeBuilding[playerid] = true;
// now use onplayergivedamage to check if he is in the building, if so he will die.
// also use IsInOfficeBuilding[playerid] = false; when he exits the building.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)