TonyVk

Untitled

Sep 6th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.14 KB | None | 0 0
  1. #define DIALOG_GEPEK 25214
  2.  
  3. CMD:trunk(playerid, params[])
  4. {
  5. new Float:x, Float:y, Float:z;
  6. new veh = GetClosestVehicle(playerid, 2.0);
  7. if(PlayerInfo[playerid][pPosedovanjeAuta] == -1) return SCM(playerid,-1,"Vi ne posjedujete vozilo!");
  8. if(VoziloInfo[PlayerInfo[playerid][pPosedovanjeAuta]][vID] != veh) return SCM(playerid,-1,"Niste kod svoga vozila!");
  9. GetPosBehindVehicle(veh, x, y, z);
  10. if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
  11. {
  12. SPD(playerid,DIALOG_GEPEK,DIALOG_STYLE_LIST, ""SPLAVA"Gepek", "Informacije\nOstavi u vozilu\nUzmi iz vozila", "Odaberi", "Izlaz");
  13. }
  14. return 1;
  15. }
  16.  
  17. CMD:gepek(playerid, params[])
  18. {
  19. new Float:x, Float:y, Float:z;
  20. new veh = GetClosestVehicle(playerid, 2.0);
  21. GetPosBehindVehicle(veh, x, y, z);
  22. if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
  23. {
  24. new engine, lights, alarm, doors, bonnet, boot, objective;
  25. GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
  26. if(boot==0)
  27. {
  28. SendClientMessage(playerid, -1, "Otvorio si gepek.");
  29. SetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, 1, objective);
  30. }
  31. else
  32. {
  33. SendClientMessage(playerid, -1, "Zatvorio si gepek.");
  34. SetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, 0, objective);
  35. }
  36. }
  37. return 1;
  38. }
  39. stock GetPosBehindVehicle(vehicleid, &Float:x, &Float:y, &Float:z, Float:offset=0.5)
  40. {
  41. new Float:vehicleSize[3], Float:vehiclePos[3];
  42. GetVehiclePos(vehicleid, vehiclePos[0], vehiclePos[1], vehiclePos[2]);
  43. GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, vehicleSize[0], vehicleSize[1], vehicleSize[2]);
  44. GetXYBehindVehicle(vehicleid, vehiclePos[0], vehiclePos[1], (vehicleSize[1]/2)+offset);
  45. x = vehiclePos[0];
  46. y = vehiclePos[1];
  47. z = vehiclePos[2];
  48. return 1;
  49. }
  50. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  51. {
  52. if(dialogid == DIALOG_GEPEK)
  53. {
  54. if(!response) return 1;
  55. new i = PlayerInfo[playerid][pPosedovanjeAuta];
  56. if(PlayerInfo[playerid][pPosedovanjeAuta] == -1) return SCM(playerid,-1,"[UP:RP] "CRVENA"Ne posedujes auto!");
  57. switch(listitem)
  58. {
  59. case 0:
  60. {
  61. SCM(playerid,-1,""SPLAVA"||-------------------------------------------------------------------------------------------||");
  62. new str[256];
  63. format(str,sizeof(str),""SPLAVA"Oruzje: "BELA"%s | "SPLAVA"Metaka: "BELA"%d | "SPLAVA"Droga: "BELA"%dg | "SPLAVA"Materijali: "BELA"%d",GetWeapon(VoziloInfo[i][vOruzije]),VoziloInfo[i][vMunicija], VoziloInfo[i][vDroga], VoziloInfo[i][vMats]);
  64. SCM(playerid,-1,str);
  65. SCM(playerid,-1,""SPLAVA"||-------------------------------------------------------------------------------------------||");
  66. }
  67. case 1:
  68. {
  69. SPD(playerid,DIALOG_AUTOSTAVI,DIALOG_STYLE_LIST,""BELA"Ostavi u auto","Drogu\nMaterijale\nOruzje","Odaberi","Izlaz");
  70. }
  71. case 2:
  72. {
  73. SPD(playerid,DIALOG_AUTOUZMI,DIALOG_STYLE_LIST,""BELA"Uzmi iz auta","Drogu\nMaterijale\nOruzje","Odaberi","Izlaz");
  74. }
  75. }
  76. }
  77. if(dialogid == DIALOG_AUTOSTAVI)
  78. {
  79. if(!response) return 1;
  80. new i = PlayerInfo[playerid][pPosedovanjeAuta];
  81. if(PlayerInfo[playerid][pPosedovanjeAuta] == -1) return SCM(playerid,-1,"[UP:RP] "CRVENA"Ne posedujes auto!");
  82. switch(listitem)
  83. {
  84. case 0:
  85. {
  86. SPD(playerid,DIALOG_AODROGU,DIALOG_STYLE_INPUT,"Ostavi",""SPLAVA"Unesite kolicinu droge koju zelite da ostavite u auto (MAX 5000)...","Promeni","Izlaz");
  87. }
  88. case 1:
  89. {
  90. SPD(playerid,DIALOG_AOMATS,DIALOG_STYLE_INPUT,"Ostavi",""SPLAVA"Unesite kolicinu materijala koju zelite da ostavite u auto (MAX 5000)...","Promeni","Izlaz");
  91. }
  92. case 2:
  93. {
  94. if(VoziloInfo[i][vOruzije] != -1) return SCM(playerid,-1,""SIVA"Vec imas oruzije u vozilu!");
  95. if(GetPlayerWeapon(playerid) <= 0) return SCM(playerid,-1,""SIVA"Nemas oruzije u ruci!");
  96. VoziloInfo[i][vOruzije] = GetPlayerWeapon(playerid); VoziloInfo[i][vMunicija] = GetPlayerAmmo(playerid);
  97. SacuvajVozilo(i); SetPlayerAmmo(playerid, GetPlayerWeapon(playerid), 0);
  98. }
  99. }
  100. }
  101. if(dialogid == DIALOG_AUTOUZMI)
  102. {
  103. if(!response) return 1;
  104. new i = PlayerInfo[playerid][pPosedovanjeAuta];
  105. if(PlayerInfo[playerid][pPosedovanjeAuta] == -1) return SCM(playerid,-1,"[UP:RP] "CRVENA"Ne posedujes auto!");
  106. switch(listitem)
  107. {
  108. case 0:
  109. {
  110. SPD(playerid,DIALOG_AUDROGU,DIALOG_STYLE_INPUT,"Uzmi",""SPLAVA"Unesite kolicinu droge koju zelite da uzmete iz auta...","Promeni","Izlaz");
  111. }
  112. case 1:
  113. {
  114. SPD(playerid,DIALOG_AUMATS,DIALOG_STYLE_INPUT,"Uzmi",""SPLAVA"Unesite kolicinu materijala koju zelite da uzmete...","Promeni","Izlaz");
  115. }
  116. case 2:
  117. {
  118. if(VoziloInfo[i][vOruzije] == -1) return SCM(playerid,-1,""SIVA"Nemate oruzije u vasem vozilu!");
  119. g_GivePlayerWeapon(playerid,VoziloInfo[i][vOruzije],VoziloInfo[i][vMunicija]); VoziloInfo[i][vOruzije] = -1; VoziloInfo[i][vMunicija] = -1;
  120. SacuvajVozilo(i); SCM(playerid,-1,"UP:RP | "ZELENA"Uzeli ste oruzije iz vaseg vozila!");
  121. }
  122. }
  123. }
  124. return 1;
  125. }
Advertisement
Add Comment
Please, Sign In to add comment