detect if a player fall
#4

A while ago i made a minigame with something similar, this i used:
PHP код:
public OnGameModeInit()
{
SetTimer("dm_activate"1000true);
return 
1;
}
forward dm_activate();
public 
dm_activate()
{
for (new 
0MAX_PLAYERSi++)
{
new 
Float:pPos[3];
GetPlayerPos(ipPos[0], pPos[1], pPos[2]);
if(
IsPlayerConnected(i))
{
if (
pPos[2] < 25.0)
{
if(
Player_minigame[i] == 1)//detects if the player is inside the minigame/place, if you want to remove it.
{
TogglePlayerSpectating(playerid1);
GameTextForPlayer(playerid"You lost"20005);
SetTimerEx("check_exit",1000,0,"d",playerid);
return 
1;
}
}
}
}
return 
1;
}
forward check_exit(playerid);
public 
check_exit(playerid)
{
TogglePlayerSpectating(playerid,0);
return 
1;

I do not know if it works for you.
Reply


Messages In This Thread
detect if a player fall - by PundacheMakalae - 02.02.2018, 20:53
Re: detect if a player fall - by Mugala - 02.02.2018, 21:04
Re: detect if a player fall - by PepsiCola23 - 02.02.2018, 22:00
Re: detect if a player fall - by dani18 - 02.02.2018, 22:38
Re: detect if a player fall - by RogueDrifter - 02.02.2018, 23:17

Forum Jump:


Users browsing this thread: 1 Guest(s)