Player check
#1

Hello guys, I was making a SUMO cars war and I was wonderi g if its possible to check and respawn a player when he falls into the water and how can i do it?
Thanks!
Reply
#2

if(insumo[playerid]) {
new Float: pos[3];
GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
new Float:waterpos = your coordonate from /save
if(pos[2] <= waterpos) SpawnPlayer(playerid);
}
you need to create a timer
Reply
#3

Like rockys responded, you need to get the height (Y parameter) of the water, and make a timer that checks if you are not at or below that height, and if you are, respawn
Reply
#4

I made it by myself for seconds and I think it will work!
Here is it (on the top of your script):
PHP Code:
boolIsPlayerInWater(playerid)
{
    new 
FloatpPosition[3];
    
GetPlayerPos(playeridpPosition[0], pPosition[1], pPosition[2]);
    if(
IsPlayerInRangeOfPoint(playerid10000pPosition[0], pPosition[1], 1-10000))
    {
        return 
true;
    }
    return 
false;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)