Vehicle interaction
#2

No, there is no function. BUT
You can try making a 1 second timer that is looping
PHP код:
SetTimer("Loop"10001); //under ongamemodeinit 
and check the player pos, speed and vehicle id.

PHP код:
forward Loop();
public 
Loop(){
    for(new 
playeridplayerid MAX_PLAYERSplayerid++){
        if(
GetPlayerVehicleID(playerid) == JobVehicle[playerid/*for example*/ && InJob[playerid] == && IsPlayerInRangeOfPoint(playerid10xyz) && GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 10){
            
DestroyObject(TheObjectThatThePlayerMustDestroy[playerid]);
            
//when the object is destroyed
        
}
    }
}
stock GetVehicleSpeed(vehicleid)
{
        if(
vehicleid != INVALID_VEHICLE_ID)
        {
                new 
Float:Pos[3],Float:VS ;
                
GetVehicleVelocity(vehicleidPos[0], Pos[1], Pos[2]);
                
VS floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
                return 
floatround(VS,floatround_round);
        }
        return 
INVALID_VEHICLE_ID;

Reply


Messages In This Thread
Vehicle interaction - by Geebrox - 17.05.2018, 20:27
Re: Vehicle interaction - by Vennox - 17.05.2018, 20:43
Re: Vehicle interaction - by Geebrox - 17.05.2018, 20:48
Re: Vehicle interaction - by Lokii - 17.05.2018, 20:57
Re: Vehicle interaction - by Pottus - 17.05.2018, 21:59
Re: Vehicle interaction - by NaS - 17.05.2018, 22:53

Forum Jump:


Users browsing this thread: 2 Guest(s)