07.12.2009, 01:47
I made this version and it worked fine. Not too much math in mine. :P
pawn Код:
#define MAX_SPEED 0.7
#define SLOW_FACTOR 0.7
forward Timer();
public OnFilterScriptInit()
{
SetTimer("Timer",1000,1);
return 1;
}
public Timer()
{
new Float:x,Float:y,Float:z,veh;
for(new i; i<MAX_PLAYERS; i++)
{
veh=GetPlayerVehicleID(i);
GetVehicleVelocity(veh,x,y,z);
if((x > MAX_SPEED || x < -MAX_SPEED) || (y > MAX_SPEED || y < -MAX_SPEED))
{
SetVehicleVelocity(veh,x*SLOW_FACTOR,y*SLOW_FACTOR,z);
}
}
}