Guest User

Untitled

a guest
Jan 10th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2. {
  3. new string[256];
  4. format(string,sizeof(string), " %s ulazi u vozilo.", GetName(playerid));
  5. ProxDetector(20.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
  6. SCM(playerid,-1,""srw_boja"UB:RP | "BELA"Da upalite motor kliknite tipku 2(gornju)");
  7. new Float:Poz[3]; GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
  8. if(!ispassenger)
  9. {
  10. for(new i; i < sizeof(VoziloInfo); i++)
  11. {
  12. if(VoziloInfo[i][vID] == vehicleid)
  13. {
  14. if(VoziloInfo[i][vImaVlasnika] == 1)
  15. {
  16. if(PlayerInfo[playerid][pPosedovanjeAuta] == i || VoziloInfo[i][vZakljucan] == 0 || PlayerInfo[playerid][pAdmin] == 6)
  17. {
  18. if(PlayerInfo[playerid][pAdmin] == 6 || PlayerInfo[playerid][pAdmin] == 7) va_SendClientMessage(playerid,-1,"UB:RP | "srw_boja"Ulazite u vozilo ID: %d!",i);
  19. format(string,sizeof(string), ""srw_boja"Privatno Auto | "BELA"Vlasnik: "srw_boja"%s", VoziloInfo[i][vVlasnik]);
  20. SCM(playerid,-1,string);
  21. return 1;
  22. }
  23. else
  24. {
  25. SetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
  26. format(string,sizeof(string), ""srw_boja"Auto Zakljucan | "BELA"Vlasnik: %s", VoziloInfo[i][vVlasnik]);
  27. SCM(playerid,-1,string);
  28. return 1;
  29. }
  30. }
  31. }
  32. }
  33. if(vehicleid == IzlozbenoAuto)
  34. {
  35. SetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
  36. SCM(playerid,-1,"UB:RP | "CRVENA"Ne mozete uci u izlozbeno vozilo!");
  37. }
  38. if(AutoSalonVozila(vehicleid))
  39. {
  40. SetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
  41. SCM(playerid,-1,"UB:RP | "CRVENA"Ne mozete uci u izlozbeno vozilo!");
  42. }
  43. }
  44. //
  45. return 1;
  46. }
  47. //
  48. public OnPlayerStateChange(playerid, newstate, oldstate)
  49. {
  50. if(newstate == PLAYER_STATE_DRIVER)
  51. {
  52. for(new i = 0; i < sizeof(VoziloInfo); i++)
  53. {
  54. if(VoziloInfo[i][vID] == vozilo)
  55. {
  56. new cijena = CijeneAuta(GetVehicleModel(GetPlayerVehicleID(playerid)));
  57. if(VoziloInfo[i][vImaVlasnika] == 0)
  58. {
  59. if(PlayerInfo[playerid][pAdmin] == 6) va_SendClientMessage(playerid,-1,"[UB:RP] "ZELENA"Ulazite u vozilo ID: %d!",i);
  60. SCM(playerid,-1,""SPLAVA"Polovan auto na prodaju | /kupiauto | /izlaz");
  61. va_SendClientMessage(playerid,-1,""SPLAVA"Cijena: "BELA"%d$ | "SPLAVA"Model: "BELA"%s",AutoSalon[cijena][1]/2, ImeVozila[GetVehicleModel(vozilo) - 400]);
  62. UsaoAutoProdaja[playerid] = i; TogglePlayerControllable(playerid, 0);
  63. return 1;
  64. }
  65. }
  66. }
  67. }
  68. //-----//
  69. return 1;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment