07.08.2015, 18:03
I have a derby map and its located on the water,how to make it like when someone falls on water so the player loses
//your code //... // Start a 5 second timer to end the anti-spawnkill new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); SetTimerEx("CheckZ", 5000, false, "if", playerid, Z); //then after on player spawn forward CheckZ(playerid, zcoord); // The timer function - the code to be executed when the timer is called goes here public CheckZ(playerid, zcoord) { if(Z<10.00) //10.00 is surface Z for example { //lose functions and variables } return 1; }
You can make a timer with a 5s interval that will check the player z coordinate and compare it to the water Z surface coords, if the player Z < water surface Z he loses
Under on player spawn: Код:
//your code //... // Start a 5 second timer to end the anti-spawnkill new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); SetTimerEx("CheckZ", 5000, false, "if", playerid, Z); //then after on player spawn forward CheckZ(playerid, zcoord); // The timer function - the code to be executed when the timer is called goes here public CheckZ(playerid, zcoord) { if(Z<10.00) //10.00 is surface Z for example { //lose functions and variables } return 1; } |
native STREAMER_TAG_AREA CreateDynamicRectangle(Float:minx, Float:miny, Float:maxx, Float:maxy, worldid = -1, interiorid = -1, playerid = -1);
forward OnPlayerEnterDynamicArea(playerid, STREAMER_TAG_AREA areaid);
forward OnPlayerLeaveDynamicArea(playerid, STREAMER_TAG_AREA areaid);
There is no need for any examples.
pawn Код:
|