if (IsPlayerInRangeOfPoint(playerid, 30.0, x, y, z)
{
if (speed > 90)
{
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, COLOR_RED, "You have been fined $250 for going over the speed limit! Please slow down");
}
}
@Rokzlive, his example wont work, because his pulling "speed" out from his ass.
http://forum.sa-mp.com/showthread.ph...eed#post951796 http://forum.sa-mp.com/showthread.ph...eed#post547265 |
stock GetVehicleSpeed(vehicleid)
{
new Float:v_vX, Float:v_vY, Float:v_vZ, Float:retres;
GetVehicleVelocity(vehicleid, v_vX, v_vY, v_vZ);
retres = floatsqroot(floatabs(floatpower(v_vX + v_vY + v_vZ, 2)));
return floatround(retres * 100, floatround_ceil);
}
OnGameModeInit()
SetTimer("SpeedTrap",1000,true);//Setting a timer to check if the player is in that Zone with a time of 1 second (1000 ms = 1 second) and the timer will be repeated (true) if you want the timer not to be repeated (false).
forward SpeedTrap(playerid,vehicleid)
public SpeedTrap(playerid,vehicleid)
{
new pstats = GetPlayerState(playerid);//Storing GetPlayerState(playerid) in pstate
if(pstate = PLAYER_STATE_DRIVER)
if(IsPlayerInRangeOfPoint(playerid,10.0,x,y,z))//Replace the x,y and z with your cords
if(GetVehicleSpeed(vehicleid) > 50))
//SetPlayerWantedLevel(playerid,1);
//GivePlayerCash(playerid,-250);
return 1;
}