Advertisement
Guest User

Dealership

a guest
Dec 9th, 2014
1,170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.21 KB | None | 0 0
  1. // dealership undeva la inceputul Gamemodu-lui!!!!!!!
  2. ////Totul este facut de mine dupa tutorial-ul lui Maurice!!!!!!!
  3. /* ________________________________
  4. __,__ ( )
  5. .--. .-" "-. .--. ( Script By Ricardo
  6.  
  7. / .. \/ .-. .-. \/ .. \ (
  8. | | '| / Y \ |' | | / (
  9. | \ \ \ 0 | 0 / / / | / (______________________________)
  10. \ '- ,\.-"`` ``"-./, -' / /
  11. `'-' /_ ^ ^ _\ '-'` /
  12. .--'| \._ _ _./ |'--.
  13. /` \ \.-. / / `\
  14. / '._/ |-' _.' \ /
  15. / ; /--~' | \ / v1.0
  16. / .'\|.-\--. \ \ \ --------------
  17. / .'-. /.-.;\ |\|'~'-.|\ \ \
  18. \ `-./`|_\_/ ` `\'. \
  19. '. ; ___) '.`; /
  20. '-.,_ ; ___) \/
  21. \ ``'------'\ \ ` /
  22. '. \ '. | ;/_
  23. ___> '. \_ _ _/ , '--.
  24. .' '. .-~~~~~-. / |--'`~~-. \
  25. // / .---'/ .-~~-._/ / / /---..__.' /
  26. ((_(_/ / / (_(_(_(---.__ .'
  27. | | _ `~~`
  28. | | \'.
  29. \ '....' |
  30. '.,___.' */
  31. new masinii;
  32. new Text:DsPrice;
  33. new Text:DsModel;
  34. new Text:DsInapoi;
  35. new Text:DsInainte;
  36. new Text:DsTest;
  37. new Text:DsHeli;
  38. new Text:DsBuy;
  39. new Text:DsBoat;
  40. new Text:DsBike;
  41. new Text:DsExit;
  42. new IDDS[MAX_PLAYERS];
  43. new IDMasina[MAX_PLAYERS];
  44. new vehName[][] = { "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier",
  45. "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy",
  46. "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick",
  47. "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster",
  48. "Stunt", "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet", "Clover",
  49. "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune",
  50. "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car", "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix",
  51. "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville", "Tiller", "Utility Trailer" };
  52.  
  53. // dealership
  54. new DSModele[4][3] = {
  55. {1,411,45000000}, // 1 = id 411 id masinii(411 fiind infernus) 45000000-pret-ul
  56. {2,560,10000000},
  57. {3,522,45000000},
  58. {4,541,60000000}
  59. };
  60. // textdraw
  61. ///onplayerdisconect
  62. TextDrawDestroy(DsPrice);
  63. TextDrawDestroy(DsModel);
  64. TextDrawDestroy(DsInapoi);
  65. TextDrawDestroy(DsInainte);
  66. TextDrawDestroy(DsTest);
  67. TextDrawDestroy(DsHeli);
  68. TextDrawDestroy(DsBuy);
  69. TextDrawDestroy(DsBoat);
  70. TextDrawDestroy(DsBike);
  71. TextDrawDestroy(DsExit);
  72.  
  73. // dealership
  74. DsPrice = TextDrawCreate(478.399993, 276.266662, "Price:999,999,999$");
  75. TextDrawLetterSize(DsPrice, 0.449999, 1.600000);
  76. TextDrawAlignment(DsPrice, 1);
  77. TextDrawColor(DsPrice, -1);
  78. TextDrawSetShadow(DsPrice, 0);
  79. TextDrawSetOutline(DsPrice, 1);
  80. TextDrawBackgroundColor(DsPrice, 51);
  81. TextDrawFont(DsPrice, 1);
  82. TextDrawSetProportional(DsPrice, 1);
  83.  
  84. DsModel = TextDrawCreate(477.599975, 259.839965, "Model:Infernusss");
  85. TextDrawLetterSize(DsModel, 0.449999, 1.600000);
  86. TextDrawAlignment(DsModel, 1);
  87. TextDrawColor(DsModel, -1);
  88. TextDrawSetShadow(DsModel, 0);
  89. TextDrawSetOutline(DsModel, 1);
  90. TextDrawBackgroundColor(DsModel, 51);
  91. TextDrawFont(DsModel, 1);
  92. TextDrawSetProportional(DsModel, 1);
  93.  
  94. DsInainte = TextDrawCreate(583.999511, 340.479461, "Next");
  95. TextDrawLetterSize(DsInainte, 0.639599, 2.421329);
  96. TextDrawAlignment(DsInainte, 1);
  97. TextDrawColor(DsInainte, -1);
  98. TextDrawSetShadow(DsInainte, 0);
  99. TextDrawSetOutline(DsInainte, 1);
  100. TextDrawBackgroundColor(DsInainte, 51);
  101. TextDrawFont(DsInainte, 1);
  102. TextDrawSetProportional(DsInainte, 1);
  103. TextDrawSetSelectable(DsInainte, 1);
  104.  
  105.  
  106. DsTest = TextDrawCreate(5.599947, 371.840118, "Test");
  107. TextDrawLetterSize(DsTest, 0.716399, 2.174932);
  108. TextDrawAlignment(DsTest, 1);
  109. TextDrawColor(DsTest, -1);
  110. TextDrawSetShadow(DsTest, 0);
  111. TextDrawSetOutline(DsTest, 1);
  112. TextDrawBackgroundColor(DsTest, 51);
  113. TextDrawFont(DsTest, 1);
  114. TextDrawSetProportional(DsTest, 1);
  115. TextDrawSetSelectable(DsTest, 1);
  116.  
  117. DsInapoi = TextDrawCreate(3.999969, 341.226470, "Back");
  118. TextDrawLetterSize(DsInapoi, 0.702000, 2.271996);
  119. TextDrawAlignment(DsInapoi, 1);
  120. TextDrawColor(DsInapoi, -1);
  121. TextDrawSetShadow(DsInapoi, 0);
  122. TextDrawSetOutline(DsInapoi, 1);
  123. TextDrawBackgroundColor(DsInapoi, 51);
  124. TextDrawFont(DsInapoi, 1);
  125. TextDrawSetProportional(DsInapoi, 1);
  126. TextDrawSetSelectable(DsInapoi, 1);
  127.  
  128. DsBuy = TextDrawCreate(283.999725, 338.239715, "Buy");
  129. TextDrawLetterSize(DsBuy, 1.031599, 3.182931);
  130. TextDrawAlignment(DsBuy, 1);
  131. TextDrawColor(DsBuy, -1);
  132. TextDrawSetShadow(DsBuy, 0);
  133. TextDrawSetOutline(DsBuy, 1);
  134. TextDrawBackgroundColor(DsBuy, 51);
  135. TextDrawFont(DsBuy, 1);
  136. TextDrawSetProportional(DsBuy, 1);
  137. TextDrawSetSelectable(DsBuy, 1);
  138.  
  139. DsExit = TextDrawCreate(586.399902, 377.812957, "Exit");
  140. TextDrawLetterSize(DsExit, 0.689997, 2.458666);
  141. TextDrawAlignment(DsExit, 1);
  142. TextDrawColor(DsExit, -1);
  143. TextDrawSetShadow(DsExit, 0);
  144. TextDrawSetOutline(DsExit, 1);
  145. TextDrawBackgroundColor(DsExit, 51);
  146. TextDrawFont(DsExit, 1);
  147. TextDrawSetProportional(DsExit, 1);
  148. TextDrawSetSelectable(DsExit, 1);
  149.  
  150. DsHeli = TextDrawCreate(4.800015, 253.120101, "Heli");
  151. TextDrawLetterSize(DsHeli, 0.449999, 1.600000);
  152. TextDrawAlignment(DsHeli, 1);
  153. TextDrawColor(DsHeli, -1);
  154. TextDrawSetShadow(DsHeli, 0);
  155. TextDrawSetOutline(DsHeli, 1);
  156. TextDrawBackgroundColor(DsHeli, 51);
  157. TextDrawFont(DsHeli, 1);
  158. TextDrawSetProportional(DsHeli, 1);
  159.  
  160.  
  161.  
  162. DsBoat = TextDrawCreate(5.600035, 271.039855, "Boat");
  163. TextDrawLetterSize(DsBoat, 0.449999, 1.600000);
  164. TextDrawAlignment(DsBoat, 1);
  165. TextDrawColor(DsBoat, -1);
  166. TextDrawSetShadow(DsBoat, 0);
  167. TextDrawSetOutline(DsBoat, 1);
  168. TextDrawBackgroundColor(DsBoat, 51);
  169. TextDrawFont(DsBoat, 1);
  170. TextDrawSetProportional(DsBoat, 1);
  171.  
  172. DsBike = TextDrawCreate(4.799994, 289.706665, "Bike");
  173. TextDrawLetterSize(DsBike, 0.449999, 1.600000);
  174. TextDrawAlignment(DsBike, 1);
  175. TextDrawColor(DsBike, -1);
  176. TextDrawSetShadow(DsBike, 0);
  177. TextDrawSetOutline(DsBike, 1);
  178. TextDrawBackgroundColor(DsBike, 51);
  179. TextDrawFont(DsBike, 1);
  180. TextDrawSetProportional(DsBike, 1);
  181.  
  182.  
  183. Create3DTextLabel("DealerShip\nType /buyvehicle pentru a cumpara o masina",0xFFFFFFFF,328.2337,-1512.6307,36.0325,20.0, 0, 1);
  184.  
  185. forward TimpScurs(playerid);
  186. public TimpScurs(playerid)
  187. {
  188. DestroyVehicle(IDMasina[playerid]);
  189. SetPlayerPos(playerid,332.0504,-1519.2844,35.8672);
  190. return 1;
  191. }
  192. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  193. {
  194. new string[126];
  195. if(clickedid == DsInapoi)
  196. {
  197. if(IDDS[playerid] == 0) IDDS[playerid] = 4;
  198. IDDS[playerid] -=1;
  199. DestroyVehicle(IDMasina[playerid]);
  200. IDMasina[playerid] = CreateVehicle(DSModele[IDDS[playerid]][1],-1659.9817,1213.8199,6.9751,300.4067,3,3,-1);
  201. SetVehicleVirtualWorld(IDMasina[playerid],playerid+1);
  202. // nume dealership
  203. format(string,sizeof(string),"Model: %s",vehName[DSModele[IDDS[playerid]][1]-400]);
  204. TextDrawSetString(DsModel,string);
  205. TextDrawShowForPlayer(playerid,DsModel);
  206. // pret
  207. format(string,sizeof(string),"Price: %d",DSModele[IDDS[playerid]][2]);
  208. TextDrawSetString(DsPrice,string);
  209. TextDrawShowForPlayer(playerid,DsPrice);
  210. }
  211. if(clickedid == DsInainte)
  212. {
  213. if(IDDS[playerid] == 3) IDDS[playerid] = -1;
  214. IDDS[playerid] +=1;
  215. DestroyVehicle(IDMasina[playerid]);
  216. IDMasina[playerid] = CreateVehicle(DSModele[IDDS[playerid]][1],-1659.9817,1213.8199,6.9751,300.4067,3,3,-1);
  217. SetVehicleVirtualWorld(IDMasina[playerid],playerid+1);
  218. // nume dealership
  219. format(string,sizeof(string),"Model: %s",vehName[DSModele[IDDS[playerid]][1]-400]);
  220. TextDrawSetString(DsModel,string);
  221. TextDrawShowForPlayer(playerid,DsModel);
  222. // pret
  223. format(string,sizeof(string),"Price: %d",DSModele[IDDS[playerid]][2]);
  224. TextDrawSetString(DsPrice,string);
  225. TextDrawShowForPlayer(playerid,DsPrice);
  226. }
  227. if(clickedid == DsExit)
  228. {
  229. SetPlayerPos(playerid,332.0504,-1519.2844,35.8672);
  230. DestroyVehicle(IDMasina[playerid]);
  231. SetPlayerVirtualWorld(playerid, 0);
  232. TogglePlayerControllable(playerid, 1);
  233. SetCameraBehindPlayer(playerid);
  234. TextDrawHideForPlayer(playerid,DsInapoi);
  235. TextDrawHideForPlayer(playerid,DsInainte);
  236. TextDrawHideForPlayer(playerid,DsTest);
  237. TextDrawHideForPlayer(playerid,DsHeli);
  238. TextDrawHideForPlayer(playerid,DsBuy);
  239. TextDrawHideForPlayer(playerid,DsBoat);
  240. TextDrawHideForPlayer(playerid,DsBike);
  241. TextDrawHideForPlayer(playerid,DsExit);
  242. TextDrawHideForPlayer(playerid,DsModel);
  243. TextDrawHideForPlayer(playerid,DsPrice);
  244. CancelSelectTextDraw(playerid);
  245. }
  246. if(clickedid == DsTest)
  247. {
  248. PutPlayerInVehicle(playerid,IDMasina[playerid],0);
  249. SetTimerEx("TimpScurs",30 * 1000,0,"d",playerid);
  250. SetVehicleVirtualWorld(IDMasina[playerid],0);
  251. SetPlayerVirtualWorld(playerid, 0);
  252. TogglePlayerControllable(playerid, 1);
  253. SetCameraBehindPlayer(playerid);
  254. TextDrawHideForPlayer(playerid,DsInapoi);
  255. TextDrawHideForPlayer(playerid,DsInainte);
  256. TextDrawHideForPlayer(playerid,DsTest);
  257. TextDrawHideForPlayer(playerid,DsHeli);
  258. TextDrawHideForPlayer(playerid,DsBuy);
  259. TextDrawHideForPlayer(playerid,DsBoat);
  260. TextDrawHideForPlayer(playerid,DsBike);
  261. TextDrawHideForPlayer(playerid,DsExit);
  262. TextDrawHideForPlayer(playerid,DsModel);
  263. TextDrawHideForPlayer(playerid,DsPrice);
  264. CancelSelectTextDraw(playerid);
  265. }
  266. if(clickedid == DsBuy)
  267. {
  268. SetPlayerPos(playerid,332.0504,-1519.2844,35.8672);
  269. InsertCar(playerid);
  270. GivePlayerCash(playerid, -DSModele[IDDS[playerid]][2]);
  271. DestroyVehicle(IDMasina[playerid]);
  272. SetPlayerVirtualWorld(playerid, 0);
  273. TogglePlayerControllable(playerid, 1);
  274. SetCameraBehindPlayer(playerid);
  275. TextDrawHideForPlayer(playerid,DsInapoi);
  276. TextDrawHideForPlayer(playerid,DsInainte);
  277. TextDrawHideForPlayer(playerid,DsTest);
  278. TextDrawHideForPlayer(playerid,DsHeli);
  279. TextDrawHideForPlayer(playerid,DsBuy);
  280. TextDrawHideForPlayer(playerid,DsBoat);
  281. TextDrawHideForPlayer(playerid,DsBike);
  282. TextDrawHideForPlayer(playerid,DsExit);
  283. TextDrawHideForPlayer(playerid,DsModel);
  284. TextDrawHideForPlayer(playerid,DsPrice);
  285. CancelSelectTextDraw(playerid);
  286. format(string,sizeof(string),"Ai cumparat un %s pentru %d.",vehName[DSModele[IDDS[playerid]][1]-400],DSModele[IDDS[playerid]][2]);
  287. SendClientMessage(playerid,COLOR_WHITE,string);
  288. }
  289. return 1;
  290. }
  291. CMD:buyvehicle(playerid, params[])
  292. {
  293. new string[128];
  294. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai.");
  295. if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_WHITE,"{FFB870}Please get out of the car.");
  296. if(IsPlayerInRangeOfPoint(playerid, 7.0, 328.2337,-1512.6307,36.0325))
  297. {
  298. if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You need to be level 3 to buy a vehicle.");
  299. }
  300. else return SCM(playerid,COLOR_WHITE,"{FFB870}You are not the place where you can buy a car.");
  301. SetPlayerPos(playerid,-1558.0000,1153.1772,1.5000);
  302. TogglePlayerControllable(playerid, 0);
  303. SelectTextDraw(playerid,0x15EABFC8FF);
  304. TextDrawShowForPlayer(playerid,DsInapoi);
  305. TextDrawShowForPlayer(playerid,DsInainte);
  306. TextDrawShowForPlayer(playerid,DsTest);
  307. TextDrawShowForPlayer(playerid,DsHeli);
  308. TextDrawShowForPlayer(playerid,DsBuy);
  309. TextDrawShowForPlayer(playerid,DsBoat);
  310. TextDrawShowForPlayer(playerid,DsBike);
  311. TextDrawShowForPlayer(playerid,DsExit);
  312. TextDrawShowForPlayer(playerid,DsModel);
  313. TextDrawShowForPlayer(playerid,DsPrice);
  314. SetPlayerCameraPos(playerid,-1650.8524,1210.4797,9.4186);
  315. SetPlayerCameraLookAt(playerid,-1660.0663,1213.8904,8.5841);
  316. SetPlayerVirtualWorld(playerid,playerid+1);
  317. IDDS[playerid] = 0;
  318. IDMasina[playerid] = CreateVehicle(DSModele[IDDS[playerid]][1],-1659.9817,1213.8199,6.9751,300.4067,3,3,-1);
  319. SetVehicleVirtualWorld(IDMasina[playerid],playerid+1);
  320. // nume dealership
  321. format(string,sizeof(string),"Model: %s",vehName[DSModele[IDDS[playerid]][1]-400]);
  322. TextDrawSetString(DsModel,string);
  323. TextDrawShowForPlayer(playerid,DsModel);
  324. // pret
  325. format(string,sizeof(string),"Price: %d",DSModele[IDDS[playerid]][2]);
  326. TextDrawSetString(DsPrice,string);
  327. TextDrawShowForPlayer(playerid,DsPrice);
  328. return 1;
  329. }
  330.  
  331. forward LoadCar();
  332. LoadCar();
  333. public LoadCar()
  334. {
  335. new vehs =0;
  336. mysql_query(SQL,"SELECT MAX(ID) FROM cars");
  337. mysql_store_result();
  338. masinii = mysql_fetch_int();
  339. for(new idx = 1; idx <= masinii; idx++)
  340. {
  341. new query[256];
  342. format(SQL,query,sizeof(SQL,query),SQL,"SELECT * FROM cars WHERE ID = %d",idx);
  343. mysql_query(SQL,query);
  344. mysql_store_result();
  345. if mysql_num_rows()
  346. {
  347. if (CarInfo[idx][cID] =2;
  348. }
  349. else
  350. {
  351. if(mysql_fetch_field_row_format(SQL,query,"|"))
  352. {
  353. sscanf(SQL,query,"p<|>e< iiffffiis[25]is[14]iiiiiiiiiiiiiiiiiiiii>",CarInfo[idx]);
  354. vehs++:
  355. }
  356. }
  357. }
  358. mysql_free_result();
  359. printf("-Cars: %d,vehs");
  360.  
  361. return 1;
  362. }
  363.  
  364. enum cInfo
  365. {
  366. cID,
  367. cModel,
  368. Float:cLocationx,
  369. Float:cLocationy,
  370. Float:cLocationz,
  371. Float:cAngle,
  372. cColorOne,
  373. cColorTwo,
  374. cOwner[MAX_PLAYER_NAME],
  375. cValue,
  376. cLicense[14],
  377. cAlarm,
  378. cLock,
  379. mod0,
  380. mod1,
  381. mod2,
  382. mod3,
  383. mod4,
  384. mod5,
  385. mod6,
  386. mod7,
  387. mod8,
  388. mod9,
  389. mod10,
  390. mod11,
  391. mod12,
  392. mod13,
  393. paintjob,
  394. KM,
  395. Userid,
  396. Spawned,
  397. };
  398.  
  399.  
  400. stock GasesteID()
  401. {
  402. new i;
  403. for(i = 1; i <= masinii; i++)
  404. {
  405. if (CarInfo[i][cID] == -2)
  406. {
  407. return i;
  408. }
  409. }
  410. return 0;
  411. }
  412. public InsertCar(playerid)
  413. {
  414. new string[128],sendername[25];
  415. new idd = GasesteID();
  416. GetPlayerName(playerid,sendername,sizeof(sendername));
  417. if(idd != 0)
  418. {
  419. PlayerInfo[playerid][pPcarkey] = idd;
  420. format(string, sizeof(string), "UPDATE users SET Car='%d' WHERE Name='%s'", PlayerInfo[playerid][pPcarkey], sendername);
  421. mysql_query(SQL,string);
  422. CarInfo[idd][cID] = idd;
  423. CarInfo[idd][cModel] = DSModele[IDDS[playerid]][1];
  424. CarInfo[idd][cLocationx] = -1631.0164; CarInfo[idd][cLocationy] = 1289.4585; CarInfo[idd][cLocationz] = 6.7459;
  425. CarInfo[idd][cAngle] = 133.8292;
  426. CarInfo[idd][cColorOne] = 1; CarInfo[idd][cColorOne] = 1;
  427. strmid(CarInfo[idd][cOwner], sendername, 0, strlen(sendername), 255);
  428. CarInfo[idd][cValue] = DSModele[IDDS[playerid]][2];
  429. strmid(CarInfo[idd][cLicense], "NewCar", 0, 6, 255);
  430. CarInfo[idd][cAlarm] = 0; CarInfo[idd][cLock] = 0;
  431. CarInfo[idd][mod0] = 0; CarInfo[idd][mod1] = 0; CarInfo[idd][mod2] = 0; CarInfo[idd][mod3] = 0;
  432. CarInfo[idd][mod4] = 0; CarInfo[idd][mod5] = 0; CarInfo[idd][mod6] = 0; CarInfo[idd][mod7] = 0;
  433. CarInfo[idd][mod8] = 0; CarInfo[idd][mod9] = 0; CarInfo[idd][mod10] = 0; CarInfo[idd][mod11] = 0;
  434. CarInfo[idd][mod12] = 0; CarInfo[idd][mod13] = 0; CarInfo[idd][paintjob] = 0; CarInfo[idd][KM] = 0;
  435. format(string, sizeof(string),"INSERT INTO cars (ID, Model) VALUES (%d, %d)", idd, CarInfo[idd][cModel]);
  436. mysql_query(SQL,string);
  437. format(string, sizeof(string), "UPDATE cars SET Locationx='%f' WHERE ID=%d", CarInfo[idd][cLocationx], idd);
  438. mysql_query(SQL,string);
  439. format(string, sizeof(string), "UPDATE cars SET Locationy='%f' WHERE ID=%d", CarInfo[idd][cLocationy], idd);
  440. mysql_query(SQL,string);
  441. format(string, sizeof(string), "UPDATE cars SET Locationz='%f' WHERE ID=%d", CarInfo[idd][cLocationz], idd);
  442. mysql_query(SQL,string);
  443. format(string, sizeof(string), "UPDATE cars SET Angle='%f' WHERE ID=%d", CarInfo[idd][cAngle], idd);
  444. mysql_query(SQL,string);
  445. format(string, sizeof(string), "UPDATE cars SET ColorOne='%d' WHERE ID=%d", CarInfo[idd][cColorOne], idd);
  446. mysql_query(SQL,string);
  447. format(string, sizeof(string), "UPDATE cars SET ColorTwo='%d' WHERE ID=%d", CarInfo[idd][cColorTwo], idd);
  448. mysql_query(SQL,string);
  449. format(string, sizeof(string), "UPDATE cars SET Owner='%s' WHERE ID=%d", CarInfo[idd][cOwner], idd);
  450. mysql_query(SQL,string);
  451. format(string, sizeof(string), "UPDATE cars SET Value='%d' WHERE ID=%d", CarInfo[idd][cValue], idd);
  452. mysql_query(SQL,string);
  453. format(string, sizeof(string), "UPDATE cars SET License='%s' WHERE ID=%d", CarInfo[idd][cLicense], idd);
  454. mysql_query(SQL,string);
  455. format(string, sizeof(string), "UPDATE cars SET Alarm='%d' WHERE ID=%d", CarInfo[idd][cAlarm], idd);
  456. mysql_query(SQL,string);
  457. format(string, sizeof(string), "UPDATE cars SET Lockk='%d' WHERE ID=%d", CarInfo[idd][cLock], idd);
  458. mysql_query(SQL,string);
  459. CarInfo[idd][Spawned] = CreateVehicle(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],1,1,-1);
  460. SetVehicleNumberPlate(idd,CarInfo[idd][cLicense]);
  461. format(string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[idd][Spawned], idd);
  462. mysql_query(SQL,string);
  463. }
  464. if(idd == 0)
  465. {
  466. masinii += 1;
  467. idd = masinii;
  468. PlayerInfo[playerid][pPcarkey] = idd;
  469. format(string, sizeof(string), "UPDATE users SET Car='%d' WHERE Name='%s'", PlayerInfo[playerid][pPcarkey], sendername);
  470. mysql_query(SQL,string);
  471. CarInfo[idd][cID] = idd;
  472. CarInfo[idd][cModel] = DSModele[IDDS[playerid]][1];
  473. CarInfo[idd][cLocationx] = -1631.0164; CarInfo[idd][cLocationy] = 1289.4585; CarInfo[idd][cLocationz] = 6.7459;
  474. CarInfo[idd][cAngle] = 133.8292;
  475. CarInfo[idd][cColorOne] = 1; CarInfo[idd][cColorOne] = 1;
  476. strmid(CarInfo[idd][cOwner], sendername, 0, strlen(sendername), 255);
  477. CarInfo[idd][cValue] = DSModele[IDDS[playerid]][2];
  478. strmid(CarInfo[idd][cLicense], "NewCar", 0, 6, 255);
  479. CarInfo[idd][cAlarm] = 0; CarInfo[idd][cLock] = 0;
  480. CarInfo[idd][mod0] = 0; CarInfo[idd][mod1] = 0; CarInfo[idd][mod2] = 0; CarInfo[idd][mod3] = 0;
  481. CarInfo[idd][mod4] = 0; CarInfo[idd][mod5] = 0; CarInfo[idd][mod6] = 0; CarInfo[idd][mod7] = 0;
  482. CarInfo[idd][mod8] = 0; CarInfo[idd][mod9] = 0; CarInfo[idd][mod10] = 0; CarInfo[idd][mod11] = 0;
  483. CarInfo[idd][mod12] = 0; CarInfo[idd][mod13] = 0; CarInfo[idd][paintjob] = 0; CarInfo[idd][KM] = 0;
  484. format(string, sizeof(string),"INSERT INTO cars (ID, Model) VALUES (%d, %d)", idd, CarInfo[idd][cModel]);
  485. mysql_query(SQL,string);
  486. format(string, sizeof(string), "UPDATE cars SET Locationx='%f' WHERE ID=%d", CarInfo[idd][cLocationx], idd);
  487. mysql_query(SQL,string);
  488. format(string, sizeof(string), "UPDATE cars SET Locationy='%f' WHERE ID=%d", CarInfo[idd][cLocationy], idd);
  489. mysql_query(SQL,string);
  490. format(string, sizeof(string), "UPDATE cars SET Locationz='%f' WHERE ID=%d", CarInfo[idd][cLocationz], idd);
  491. mysql_query(SQL,string);
  492. format(string, sizeof(string), "UPDATE cars SET Angle='%f' WHERE ID=%d", CarInfo[idd][cAngle], idd);
  493. mysql_query(SQL,string);
  494. format(string, sizeof(string), "UPDATE cars SET ColorOne='%d' WHERE ID=%d", CarInfo[idd][cColorOne], idd);
  495. mysql_query(SQL,string);
  496. format(string, sizeof(string), "UPDATE cars SET ColorTwo='%d' WHERE ID=%d", CarInfo[idd][cColorTwo], idd);
  497. mysql_query(SQL,string);
  498. format(string, sizeof(string), "UPDATE cars SET Owner='%s' WHERE ID=%d", CarInfo[idd][cOwner], idd);
  499. mysql_query(SQL,string);
  500. format(string, sizeof(string), "UPDATE cars SET Value='%d' WHERE ID=%d", CarInfo[idd][cValue], idd);
  501. mysql_query(SQL,string);
  502. format(string, sizeof(string), "UPDATE cars SET License='%s' WHERE ID=%d", CarInfo[idd][cLicense], idd);
  503. mysql_query(SQL,string);
  504. format(string, sizeof(string), "UPDATE cars SET Alarm='%d' WHERE ID=%d", CarInfo[idd][cAlarm], idd);
  505. mysql_query(SQL,string);
  506. format(string, sizeof(string), "UPDATE cars SET Lockk='%d' WHERE ID=%d", CarInfo[idd][cLock], idd);
  507. mysql_query(SQL,string);
  508. CarInfo[idd][Spawned] = CreateVehicle(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],1,1,-1);
  509. SetVehicleNumberPlate(idd,CarInfo[idd][cLicense]);
  510. format(string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[idd][Spawned], idd);
  511. mysql_query(SQL,string);
  512. }
  513. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement