15.10.2010, 14:18
Creating Deathzones with the Z Float:
On top of your script:
Functions:
Example:
Note: succesfully tested.
On top of your script:
pawn Код:
#define MAX_DEAD_ARENAS 5
new ArenaEnabled[MAX_DEAD_ARENAS];
pawn Код:
SwitchDeathCheck(daid, amount) //amount: 0 = disabled, 1 = enabled
{
ArenaEnabled[daid] = amount;
if(amount > 2)
{
printf("[VDA]Deatharena id: %d has an outstanding parameter (%d), please fix this...", daid, amount);
SendRconCommand("exit"); //Closes the server safely
}
}
SetDeathCheck(daid, playerid, Float: z)
{
new Float: x, Float: y, Float: pz;
if(ArenaEnabled[daid] == 1)
{
GetPlayerPos(playerid, x, y, pz);
if(pz < z-0.1) //Check player if is under our general float z.
{
SetPlayerHealth(playerid, 0.0); //Killing the player who is lower then the general float z.
}
}
}
pawn Код:
public OnFilterScriptInit()
{
print("\n- Create-A-Death-Arena script by Vandooz");
SwitchDeathCheck(0, 1); //Death Arena nr.1 is now enabled
return 1;
}
public OnPlayerUpdate(playerid) //Doesnt have to be onplayerupdate, just call in a 1 sec timer
{
SetDeathCheck(0, playerid, 1000.0); //DONT DO GETPLAYERPOS, because its a general float for checks only.
return 1;
}

