Freeze car in air?
#1

Is that possible, just looked through the functions and didn't see any function that would freeze a car.
Reply
#2

I use something like this(using zCMD)


EDIT: wasn't paying attention while posting it, I'm not sure if there are a function for that but heres a simple way of freezing a vehicle and unfreezing in air or any other position.
pawn Код:
new
    isfrozen[MAX_PLAYERS],
    ftimer[MAX_PLAYERS];

CMD:freezecar(playerid,params[])
{

    if(isfrozen[playerid] == 1)
    {
        KillTimer(ftimer[playerid]);
        isfrozen[playerid] = 0;
        SCM(playerid,COLOR_LIGHTRED,"Your vehicle has been unfrozen!");
    }
    else if(isfrozen[playerid] == 0 || !isfrozen[playerid])
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
        ftimer[playerid] = SetTimerEx("freeze",1,1,"i",playerid);
        isfrozen[playerid] = 1;
        SCM(playerid,COLOR_LIGHTRED,"Your vehicle has been frozen!");
    }
   
    }
    return 1;
}

forward freeze(playerid);
public freeze(playerid)
{
    SetVehicleVelocity(GetPlayerVehicleID(playerid),0,0,0);
    return 1;
}
Reply
#3

No way if a player isn't in the car?
Reply
#4

SetVehicleVelocity(vehicleid, 0, 0, 0);

That in OnPlayerUpdate is your best shot, however it's not going to work great due to lag. I'd suggest possibly creating the 5002 object and setting the rx rotation to 180 - it's a massive runway that has no texture underneath so will be an invisible platform for the vehicle to rest on. Just keep it under the vehicle and players will never see it (unless they move the camera under the vehicle, but it's still really the only way.)
Reply
#5

Nevermind
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)