Advertisement
Shanidzee

Untitled

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