17.11.2011, 12:07
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.
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;
}