Freeze Vehicle ? [Needs Adding]
#1

This needs to be added into the next update:

FreezeVehicle(vehicleId);

players moving vehicles is so annoying, i personally have a dealership and cars can be pushed to anywhere anybody wants.... its also annoying for car rentals, parked cars etc etc.




Can This Be Added In The Next Release Please.
Reply
#2

Hmm, I don't thinks so
Reply
#3

Already tried that, it doesnt work.

you cant set a cars velocity to zero when no one is in the vehicle. it also uses timers -.-
Reply
#4

Quote:
Originally Posted by English-Conceptz
Посмотреть сообщение
Already tried that, it doesnt work.

you cant set a cars velocity to zero when no one is in the vehicle. it also uses timers -.-
decrease the freezetimer in the include then x) I used the include to and it works on my gamemode .
Reply
#5

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
decrease the freezetimer in the include then x) I used the include to and it works on my gamemode .
can i have example of how you used it ? it gives me lots of errors
Reply
#6

Quote:
Originally Posted by English-Conceptz
Посмотреть сообщение
can i have example of how you used it ? it gives me lots of errors
show me your code and errors
Reply
#7

never mind i got it working and it does fuck all, you can still move the vehicle when your not in it, and when you are inside it its like dragging a ton of bricks int he back which is pointless because i can just switch the engine off ...

code:
PHP код:
forward OnVehicleFreezed(vehicleid);
new 
svFreezeTime[MAX_VEHICLES],svFreezed[MAX_VEHICLES]; 
PHP код:
CMD:vfreezeplayeridparams[ ] )
{
new 
vehID;
vehID GetPlayerVehicleID(playerid);
FreezeVehicle(vehID1);
return 
1;
}
CMD:vunfreezeplayeridparams[ ] )
{
new 
vehID1;
vehID1 GetPlayerVehicleID(playerid);
FreezeVehicle(vehID10);
return 
1;
}
stock FreezeVehicle(vehicleidfstate)
{
    if(
fstate == 1)
    {
        
svFreezed[vehicleid] = 1;
        
OnVehicleFreezed(vehicleid);
        
svFreezeTime[vehicleid] = SetTimerEx("OnVehicleFreezed"50true"i"vehicleid);
    }
    else
    {
        
svFreezed[vehicleid] = 0;
        
KillTimer(svFreezeTime[vehicleid]);
    }
    return 
1;
}
public 
OnVehicleFreezed(vehicleid)
{
    if(
svFreezed[vehicleid] == 1)
        
SetVehicleVelocity(vehicleid0.00.00.0);
    else
        
KillTimer(svFreezeTime[vehicleid]);
    return 
1;

i bet you cant make it so the vehicle wont move an inch when i push against it...
Reply
#8

I edited this:
pawn Код:
svFreezeTime[vehicleid] = SetTimerEx("OnVehicleFreezed", 50, true, "i", vehicleid);
to this:

pawn Код:
svFreezeTime[vehicleid] = SetTimerEx("OnVehicleFreezed", 10, true, "i", vehicleid);
And it just really freeze in the air (or somewhere else)
Reply
#9

no change what so ever.....
Reply
#10

Yes but instead of resetting the vehicle's position every 0.00000000000000001 seconds and having an array for whether they're frozen, and 4 floats per vehicle to store the frozen position, it would be much better to have a native function to disable the collision on vehicles (not so you can walk through them, so they aren't affected by running into them, like objects.)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)