Advertisement
Guest User

Untitled

a guest
Dec 8th, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. #include a_samp
  2. #include zcmd
  3.  
  4. #define MAX_DROT 200
  5.  
  6. //----------------------------------------SZÍNEK----------------------------------------//
  7. #define ZOLD 0x03b01aAA
  8. #define SARGA 0xeefa00AA
  9. #define NARANCSS 0xf0a400AA
  10. #define PIROS 0xe60000AA
  11.  
  12. enum szInfo
  13. {
  14. Van,
  15. Object,
  16. Float: PosX,
  17. Float: PosY,
  18. Float: PosZ,
  19. Float: Fordulas
  20. };
  21.  
  22. new DrotInfo[MAX_DROT][szInfo];
  23.  
  24. new foutobject[50];
  25.  
  26. CMD:lerak(playerid)
  27. {
  28. new string[128];
  29. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, PIROS, "Kocsiból nem rakhatod le.");
  30. for(new drot; drot < MAX_DROT; drot++)
  31. {
  32. if(DrotInfo[drot][Van] == 0)
  33. {
  34. GetPlayerPos(playerid, DrotInfo[drot][PosX], DrotInfo[drot][PosY], DrotInfo[drot][PosZ]);
  35. GetPlayerFacingAngle(playerid, DrotInfo[drot][Fordulas]);
  36. DrotInfo[drot][Object] = CreateObject(2892, DrotInfo[drot][PosX], DrotInfo[drot][PosY], DrotInfo[drot][PosZ]-1, 0.0, 0.0, DrotInfo[drot][Fordulas]);
  37. DrotInfo[drot][Van] = 1;
  38. format(string, sizeof(string), "X: %f Y: %f Z: %f Fordulas: %f | ID: %d", DrotInfo[drot][PosX], DrotInfo[drot][PosY], DrotInfo[drot][PosZ]-1, DrotInfo[drot][Fordulas], drot);
  39. SendClientMessage(playerid, SARGA, "Leraktál egy szögesdrótot.");
  40. SendClientMessage(playerid, NARANCSS, "Adatok:");
  41. SendClientMessage(playerid, ZOLD, string);
  42. break;
  43. }
  44. }
  45. return 1;
  46. }
  47.  
  48. CMD:felszed(playerid)
  49. {
  50. new string[128], Float:x, Float:y, Float:z;
  51. for(new drot; drot < MAX_DROT; drot++)
  52. {
  53. if(DrotInfo[drot][Van] == 1)
  54. {
  55. GetObjectPos(DrotInfo[drot][Object], x, y, z);
  56. if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
  57. {
  58. DestroyObject(DrotInfo[drot][Object]);
  59. format(string, sizeof(string), "X: %f Y: %f Z: %f Fordulas: %f | ID: %d", DrotInfo[drot][PosX], DrotInfo[drot][PosY], DrotInfo[drot][PosZ], DrotInfo[drot][Fordulas], drot);
  60. DrotInfo[drot][Van] = 0;
  61. DrotInfo[drot][PosX] = 0;
  62. DrotInfo[drot][PosY] = 0;
  63. DrotInfo[drot][PosZ] = 0;
  64. DrotInfo[drot][Fordulas] = 0;
  65. SendClientMessage(playerid, SARGA, "Felszedtél egy szögesdrótot.");
  66. SendClientMessage(playerid, NARANCSS, "Adatok:");
  67. SendClientMessage(playerid, ZOLD, string);
  68. break;
  69. }
  70. }
  71. }
  72. return 1;
  73. }
  74.  
  75. CMD:felszedall(playerid)
  76. {
  77. for(new drot; drot < MAX_DROT; drot++)
  78. {
  79. DestroyObject(DrotInfo[drot][Object]);
  80. DrotInfo[drot][Van] = 0;
  81. DrotInfo[drot][PosX] = 0;
  82. DrotInfo[drot][PosY] = 0;
  83. DrotInfo[drot][PosZ] = 0;
  84. DrotInfo[drot][Fordulas] = 0;
  85. }
  86. SendClientMessage(playerid, SARGA, "Felszedted az összes szögesdrótot.");
  87. return 1;
  88. }
  89.  
  90. public OnPlayerUpdate(playerid)
  91. {
  92. new Float:x, Float:y, Float:z;
  93. new panels, doors, lights, tires;
  94. new vehicleid = GetPlayerVehicleID(playerid);
  95.  
  96. for(new drot; drot < MAX_DROT; drot++)
  97. {
  98. if(DrotInfo[drot][Van] == 1)
  99. {
  100. GetObjectPos(DrotInfo[drot][Object], x, y, z);
  101. if(IsPlayerInRangeOfPoint(playerid, 4.0, x, y, z) && IsPlayerInAnyVehicle(playerid))
  102. {
  103. GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
  104. UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15);
  105. break;
  106. }
  107. }
  108. }
  109.  
  110. GetObjectPos(foutobject[49], x, y, z);
  111. if(IsPlayerInRangeOfPoint(playerid, 4.0, x, y, z) && IsPlayerInAnyVehicle(playerid))
  112. {
  113. GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
  114. UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15);
  115. }
  116. return 1;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement