//====== BLITZER FUNKTIONEN =======// stock AddBlitzer(playerid,speeds,strafe) { new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); for(new i = 0; i < sizeof(Blitzer); i++) { if(Blitzer[i][Erstellt] == 0) { Blitzer[i][BlitzerX] = x + 1.0; Blitzer[i][BlitzerY] = y + 1.0; Blitzer[i][BlitzerZ] = z; Blitzer[i][Geschwindigkeit] = speeds; Blitzer[i][Radius] = 50; Blitzer[i][Strafe] = strafe; Blitzer[i][Erstellt] = 1; Blitzer[i][ID] += 1; Blitzer[i][ID] = CreateObject(18880, x + 1.0, y + 1.0, z - 1.0, 0.0, 0.0, a + 8); GesammtBlitzer++; return 1; } } return 0; } stock RemoveBlitzer(playerid) { for(new i = 0; i < sizeof(Blitzer); i++) { if(Blitzer[i][Erstellt] == 1) { if(IsPlayerInRangeOfPoint(playerid, Blitzer[i][Radius], Blitzer[i][BlitzerX], Blitzer[i][BlitzerY], Blitzer[i][BlitzerZ])) { Blitzer[i][Erstellt] = 0; Blitzer[i][BlitzerX] = 0.0; Blitzer[i][BlitzerY] = 0.0; Blitzer[i][BlitzerZ] = 0.0; DestroyObject(Blitzer[i][ID]); GesammtBlitzer--; return 1; } } } return 0; } stock RemoveAllBlitzer() { for(new i = 0; i < sizeof(Blitzer); i++) { if(Blitzer[i][Erstellt] == 1) { Blitzer[i][Erstellt] = 0; Blitzer[i][BlitzerX] = 0.0; Blitzer[i][BlitzerY] = 0.0; Blitzer[i][BlitzerZ] = 0.0; DestroyObject(Blitzer[i][ID]); GesammtBlitzer = 0; } } return 0; } stock CountBlitzer() { new anzahl = 0; for(new i = 0; i < sizeof(Blitzer); i++) { if(Blitzer[i][Erstellt] == 1) anzahl++; } return anzahl; } stock ErmittleGeschwindigkeit(playerid,bool:kmhb) { new Float:x,Float:y,Float:z,Float:rtn; if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); else GetPlayerVelocity(playerid,x,y,z); rtn = floatsqroot(x*x+y*y+z*z); return kmhb?floatround(rtn * 55 * 1.61):floatround(rtn * 100); } stock GetDistanceToLastPoint(vehicleid) { new Float:x2, Float:y2, Float:z2, Float:output; GetVehiclePos(vehicleid, x2, y2, z2); output = floatsqroot(floatpower(floatabs(floatsub(x2, sVehicle_X[vehicleid])), 2)+floatpower(floatabs(floatsub(y2, sVehicle_Y[vehicleid])), 2)+floatpower(floatabs(floatsub(z2, sVehicle_Z[vehicleid])), 2)); return floatround(output); } Function Ende()