Advertisement
Maskhara

Spike

Apr 13th, 2020
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. /*
  2. Special For SAMP.WOG.GE
  3. BY: მასხარა
  4. // <> შეიყვანეთ new <ან> #define
  5.  
  6. #define PI PlayerInfo
  7.  
  8. //NEW-SHI CHASVIT!
  9. enum spInfo
  10. {
  11. sID,
  12. sObject,
  13. sPickup,
  14. Float:sX,
  15. Float:sY,
  16. Float:sZ
  17. };
  18. new SpikeInfo[10][spInfo];
  19.  
  20. //CMD
  21. CMD:spike(playerid, params[])
  22. {
  23. new type[30];
  24. if(sscanf(params, "s[30]", type)) SendClientMessage(playerid, COLOR_GREY, "Daweret: /Spike [Create/Remove]");
  25. else
  26. {
  27. if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "Aq Tqven Ver Gamoiyenebt Am Commands.");
  28. if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY,"Tqven Ar Xart LSPD/FBI Tanamshromeli An Ar Gamogicvliat Forma");
  29. {
  30. if(strcmp(type, "create", true) == 0)
  31. {
  32. new found = 0;
  33. for(new i = 0; i < sizeof(SpikeInfo); i++)
  34. {
  35. if(SpikeInfo[i][sID] == 0)
  36. {
  37. found++;
  38. }
  39. }
  40. if(found == 0) return SendClientMessage(playerid,COLOR_WHITE,"All spike strip slots used.");
  41. for(new i = 0; i < sizeof(SpikeInfo); i++)
  42. {
  43. if(SpikeInfo[i][sID] == 0)
  44. {
  45. new Float:X,Float:Y,Float:Z,Float:A;
  46. GetPlayerPos(playerid,X,Y,Z);
  47. GetPlayerFacingAngle(playerid,A);
  48. SpikeInfo[i][sX]=X;
  49. SpikeInfo[i][sY]=Y;
  50. SpikeInfo[i][sZ]=Z;
  51. SpikeInfo[i][sID]=1;
  52. SpikeInfo[i][sObject] = CreateDynamicObject(2899, X, Y, Z-0.8, 0.0, 0.0, A, 0);
  53. SpikeInfo[i][sPickup] = CreateDynamicPickup(1007, 14, X, Y, Z, 0);
  54. SendClientMessage(playerid,COLOR_WHITE,"Tqven Dadgit Ekliani Martulebi.");
  55. return 1;
  56. }
  57. }
  58. }
  59. if(strcmp(type, "remove", true) == 0)
  60. {
  61. for(new i = 0; i < sizeof(SpikeInfo); i++)
  62. {
  63. if(SpikeInfo[i][sID] == 1)
  64. {
  65. if(IsPlayerInRangeOfPoint(playerid,2.0,SpikeInfo[i][sX],SpikeInfo[i][sY],SpikeInfo[i][sZ]))
  66. {
  67. if(SpikeInfo[i][sObject] > 0 && IsValidDynamicObject(SpikeInfo[i][sObject])) { DestroyDynamicObject(SpikeInfo[i][sObject]); }
  68. DestroyDynamicPickup(SpikeInfo[i][sPickup]);
  69. SpikeInfo[i][sObject]=0;
  70. SpikeInfo[i][sPickup]=0;
  71. SpikeInfo[i][sID]=0;
  72. SpikeInfo[i][sX]=0.0;
  73. SpikeInfo[i][sY]=0.0;
  74. SpikeInfo[i][sZ]=0.0;
  75. SendClientMessage(playerid,COLOR_WHITE,"Tqven Sheinaxet Ekliani Martulebi.");
  76. return 1;
  77. }
  78. }
  79. }
  80. }
  81. }
  82. }
  83. return 1;
  84. }
  85.  
  86. //OnPlayerPickUpDynamicPickup-Shi Chasvit
  87. for(new i=0;i<sizeof(SpikeInfo);i++)
  88. {
  89. if(pickupid == SpikeInfo[i][sPickup])
  90. {
  91. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  92. {
  93. new panels, tires;
  94. GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
  95. UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, 15);
  96. DestroyDynamicPickup(SpikeInfo[i][sPickup]);
  97. new id = CreateDynamicPickup(1007, 14, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ], 0);
  98. SpikeInfo[i][sPickup] = id;
  99. }
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement