23.01.2010, 09:00
As suggested there are many ways.
I wouldn't however recommend onplayerupdate, it is called A LOT, as in 20+ times per second per player (unless you want it to kill them the exact ms they reach -70, thats a strain on your server for something so small)
If you just want to kill anyone who goes below it, then use a timer, its much easier on your server, same code as llamas.
I wouldn't however recommend onplayerupdate, it is called A LOT, as in 20+ times per second per player (unless you want it to kill them the exact ms they reach -70, thats a strain on your server for something so small)
If you just want to kill anyone who goes below it, then use a timer, its much easier on your server, same code as llamas.
pawn Code:
public OnGameModeInit()
{
SetTimer("TimerDepthCheck", 1000, 1); //depending how worried you are on how suddenly it kills them you can change it 1000 = 1s
}
forward TimerDepthCheck();
public TimerDepthCheck()
{
for(new playerid=0; playerid<GetMaxPlayers(); playerid++)
{
if(!IsPlayerConnected(playerid)) continue;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(z < 70)
{
SetPlayerHealth(playerid, 0);
}
return 1;
}
}