23.08.2012, 20:42
PHP код:
forward GetVehicleSpeed(vehicleid, unit);
forward test(playerid);
/*=========================Callbacks=========================*/
public GetVehicleSpeed(vehicleid, unit)
{
new
Float:x_speed, Float:y_speed, Float:z_speed, Float:speedf, speed;
GetVehicleVelocity(vehicleid,x_speed,y_speed,z_speed);
if(unit == kmh)
{
speedf = floatsqroot(((x_speed*x_speed)+(y_speed*y_speed))+(z_speed*z_speed)) * 187.666667;
}
else if(unit == mph)
{
speedf = floatsqroot(((x_speed*x_speed)+(y_speed*y_speed))+(z_speed*z_speed)) * 116.541;
}
speed = floatround(speedf,floatround_round);
return speed;
}
public OnPlayerConnect(playerid)
{
SetTimerEx("test", 360000, true, "i", playerid);
return 1;
}
public test(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,30.0,-2802.2390,-474.2502,7.1875))
{
new v = GetPlayerVehicleID(playerid);
GetVehicleSpeed(v,kmh);
if(GetVehicleSpeed(GetPlayerVehicleID(playerid),>50))
{
SendClientMessage(playerid,-1,"Speed kam kar oye!");
GivePlayerMoney(playerid,-100);
}
}
}
PHP код:
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : error 029: invalid expression, assumed zero
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : warning 215: expression has no effect
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : error 001: expected token: ";", but found ")"
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : error 029: invalid expression, assumed zero
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\speedcams.pwn(72) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.