Freeze Vehicle ? [Needs Adding] -
English-Conceptz - 07.12.2011
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.
Re: Freeze Vehicle ? [Needs Adding] -
Michael@Belgium - 07.12.2011
Hmm,
I don't thinks so
Re: Freeze Vehicle ? [Needs Adding] -
English-Conceptz - 07.12.2011
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 -.-
Re: Freeze Vehicle ? [Needs Adding] -
Michael@Belgium - 07.12.2011
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 .
Re: Freeze Vehicle ? [Needs Adding] -
English-Conceptz - 07.12.2011
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
Re: Freeze Vehicle ? [Needs Adding] -
Michael@Belgium - 07.12.2011
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
Re: Freeze Vehicle ? [Needs Adding] -
English-Conceptz - 07.12.2011
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:vfreeze( playerid, params[ ] )
{
new vehID;
vehID = GetPlayerVehicleID(playerid);
FreezeVehicle(vehID, 1);
return 1;
}
CMD:vunfreeze( playerid, params[ ] )
{
new vehID1;
vehID1 = GetPlayerVehicleID(playerid);
FreezeVehicle(vehID1, 0);
return 1;
}
stock FreezeVehicle(vehicleid, fstate)
{
if(fstate == 1)
{
svFreezed[vehicleid] = 1;
OnVehicleFreezed(vehicleid);
svFreezeTime[vehicleid] = SetTimerEx("OnVehicleFreezed", 50, true, "i", vehicleid);
}
else
{
svFreezed[vehicleid] = 0;
KillTimer(svFreezeTime[vehicleid]);
}
return 1;
}
public OnVehicleFreezed(vehicleid)
{
if(svFreezed[vehicleid] == 1)
SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.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...
Re: Freeze Vehicle ? [Needs Adding] -
Michael@Belgium - 07.12.2011
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)
Re: Freeze Vehicle ? [Needs Adding] -
English-Conceptz - 07.12.2011
no change what so ever.....
Re: Freeze Vehicle ? [Needs Adding] -
MP2 - 07.12.2011
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.)