#1

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
Reply
#2

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;
}
Reply
#3

Use streamer, create an area and when they leave it, do your magic and mark them as out of the game.
Reply
#4

Quote:
Originally Posted by Battlezone
Посмотреть сообщение
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;
}
Can i do it without timer and making it under OnPlayerUpdate()?
Reply
#5

Quote:
Originally Posted by Fancy
Посмотреть сообщение
Can i do it without timer and making it under OnPlayerUpdate()?
Use areas...
Reply
#6

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Use streamer, create an area and when they leave it, do your magic and mark them as out of the game.
How can i do it?
give me an example please
Reply
#7

Quote:
Originally Posted by Fancy
Посмотреть сообщение
How can i do it?
give me an example please
There is no need for any examples.

pawn Код:
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);
You have everything you need here: https://sampforum.blast.hk/showthread.php?tid=102865
Reply
#8

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
There is no need for any examples.

pawn Код:
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);
You have everything you need here: https://sampforum.blast.hk/showthread.php?tid=102865
But how can i get the cordinates of dynamic area?
And i dont know how to use it
Reply
#9

Quote:
Originally Posted by Fancy
Посмотреть сообщение
But how can i get the cordinates of dynamic area?
And i dont know how to use it
With /save and airbreak or something similar.
Reply
#10

Quote:
Originally Posted by Fancy
Посмотреть сообщение
Can i do it without timer and making it under OnPlayerUpdate()?
Yes of course, you can
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)