Guest User

Untitled

a guest
Nov 16th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. //====== BLITZER FUNKTIONEN =======//
  2. stock AddBlitzer(playerid,speeds,strafe) {
  3. new Float:x, Float:y, Float:z, Float:a;
  4. GetPlayerPos(playerid, x, y, z);
  5. GetPlayerFacingAngle(playerid, a);
  6. for(new i = 0; i < sizeof(Blitzer); i++) {
  7. if(Blitzer[i][Erstellt] == 0) {
  8. Blitzer[i][BlitzerX] = x + 1.0;
  9. Blitzer[i][BlitzerY] = y + 1.0;
  10. Blitzer[i][BlitzerZ] = z;
  11. Blitzer[i][Geschwindigkeit] = speeds;
  12. Blitzer[i][Radius] = 50;
  13. Blitzer[i][Strafe] = strafe;
  14. Blitzer[i][Erstellt] = 1;
  15. Blitzer[i][ID] += 1;
  16. Blitzer[i][ID] = CreateObject(18880, x + 1.0, y + 1.0, z - 1.0, 0.0, 0.0, a + 8);
  17. GesammtBlitzer++;
  18. return 1;
  19. }
  20. }
  21. return 0;
  22. }
  23. stock RemoveBlitzer(playerid) {
  24. for(new i = 0; i < sizeof(Blitzer); i++) {
  25. if(Blitzer[i][Erstellt] == 1) {
  26. if(IsPlayerInRangeOfPoint(playerid, Blitzer[i][Radius], Blitzer[i][BlitzerX], Blitzer[i][BlitzerY], Blitzer[i][BlitzerZ])) {
  27. Blitzer[i][Erstellt] = 0;
  28. Blitzer[i][BlitzerX] = 0.0;
  29. Blitzer[i][BlitzerY] = 0.0;
  30. Blitzer[i][BlitzerZ] = 0.0;
  31. DestroyObject(Blitzer[i][ID]);
  32. GesammtBlitzer--;
  33. return 1;
  34. }
  35. }
  36. }
  37. return 0;
  38. }
  39. stock RemoveAllBlitzer() {
  40. for(new i = 0; i < sizeof(Blitzer); i++) {
  41. if(Blitzer[i][Erstellt] == 1) {
  42. Blitzer[i][Erstellt] = 0;
  43. Blitzer[i][BlitzerX] = 0.0;
  44. Blitzer[i][BlitzerY] = 0.0;
  45. Blitzer[i][BlitzerZ] = 0.0;
  46. DestroyObject(Blitzer[i][ID]);
  47. GesammtBlitzer = 0;
  48. }
  49. }
  50. return 0;
  51. }
  52. stock CountBlitzer() {
  53. new anzahl = 0;
  54. for(new i = 0; i < sizeof(Blitzer); i++) {
  55. if(Blitzer[i][Erstellt] == 1) anzahl++;
  56. }
  57. return anzahl;
  58. }
  59. stock ErmittleGeschwindigkeit(playerid,bool:kmhb) {
  60. new Float:x,Float:y,Float:z,Float:rtn;
  61. if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); else GetPlayerVelocity(playerid,x,y,z);
  62. rtn = floatsqroot(x*x+y*y+z*z);
  63. return kmhb?floatround(rtn * 55 * 1.61):floatround(rtn * 100);
  64. }
  65.  
  66. stock GetDistanceToLastPoint(vehicleid)
  67. {
  68. new Float:x2, Float:y2, Float:z2, Float:output;
  69. GetVehiclePos(vehicleid, x2, y2, z2);
  70. 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));
  71. return floatround(output);
  72. }
  73.  
  74. Function Ende()
Advertisement
Add Comment
Please, Sign In to add comment