Guest User

Untitled

a guest
Dec 28th, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.96 KB | None | 0 0
  1. Comanda /cars (contine numar maxim de sloturi 13)
  2.  
  3. CMD:cars ( playerid, params [ ] )
  4. {
  5. if ( isnull ( params ) )
  6. {
  7. new string[880];
  8. new const vehicleidd = GetPlayerVehicleID ( playerid );
  9. format(string, sizeof(string), "UPDATE `vehicles` SET `sqlid` = '%i' WHERE `sqlid` = '%i' ", vInfo [ vehicleidd ] [ vSQLID ]);
  10. mysql_tquery(mysql_db, string);
  11. if ( pVeh [ playerid ] [ 0 ] == -1 && pVeh [ playerid ] [ 1 ] == -1 && pVeh [ playerid ] [ 2 ] == -1
  12. && pVeh [ playerid ] [ 3 ] == -1 && pVeh [ playerid ] [ 4 ] == -1 && pVeh [ playerid ] [ 5 ] == -1 && pVeh [ playerid ] [ 6 ] == -1 && pVeh [ playerid ] [ 7 ] == -1
  13. && pVeh [ playerid ] [ 8 ] == -1 && pVeh [ playerid ] [ 9 ] == -1 && pVeh [ playerid ] [ 10 ] == -1 && pVeh [ playerid ] [ 11 ] == -1 && pVeh [ playerid ] [ 12 ] == -1) return SendClientMessage ( playerid, -1, "* Nu detii vehicule personale." );
  14. new vehicleid = pVeh [ playerid ] [ 0 ];
  15. if ( vehicleid != -1 )
  16. {
  17. format ( string, sizeof ( string ), "%s(%s)\n", GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  18. }
  19. vehicleid = pVeh [ playerid ] [ 1 ];
  20. if ( vehicleid != -1 )
  21. {
  22. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  23. }
  24. vehicleid = pVeh [ playerid ] [ 2 ];
  25. if ( vehicleid != -1 )
  26. {
  27. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  28. }
  29. vehicleid = pVeh [ playerid ] [ 3 ];
  30. if ( vehicleid != -1 )
  31. {
  32. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  33. }
  34. vehicleid = pVeh [ playerid ] [ 4 ];
  35. if ( vehicleid != -1 )
  36. {
  37. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  38. }
  39. vehicleid = pVeh [ playerid ] [ 5 ];
  40. if ( vehicleid != -1 )
  41. {
  42. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  43. }
  44. vehicleid = pVeh [ playerid ] [ 6 ];
  45. if ( vehicleid != -1 )
  46. {
  47. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  48. }
  49. vehicleid = pVeh [ playerid ] [ 7 ];
  50. if ( vehicleid != -1 )
  51. {
  52. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  53. }
  54. vehicleid = pVeh [ playerid ] [ 8 ];
  55. if ( vehicleid != -1 )
  56. {
  57. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  58. }
  59. vehicleid = pVeh [ playerid ] [ 9 ];
  60. if ( vehicleid != -1 )
  61. {
  62. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  63. }
  64. vehicleid = pVeh [ playerid ] [ 10 ];
  65. if ( vehicleid != -1 )
  66. {
  67. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  68. }
  69. vehicleid = pVeh [ playerid ] [ 11 ];
  70. if ( vehicleid != -1 )
  71. {
  72. format ( string, sizeof ( string ), "%s%s(%s)\n",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  73. }
  74. vehicleid = pVeh [ playerid ] [ 12 ];
  75. if ( vehicleid != -1 )
  76. {
  77. format ( string, sizeof ( string ), "%s%s(%s)",string, GetVehicleName ( vInfo [ vehicleid ] [ vModel ] ), ( ( vInfo [ vehicleid ] [ vLock ] ) ? ( "{FF0000}Locked" ) : ( "{00FF15}Unlocked" ) ) );
  78. }
  79. ShowPlayerDialog ( playerid, DIALOG_CARS, DIALOG_STYLE_LIST, "Vehicule personale", string, "Select", "Close" );
  80. }
  81. return 1;
  82. }
  83.  
  84. Callback OnDialogResponse
  85.  
  86. if(dialogid == DIALOG_CARS)
  87. {
  88. if(response)
  89. {
  90. switch(listitem)
  91. {
  92. case 0:
  93. {
  94. ShowPlayerDialog(playerid,DIALOG_MOD,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  95. }
  96. case 1:
  97. {
  98. ShowPlayerDialog(playerid,DIALOG_MOD1,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  99. }
  100. case 2:
  101. {
  102. ShowPlayerDialog(playerid,DIALOG_MOD2,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  103. }
  104. case 3:
  105. {
  106. ShowPlayerDialog(playerid,DIALOG_MOD3,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  107. }
  108. case 4:
  109. {
  110. ShowPlayerDialog(playerid,DIALOG_MOD4,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  111. }
  112. case 5:
  113. {
  114. ShowPlayerDialog(playerid,DIALOG_MOD5,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  115. }
  116. case 6:
  117. {
  118. ShowPlayerDialog(playerid,DIALOG_MOD6,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  119. }
  120. case 7:
  121. {
  122. ShowPlayerDialog(playerid,DIALOG_MOD7,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  123. }
  124. case 8:
  125. {
  126. ShowPlayerDialog(playerid,DIALOG_MOD8,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  127. }
  128. case 9:
  129. {
  130. ShowPlayerDialog(playerid,DIALOG_MOD9,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  131. }
  132. case 10:
  133. {
  134. ShowPlayerDialog(playerid,DIALOG_MOD10,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  135. }
  136. case 11:
  137. {
  138. ShowPlayerDialog(playerid,DIALOG_MOD11,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  139. }
  140. case 12:
  141. {
  142. ShowPlayerDialog(playerid,DIALOG_MOD12,DIALOG_STYLE_LIST,"Panel Vehicul","Info Car\nTow Car\nFind Car\nPark Vehicle", "Select", "Close");
  143. }
  144. }
  145. return 1;
  146. }
  147. return 0;
  148. }
  149. if(dialogid == DIALOG_MOD)
  150. {
  151. if(response)
  152. {
  153. switch(listitem)
  154. {
  155. case 0:
  156. {
  157. new vehid = pVeh [ playerid ] [ 0 ];
  158. if(vehid != -1 )
  159. {
  160. format(string, sizeof(string), "Model: %s\n%s\nPrice %s\nLicense Plate: %s", GetVehicleName ( vInfo [ vehid ] [ vModel ] ),( ( vInfo [ vehid ] [ vLock ] ) ? ( "Locked" ) : ( "Unlocked" ) ), FormatMoney ( vInfo [ vehid ] [ vPrice ] ), vInfo [ vehid ] [ vPlate ] );
  161. }
  162. ShowPlayerDialog ( playerid, 550, DIALOG_STYLE_MSGBOX, "Vehicle Info", string, "OK", "" );
  163. }
  164. case 1:
  165. {
  166. SetVehicleToRespawn ( pVeh [ playerid ] [ 0 ] );
  167. GivePlayerMoney ( playerid, -2500 );
  168. SBizzInfo[8][sbTill] += 2500;//towcar buisness
  169. ExtortionSBiz(8, 2500);
  170. SBizzInfo[8][sbProducts]--;
  171. SCM(playerid,COLOR_WHITE,"Ti-au fost retrasi din cont suma de 2,500 $");
  172. }
  173. case 2:
  174. {
  175. new Float: cPos [ 3 ];
  176. GetVehiclePos ( pVeh [ playerid ] [ 0 ], cPos [ 0 ], cPos [ 1 ], cPos [ 2 ] );
  177.  
  178. pSearchingVeh { playerid } = true;
  179.  
  180. SetPlayerCheckpoint ( playerid, cPos [ 0 ], cPos [ 1 ], cPos [ 2 ], 5.0 );
  181.  
  182. SendClientMessage ( playerid, -1, "* Ti-a fost setat un checkpoint pe minimap, du-te la el pentru a-ti gasi vehiculul." );
  183. }
  184. case 3:
  185. {
  186. new const vehicleid = GetPlayerVehicleID ( playerid );
  187. if ( vehicleid != pVeh [ playerid ] [ 0 ] ) return SendClientMessage ( playerid, -1, "* Nu esti in vehiculul cu slot 1." );
  188.  
  189. GetVehiclePos ( vehicleid, vInfo [ vehicleid ] [ vPos ] [ 0 ], vInfo [ vehicleid ] [ vPos ] [ 1 ], vInfo [ vehicleid ] [ vPos ] [ 2 ] );
  190. GetVehicleZAngle ( vehicleid, vInfo [ vehicleid ] [ vPos ] [ 3 ] );
  191. SaveVehicle ( vehicleid, TYPE_STATS );
  192.  
  193. SendClientMessage ( playerid, -1, "* Aici iti vei gasi vehiculul personal." );
  194. }
  195. }
  196. return 1;
  197. }
  198. return 0;
  199. }
  200. if(dialogid == DIALOG_MOD1)
  201. {
  202. if(response)
  203. {
  204. switch(listitem)
  205. {
  206. case 0:
  207. {
  208. new vehid = pVeh [ playerid ] [ 1 ];
  209. if(vehid != -1 )
  210. {
  211. format(string, sizeof(string), "Model: %s\n%s\nPrice %s\nLicense Plate: %s", GetVehicleName ( vInfo [ vehid ] [ vModel ] ),( ( vInfo [ vehid ] [ vLock ] ) ? ( "Locked" ) : ( "Unlocked" ) ), FormatMoney ( vInfo [ vehid ] [ vPrice ] ), vInfo [ vehid ] [ vPlate ] );
  212. }
  213. ShowPlayerDialog ( playerid, 551, DIALOG_STYLE_MSGBOX, "Vehicle Info", string, "OK", "" );
  214. }
  215. case 1:
  216. {
  217. SetVehicleToRespawn ( pVeh [ playerid ] [ 1 ] );
  218. GivePlayerMoney ( playerid, -2500 );
  219. SBizzInfo[8][sbTill] += 2500;//towcar buisness
  220. ExtortionSBiz(8, 2500);
  221. SBizzInfo[8][sbProducts]--;
  222. SCM(playerid,COLOR_WHITE,"Ti-au fost retrasi din cont suma de 2,500 $");
  223. }
  224. case 2:
  225. {
  226. new Float: cPos [ 3 ];
  227. GetVehiclePos ( pVeh [ playerid ] [ 1 ], cPos [ 0 ], cPos [ 1 ], cPos [ 2 ] );
  228.  
  229. pSearchingVeh { playerid } = true;
  230.  
  231. SetPlayerCheckpoint ( playerid, cPos [ 0 ], cPos [ 1 ], cPos [ 2 ], 5.0 );
  232.  
  233. SendClientMessage ( playerid, -1, "* Ti-a fost setat un checkpoint pe minimap, du-te la el pentru a-ti gasi vehiculul." );
  234. }
  235. case 3:
  236. {
  237. new const vehicleid = GetPlayerVehicleID ( playerid );
  238. if ( vehicleid != pVeh [ playerid ] [ 1 ] ) return SendClientMessage ( playerid, -1, "* Nu esti in vehiculul cu slot 2." );
  239.  
  240. GetVehiclePos ( vehicleid, vInfo [ vehicleid ] [ vPos ] [ 0 ], vInfo [ vehicleid ] [ vPos ] [ 1 ], vInfo [ vehicleid ] [ vPos ] [ 2 ] );
  241. GetVehicleZAngle ( vehicleid, vInfo [ vehicleid ] [ vPos ] [ 3 ] );
  242. SaveVehicle ( vehicleid, TYPE_STATS );
  243.  
  244. SendClientMessage ( playerid, -1, "* Aici iti vei gasi vehiculul personal." );
  245. }
  246. }
  247. return 1;
  248. }
  249. return 0;
  250. }
  251.  
  252. la ondialog response este pana la DIALOG_MOD12... nu mai are rost cred sa tot incarc scriptul
Add Comment
Please, Sign In to add comment