31.10.2011, 11:39
guys i've made that....please tell me if you see any errors...It should work like..if player is a cop and have a weapon(camera) he can use /Radargun ...that freezes him and if any player is going more then 120kph over him he get a star...and this needs to work on more cops...like 10 cops using /radargun and they will get wanted at all points ..not only at one cop..PLEASE
TOP OF SCRIPT:
TOP OF SCRIPT:
PHP код:
new Float:playerposx,Float:playerposy,Float:playerposz,wantedlevel;
PHP код:
stock GetVehicleSpeed(vehicleid)
{
if(vehicleid != INVALID_VEHICLE_ID)
{
new Float:Pos[3],Float:VS ;
GetVehicleVelocity(vehicleid, Pos[0], Pos[1], Pos[2]);
VS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
return floatround(VS,floatround_round);
}
return INVALID_VEHICLE_ID;
}
stock GetPlayerSpeed(playerid)
{
if(playerid != INVALID_PLAYER_ID)
{
new Float:Pos[3],Float:PS;
GetPlayerVelocity(playerid, Pos[0], Pos[1], Pos[2]);
PS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
return floatround(PS,floatround_round);
}
return INVALID_PLAYER_ID;
}
CMD:radargun(playerid,params[])
{
if(ClassPolice && GetPlayerWeapon(playerid) == 43)
{
GetPlayerPos(playerid,playerposx,playerposy,playerposz);
TogglePlayerControllable(playerid,0);
}
return 1;
}
public OnPlayerUpdate(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(playerid))
{
if (IsPlayerInRangeOfPoint(playerid,playerposx,playerposy,playerposz,60.0) && GetPlayerSpeed(playerid) <= 120)
{
SetPlayerWantedLevel(playerid,wantedlevel+1);
}
}
}
return 1;
}