Guest User

Untitled

a guest
Jun 25th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.31 KB | None | 0 0
  1. //===========================Section: Includes==================================
  2. #include <a_samp>
  3. //===========================Section: Definations===============================
  4. #define COLOR_GRAD1 0xB4B5B7FF
  5. #define COLOR_GRAD2 0xBFC0C2FF
  6. #define COLOR_GRAD3 0xCBCCCEFF
  7. #define COLOR_GRAD4 0xD8D8D8FF
  8. #define COLOR_GRAD5 0xE3E3E3FF
  9. #define COLOR_GRAD6 0xF0F0F0FF
  10. #define COLOR_GREEN 0x33AA33AA
  11. #define COLOR_GREY 0xAFAFAFAA
  12. #define COLOR_WHITE 0xFFFFFFAA
  13. #define COLOR_YELLOW 0xFFFF00AA
  14. #define COLOR_YELLOW2 0xF5DEB3AA
  15. #define COLOR_BLUE 0x2641FEAA
  16. //===========================Section: Forwards==================================
  17. forward split(const strsrc[], strdest[][], delimiter);
  18. forward LoadCar();
  19. forward CheckOwner(playerid);
  20. forward SaveCars();
  21. forward testfahrt(playerid);
  22. forward setz(playerid);
  23. //===========================Section: Variables=================================
  24. new mission[MAX_PLAYERS];
  25. enum pInfo
  26. {
  27. pCarKey,
  28. }
  29. new Menu:examplemenu;
  30. new PlayerInfo[256][pInfo];
  31. enum cInfo
  32. {
  33. cModel,
  34. Float:cLocationx,
  35. Float:cLocationy,
  36. Float:cLocationz,
  37. Float:cAngle,
  38. cColorOne,
  39. cColorTwo,
  40. cOwner[MAX_PLAYER_NAME],
  41. cDescription[MAX_PLAYER_NAME],
  42. cValue,
  43. cLicense,
  44. cRegistration,
  45. cOwned,
  46. cLock,
  47. ownedvehicle,
  48. };
  49. new CarInfo[84][cInfo];
  50. new currentveh;
  51. new CarAutolock[999]; // Variable for Autolocking Car Doors
  52. new cartrack[256];
  53. new CarOffered[256];
  54. //===========================Section: strtok & split============================
  55. strtok(const string[], &index)
  56. {
  57. new length = strlen(string);
  58. while ((index < length) && (string[index] <= ' '))
  59. {
  60. index++;
  61. }
  62.  
  63. new offset = index;
  64. new result[20];
  65. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  66. {
  67. result[index - offset] = string[index];
  68. index++;
  69. }
  70. result[index - offset] = EOS;
  71. return result;
  72. }
  73.  
  74. public split(const strsrc[], strdest[][], delimiter)
  75. {
  76. new i, li;
  77. new aNum;
  78. new len;
  79. while(i <= strlen(strsrc)){
  80. if(strsrc[i]==delimiter || i==strlen(strsrc)){
  81. len = strmid(strdest[aNum], strsrc, li, i, 128);
  82. strdest[aNum][len] = 0;
  83. li = i+1;
  84. aNum++;
  85. }
  86. i++;
  87. }
  88. return 1;
  89. }
  90. //===========================Section: Callbacks & Functions=====================
  91. public OnFilterScriptInit()
  92. {
  93. printf("Filterscript [FS]CarOwnership.amx Initiated\n");
  94. LoadCar();
  95. for(new i = 1; i < sizeof(CarInfo); i++)
  96. {
  97. CarInfo[i][ownedvehicle] = CreateVehicle(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz],CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],300000);
  98. }
  99. SetTimer("SaveCars",60000,1);
  100. SetTimer("CheckOwner",5000,1);
  101. return 1;
  102. }
  103. public OnVehicleSpawn(vehicleid)
  104. {
  105. for(new i = 1; i < sizeof(CarInfo); i++)
  106. {
  107. ChangeVehicleColor(CarInfo[i][ownedvehicle],CarInfo[vehicleid][cColorOne],CarInfo[vehicleid][cColorTwo]);
  108. }
  109. return 1;
  110. }
  111. public CheckOwner(playerid)
  112. {
  113. if(IsPlayerConnected(playerid))
  114. {
  115. for(new i = 1; i < sizeof(CarInfo); i++)
  116. {
  117. new playername[MAX_PLAYER_NAME];
  118. GetPlayerName(playerid,playername,sizeof(playername));
  119. if(strcmp(playername,CarInfo[i][cOwner],true)==0)
  120. {
  121. PlayerInfo[playerid][pCarKey] = i;
  122. return i;
  123. }
  124. }
  125. }
  126. return 1;
  127. }
  128. public OnPlayerConnect(playerid)
  129. {
  130. PlayerInfo[playerid][pCarKey] = 0;
  131. CheckOwner(playerid);
  132. return 1;
  133. }
  134. public OnPlayerCommandText(playerid, cmdtext[])
  135. {
  136. new idx;
  137. new string[256];
  138. new cmd[256];
  139. new tmp[256];
  140. new sendername[MAX_PLAYER_NAME];
  141. cmd = strtok(cmdtext, idx);
  142. if(strcmp(cmd,"/car",true)==0)
  143. {
  144. new playername[MAX_PLAYER_NAME];
  145. GetPlayerName(playerid,playername,sizeof(playername));
  146. tmp = strtok(cmdtext, idx);
  147. if(!strlen(tmp))
  148. {
  149. SendClientMessage(playerid,COLOR_WHITE,"(( Koristi /car manual za pomoc ))");
  150. return 1;
  151. }
  152. if(strcmp(tmp,"exit",true)==0)
  153. {
  154. CarOffered[playerid]=0;
  155. RemovePlayerFromVehicle(playerid);
  156. TogglePlayerControllable(playerid, 1);
  157. return 1;
  158. }
  159. if(strcmp(tmp, "manual", true) == 0)
  160. {
  161. if(IsPlayerConnected(playerid))
  162. {
  163. if(PlayerInfo[playerid][pCarKey]!=0)
  164. {
  165. format(string,sizeof(string),"________________%s________________",CarInfo[CheckOwner(playerid)][cDescription]);
  166. SendClientMessage(playerid, COLOR_GREEN,string);
  167. SendClientMessage(playerid, COLOR_GRAD2,"** /car sell - Prodajete auto");
  168. SendClientMessage(playerid, COLOR_GRAD2,"** /car manual - pokazuje ovu listu");
  169. SendClientMessage(playerid, COLOR_GRAD2,"** /car exit - Izlazi iz auta");
  170. SendClientMessage(playerid, COLOR_GRAD2,"** /car locate - Lokacija auta");
  171. SendClientMessage(playerid, COLOR_GRAD2,"** /car lock - zakljucavate auto");
  172. SendClientMessage(playerid, COLOR_GRAD2,"** /car unlock - otkljucavate auto");
  173. SendClientMessage(playerid, COLOR_GRAD2,"** /car autolock - Zakljucava auto automatski kada izadjete iz njega");
  174. SendClientMessage(playerid, COLOR_GRAD2,"** /car park - Parkira auto na ovu poziciju");
  175. return 1;
  176. }
  177. else
  178. {
  179. SendClientMessage(playerid,COLOR_GRAD2,"** Ne posjedujes auto! **");
  180. return 1;
  181. }
  182. }
  183. return 1;
  184. }
  185. if(strcmp(tmp, "park", true) == 0)
  186. {
  187. if(PlayerInfo[playerid][pCarKey] == 0)
  188. {
  189. SendClientMessage(playerid, COLOR_GREY, "Ne posjedujes auto.");
  190. return 1;
  191. }
  192. new keycar = PlayerInfo[playerid][pCarKey];
  193. new Float:z_rot;
  194. new currentveh2;
  195. currentveh2 = GetPlayerVehicleID(playerid);
  196. GetVehicleZAngle(currentveh2, z_rot);
  197. new Float:vehx, Float:vehy, Float:vehz;
  198. GetVehiclePos(currentveh2, vehx, vehy, vehz);
  199. if(currentveh2 == CarInfo[keycar][ownedvehicle])
  200. {
  201. CarInfo[keycar][cLocationx] = vehx;
  202. CarInfo[keycar][cLocationy] = vehy;
  203. CarInfo[keycar][cLocationz] = vehz;
  204. CarInfo[keycar][cAngle]= z_rot;
  205. SendClientMessage(playerid,COLOR_GRAD1,"Auto parkirano");
  206. }
  207. else
  208. {
  209. SendClientMessage(playerid,COLOR_GRAD1,"Ne sjedis u svom autu");
  210. }
  211. return 1;
  212. }
  213. if(strcmp(tmp, "sell", true) == 0)
  214. {
  215. if(IsPlayerConnected(playerid))
  216. {
  217. GetPlayerName(playerid, playername, sizeof(playername));
  218. if(PlayerInfo[playerid][pCarKey] == 0)
  219. {
  220. SendClientMessage(playerid, COLOR_GREY, "Ne posjedujes auto.");
  221. return 1;
  222. }
  223. if(PlayerInfo[playerid][pCarKey] != 0 && strcmp(playername, CarInfo[PlayerInfo[playerid][pCarKey]][cOwner], true) == 0)
  224. {
  225. new car = PlayerInfo[playerid][pCarKey];
  226. CarInfo[car][cOwned] = 0;
  227. GetPlayerName(playerid, sendername, sizeof(sendername));
  228. strmid(CarInfo[car][cOwner], "Dealership", 0, strlen("Dealership"), 999);
  229. GivePlayerMoney(playerid,CarInfo[car][cValue]);
  230. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  231. format(string, sizeof(string), "~w~Prodao si svoje auto za ~n~~g~$%d ~w~", CarInfo[car][cValue]);
  232. GameTextForPlayer(playerid, string, 10000, 3);
  233. RemovePlayerFromVehicle(playerid);
  234. TogglePlayerControllable(playerid, 1);
  235. PlayerInfo[playerid][pCarKey] = 999;
  236. return 1;
  237. }
  238. }
  239. return 1;
  240. }
  241. if(strcmp(tmp, "locate", true) == 0)
  242. {
  243. if(!IsPlayerConnected(playerid)) { return 1; }
  244. if(PlayerInfo[playerid][pCarKey] == 0) { GameTextForPlayer(playerid, "~w~Ne posjedujes auto", 2500, 3); return 1; }
  245. if(cartrack[playerid]==0)
  246. {
  247. SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star's automated vehicle tracking system");
  248. SendClientMessage(playerid,COLOR_WHITE,"On-Star: Please enter your PIN # and password now");
  249. SendClientMessage(playerid,COLOR_WHITE,"On-Star: Your vehicle's location is now uploaded to your phone");
  250. SetPlayerCheckpoint(playerid,CarInfo[PlayerInfo[playerid][pCarKey]][cLocationx], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationy], CarInfo[PlayerInfo[playerid][pCarKey]][cLocationz], 5.0);
  251. cartrack[playerid] = 1;
  252. return 1;
  253. }
  254. else
  255. {
  256. SendClientMessage(playerid,COLOR_WHITE,"On-Star: This is On-Star's automated vehicle tracking system");
  257. SendClientMessage(playerid,COLOR_WHITE,"On-Star: The tracking on your vehicle has been canceled");
  258. DisablePlayerCheckpoint(playerid);
  259. cartrack[playerid] = 0;
  260. return 1;
  261. }
  262. }
  263. if(strcmp(tmp, "lock", true) == 0)
  264. {
  265. new keycar = PlayerInfo[playerid][pCarKey];
  266. if(IsPlayerConnected(playerid))
  267. {
  268. for(new i = 0; i < MAX_PLAYERS; i++)
  269. {
  270. SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
  271. }
  272. format(string, sizeof(string), "~w~Auto~n~~r~zakljucano");
  273. GameTextForPlayer(playerid, string, 10000, 3);
  274. CarInfo[keycar][cLock] = 1;
  275. return 1;
  276. }
  277. }
  278. if(strcmp(tmp, "unlock", true) == 0)
  279. {
  280. new keycar = PlayerInfo[playerid][pCarKey];
  281. if(IsPlayerConnected(playerid))
  282. {
  283. for(new i = 0; i < MAX_PLAYERS; i++)
  284. {
  285. SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
  286. }
  287. format(string, sizeof(string), "~w~Auto~n~~g~otkljucano");
  288. GameTextForPlayer(playerid, string, 10000, 3);
  289. CarInfo[keycar][cLock] = 0;
  290. return 1;
  291. }
  292. }
  293. if(strcmp(tmp, "autolock", true) == 0)
  294. {
  295. new keycar = PlayerInfo[playerid][pCarKey];
  296. if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 0) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 1; format(string, sizeof(string), "~w~Car Autolock~n~~r~Engaged"); return 1; }
  297. if(CarAutolock[CarInfo[keycar][ownedvehicle]] == 1) { CarAutolock[CarInfo[keycar][ownedvehicle]] = 0; format(string, sizeof(string), "~w~Car Autolock~n~~g~Disengaged"); return 1; }
  298. GameTextForPlayer(playerid, string, 10000, 3);
  299. return 1;
  300. }
  301. }
  302. return 0;
  303. }
  304. /*----------Car Save Functions----------*/
  305. public LoadCar()
  306. {
  307. new arrCoords[13][64];
  308. new strFromFile2[256];
  309. new File: file = fopen("autos.cfg", io_read);
  310. if (file)
  311. {
  312. new idx = 0;
  313. while (idx < sizeof(CarInfo))
  314. {
  315. fread(file, strFromFile2);
  316. split(strFromFile2, arrCoords, ',');
  317. CarInfo[idx][cModel] = strval(arrCoords[0]);
  318. CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
  319. CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
  320. CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
  321. CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
  322. CarInfo[idx][cColorOne] = strval(arrCoords[5]);
  323. CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
  324. strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
  325. strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
  326. CarInfo[idx][cValue] = strval(arrCoords[9]);
  327. CarInfo[idx][cLicense] = strval(arrCoords[10]);
  328. CarInfo[idx][cOwned] = strval(arrCoords[11]);
  329. CarInfo[idx][cLock] = strval(arrCoords[12]);
  330. printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
  331. idx++;
  332. }
  333. }
  334. return 1;
  335. }
  336. public SaveCars()
  337. {
  338. new idx;
  339. new File: file2;
  340. while (idx < sizeof(CarInfo))
  341. {
  342. new coordsstring[256];
  343. format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%s,%d,%d\n",
  344. CarInfo[idx][cModel],
  345. CarInfo[idx][cLocationx],
  346. CarInfo[idx][cLocationy],
  347. CarInfo[idx][cLocationz],
  348. CarInfo[idx][cAngle],
  349. CarInfo[idx][cColorOne],
  350. CarInfo[idx][cColorTwo],
  351. CarInfo[idx][cOwner],
  352. CarInfo[idx][cDescription],
  353. CarInfo[idx][cValue],
  354. CarInfo[idx][cLicense],
  355. CarInfo[idx][cOwned],
  356. CarInfo[idx][cLock]);
  357. if(idx == 0)
  358. {
  359. file2 = fopen("autos.cfg", io_write);
  360. }
  361. else
  362. {
  363. file2 = fopen("autos.cfg", io_append);
  364. }
  365. fwrite(file2, coordsstring);
  366. idx++;
  367. fclose(file2);
  368. }
  369. return 1;
  370. }
  371. public OnVehicleRespray(playerid,vehicleid, color1, color2)
  372. {
  373. for(new i = 0; i < sizeof(CarInfo); i++)
  374. {
  375. if(vehicleid == CarInfo[i][ownedvehicle])
  376. {
  377. CarInfo[i][cColorOne] = color1;
  378. CarInfo[i][cColorTwo] = color2;
  379. printf("CarOwnership report");
  380. printf("** Car %s[%d] painted %d and %d",CarInfo[i][cDescription],i,color1,color2);
  381. }
  382. }
  383. return 1;
  384. }
  385. public OnPlayerExitVehicle(playerid, vehicleid)
  386. {
  387. DestroyMenu(examplemenu);
  388. if(IsPlayerConnected(playerid))
  389. {
  390. for(new i = 0; i < sizeof(CarInfo); i++)
  391. {
  392. if(vehicleid == CarInfo[i][ownedvehicle])
  393. {
  394. DestroyMenu(examplemenu);
  395. /* new Float:x,Float:y,Float:z;
  396. new Float:a;
  397. GetVehiclePos(vehicleid, x, y, z);
  398. GetVehicleZAngle(vehicleid, a);
  399. CarInfo[i][cLocationx] = x;
  400. CarInfo[i][cLocationy] = y;
  401. CarInfo[i][cLocationz] = z;
  402. CarInfo[i][cAngle] = a;*/
  403. }
  404. if(CarAutolock[vehicleid] == 1)
  405. {
  406. for(new j = 0; j < MAX_PLAYERS; i++)
  407. {
  408. if (IsPlayerConnected(j))
  409. {
  410. SetVehicleParamsForPlayer(vehicleid,j,0,1);
  411. GameTextForPlayer(playerid,"~w~Vozilo~n~~r~Auto-zakljucano",2500,3);
  412. return 1;
  413. }
  414. }
  415. }
  416. }
  417. }
  418. if(mission[playerid] == 1)
  419. {
  420. SetTimerEx("setz", 4000, false, "x", playerid);
  421. PutPlayerInVehicle(playerid,currentveh,0);
  422. SendClientMessage(playerid,COLOR_GREY,"U toku tesz voznje nemozete napustiti auto");
  423. return 1;
  424. }
  425. DestroyMenu(examplemenu);
  426. return 1;
  427. }
  428. public OnPlayerStateChange(playerid, newstate, oldstate)
  429. {
  430. new vehicle = GetPlayerVehicleID(playerid);
  431. //new keycar = PlayerInfo[playerid][pCarKey];
  432. new string[256];
  433. if(newstate==2)
  434. {
  435. for(new i = 0; i < sizeof(CarInfo); i++)
  436. {
  437. new newcar = GetPlayerVehicleID(playerid);
  438. if(newcar == CarInfo[i][ownedvehicle])
  439. {
  440. if(CarInfo[i][cOwned]==0)
  441. {
  442. examplemenu = CreateMenu("Auto salon", 5, 200.0, 100.0, 150.0, 150.0);
  443. TogglePlayerControllable(playerid, 0);
  444. CarOffered[playerid]=1;
  445. format(string,sizeof(string),"Model: %s",CarInfo[i][cDescription]);
  446. AddMenuItem(examplemenu, 0, string);
  447. format(string,sizeof(string),"Cijena: %d$",CarInfo[i][cValue]);
  448. AddMenuItem(examplemenu, 0, string);
  449. AddMenuItem(examplemenu, 0, "Kupi");
  450. AddMenuItem(examplemenu, 0, "Izadji");
  451. AddMenuItem(examplemenu, 0, "Test voznja (3min)");
  452. ShowMenuForPlayer(examplemenu, playerid);
  453. }
  454. }
  455. }
  456. }
  457. for(new i = 0; i < sizeof(CarInfo); i++)
  458. {
  459. if(newstate==2)
  460. {
  461. if(CarInfo[vehicle][cOwned]==1)
  462. {
  463. format(string,sizeof(string),"Ovaj auto je registrovan na %s",CarInfo[vehicle][cOwner]);
  464. SendClientMessage(playerid, COLOR_BLUE, string);
  465. return 1;
  466. }
  467. }
  468. }
  469. return 1;
  470. }
  471. public OnPlayerEnterCheckpoint(playerid)
  472. {
  473. if(cartrack[playerid]!=0)
  474. {
  475. SendClientMessage(playerid,COLOR_YELLOW,"SMS: On-Star: Our sensors show that you have come within 5.0 metres of your vehicle");
  476. DisablePlayerCheckpoint(playerid);
  477. cartrack[playerid] = 0;
  478. }
  479. return 1;
  480. }
  481.  
  482. public OnPlayerSelectedMenuRow(playerid, row)
  483. {
  484. new sendername[MAX_PLAYER_NAME];
  485. new vehid = GetPlayerVehicleID(playerid);
  486. new Menu:current;
  487. current = GetPlayerMenu(playerid);
  488. if(current == examplemenu)
  489. {
  490. switch(row)
  491. {
  492. case 0:ShowMenuForPlayer(examplemenu, playerid);
  493. case 1:ShowMenuForPlayer(examplemenu, playerid);
  494. case 2:
  495. if(IsPlayerConnected(playerid))
  496. {
  497. for(new i = 0; i < sizeof(CarInfo); i++)
  498. {
  499. if(CarInfo[i][ownedvehicle] == vehid)
  500. {
  501. if(PlayerInfo[playerid][pCarKey]!=0)
  502. {
  503. SendClientMessage(playerid, COLOR_GREY, "Vec posjedujes jedan auto!");
  504. RemovePlayerFromVehicle(playerid);
  505. TogglePlayerControllable(playerid, 1);
  506. return 1;
  507. }
  508. if(CarInfo[i][cOwned]==1)
  509. {
  510. SendClientMessage(playerid, COLOR_GREY, "Ovo auto nije na prodaju!");
  511. TogglePlayerControllable(playerid, 1);
  512. RemovePlayerFromVehicle(playerid);
  513. return 1;
  514. }
  515. if(GetPlayerMoney(playerid) >= CarInfo[i][cValue])
  516. {
  517. PlayerInfo[playerid][pCarKey] = i;
  518. CarInfo[i][cOwned] = 1;
  519. CarOffered[playerid]=0;
  520. GetPlayerName(playerid, sendername, sizeof(sendername));
  521. strmid(CarInfo[i][cOwner], sendername, 0, strlen(sendername), 999);
  522. GivePlayerMoney(playerid,-CarInfo[i][cValue]);
  523. GameTextForPlayer(playerid, "~w~Cestitamo~n~Ovo je sada vas auto!", 5000, 3);
  524. SendClientMessage(playerid, COLOR_GRAD2, "Cestitamo na novoj kupovini!");
  525. SendClientMessage(playerid, COLOR_GRAD2, "kucaj /car manual za pomoc vozila");
  526. TogglePlayerControllable(playerid, 1);
  527. SaveCars();
  528. return 1;
  529. }
  530. else
  531. {
  532. SendClientMessage(playerid, COLOR_GREY, " Nemate dovoljno novca!");
  533. TogglePlayerControllable(playerid, 1);
  534. RemovePlayerFromVehicle(playerid);
  535. return 1;
  536. }
  537. }
  538. }
  539. return 1;
  540. }
  541. case 3: RemovePlayerFromVehicle(playerid) && TogglePlayerControllable(playerid, 1) && SendClientMessage(playerid,COLOR_GREY,"besuchen sie uns wieder!");
  542. case 4:
  543. for(new i = 0; i < sizeof(CarInfo); i++)
  544. {
  545. new currentveh3;
  546. currentveh3 = GetPlayerVehicleID(playerid);
  547. if(CarInfo[i][ownedvehicle] == currentveh3)
  548. {
  549. SetTimerEx("testfahrt", 180000, false, "x", playerid);
  550. TogglePlayerControllable(playerid, 1);
  551. mission[playerid] =1; CarInfo[i][cOwned] = 1;
  552. SendClientMessage(playerid,COLOR_GREY," Imas 3 minute vremena da testiras auto");
  553. return 1;
  554. }
  555. }
  556. }
  557. return 1;
  558. }
  559. return 1;
  560. }
  561. public OnPlayerExitedMenu(playerid)
  562. {
  563. RemovePlayerFromVehicle(playerid);
  564. TogglePlayerControllable(playerid,1); // unfreeze the player when they exit a menu
  565. return 1;
  566. }
  567. public testfahrt(playerid)
  568. {
  569. if(IsPlayerConnected(playerid))
  570. {
  571. for(new i = 0; i < sizeof(CarInfo); i++)
  572. {
  573. // new Float: x,Float: y,Float: z;
  574. currentveh = GetPlayerVehicleID(playerid);
  575. if(CarInfo[i][ownedvehicle] == currentveh)
  576. {
  577. new Float: x,Float: y,Float: z;
  578. CarInfo[currentveh][cOwned] = 0;
  579. mission[playerid] =0;
  580. SetVehicleToRespawn(currentveh);
  581. GetVehiclePos(currentveh,x,y,z);
  582. SetPlayerPos(playerid,x,y,z+5);
  583. SendClientMessage(playerid,COLOR_GREY,"Test voznja istekla!");
  584. return 1;
  585. }
  586. return 1;
  587. }
  588. }
  589. return 1;
  590. }
  591. public setz(playerid)
  592. {
  593. if(IsPlayerConnected(playerid))
  594. {
  595. PutPlayerInVehicle(playerid,currentveh,0);
  596. }
  597. return 1;
  598. }
Add Comment
Please, Sign In to add comment