Hmm Somethings wrong or what?
#1

Im trying to make like a little system to allow you to have 1 life per match so im asking 2 things How and Why.


Why dosent my code work??

Код:
public OnPlayerSpawn(playerid)
{
	if(PlayerDied[playerid] == true)
	{
		TogglePlayerSpectating(playerid, 1);// need to make some addons for this...
	}
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerDied[playerid] = true;
	return 1;
}
How do i detect if all players in one team died so it can exec a restart?
and
How do i make it automaticlly restart if theres 1 person on my server and they die?


Thats all i think :P

-Lorenc
Reply
#2

You could either make a variable like this

pawn Код:
new TeamBlue, TeamRed;

//When a player joins
TeamBlue ++; /* Or*/ TeamRed ++;

//When a player leaves
TeamBlue --; /* Or*/ TeamRed --;
The other way is to do a check that checks if there is anyone in a team using a for loop.
Reply
#3

Quote:
Originally Posted by [HiC
TheKiller ]
You could either make a variable like this

pawn Код:
new TeamBlue, TeamRed;

//When a player joins
TeamBlue ++; /* Or*/ TeamRed ++;

//When a player leaves
TeamBlue --; /* Or*/ TeamRed --;
The other way is to do a check that checks if there is anyone in a team using a for loop.
I get what you mean and thats very useful infact for the 1 life system but still i cant fix the problam damn..
Reply
#4

Why dnt u use, GetPlayerHealth and Select the Player's/Teams
Reply
#5

Quote:
Originally Posted by [LSR
State_Trooper ]
Why dnt u use, GetPlayerHealth and Select the Player's/Teams
For what.
Reply
#6

To see if the Team has a total health of 0 ( all players are dead). Then tell it if it is 0 to restart
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)