SA-MP Forums Archive
Falling with vehicle detect - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Falling with vehicle detect (/showthread.php?tid=582324)



DELETE please - gurmani11 - 19.07.2015

never needed this ... sorry


Re: Falling with vehicle detect - Glenn332 - 19.07.2015

PHP код:
new Float:Pos_x,Float:Pos_y,Float:Pos_z;
new 
vehicleid GetPlayerVehicleID(playerid); 
    
GetVehicleVelocity(vehicleid,Pos_x,Pos_y,Pos_z);
    if(
Pos_x <= -0.800000  || Pos_y <= -0.800000 || Pos_z <= -0.800000)
    {
    }
    return 
1
Try this, not sure if it will work but a try never hurts :P


AW: Falling with vehicle detect - Kaliber - 19.07.2015

You make a timer:

PHP код:
new checkFalling[MAX_PLAYERS char];
new 
Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetTimerEx("@checkFalling",999,0,"if",playerid,z); //The playerid you wanna check
@checkFalling(i,Float:oZ);@checkFalling(i,Float:oZ) {
    if(!
IsPlayerInAnyVehicle(i)) return checkFalling{i}=0;
    new 
Float:x,Float:y,Float:z;
    
GetPlayerPos(i,x,y,z);
    if(
>= oZ) return checkFalling{i}=0;
    if(++
checkFalling{i} == 3)
    {
        
//Here he is falling with an Vehicle for over 3sec
        
return checkFalling{i}=0;
    }
    return 
SetTimerEx("@checkFalling",999,0,"if",i,z);

Greekz