17.11.2011, 11:46
Is that possible, just looked through the functions and didn't see any function that would freeze a car.
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;
}