Advertisement
Guest User

Untitled

a guest
Sep 6th, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. public OnPlayerStateChange(playerid, newstate, oldstate) {
  2. new string[256];
  3. new vehicleid = GetPlayerVehicleID(playerid); //asta e 6823
  4. if(newstate == PLAYER_STATE_DRIVER)
  5. {
  6. new vehicle = GetVehicleID(GetPlayerVehicleID(playerid)), result;
  7. if(JobWorking[playerid] == 1 && JobVehicle[playerid] == GetPlayerVehicleID(playerid)) JobLeftTime[playerid] = 0;
  8.  
  9. if(OnDuty[playerid] == 0) SetPlayerArmedWeapon(playerid,0);
  10. if(CarRadio[GetPlayerVehicleID(playerid)] != 0) {
  11. PlayRadio[playerid] = CarRadio[GetPlayerVehicleID(playerid)];
  12. if(CarRadio[GetPlayerVehicleID(playerid)] == sizeof(RadioLink)) YoutubeStreamForPlayer(playerid, CarLink[GetPlayerVehicleID(playerid)]);
  13. else PlayAudioStreamForPlayer(playerid, RadioLink[CarRadio[GetPlayerVehicleID(playerid)]]);
  14. }
  15.  
  16. foreach(Player, i) {
  17. if(Spectate[i] == playerid) {
  18. TogglePlayerSpectating(i, 1);
  19. if(IsPlayerInAnyVehicle(playerid)) PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));
  20. else PlayerSpectatePlayer(i, playerid);
  21. }
  22. }
  23. if(vehicleid == rentls[1] || vehicleid == rentls[2] || vehicleid == rentls[3] || vehicleid == rentls[4] || vehicleid == rentls[5] || vehicleid == rentls[6] || vehicleid == rentls[7] || vehicleid == rentls[8] || vehicleid == rentls[9] || vehicleid == rentls[10]) {
  24. foreach(Player, i) {
  25. if(IsPlayerConnected(i) && HireCar[i] == vehicleid && i != playerid) HireCar[i] = -1, SCM(i, -1, "Vehiculul inchiriat a fost luat de alt jucator!");
  26. }
  27. HireCar[playerid] = vehicleid;
  28. RentPrice[playerid] =0;
  29. PlayerTextDrawSetString(playerid, FareTD, "Rent car: ~g~$0");
  30. PlayerTextDrawShow(playerid, FareTD);
  31. }
  32. else if(vehicleid == scooter[1] || vehicleid == scooter[2] || vehicleid == scooter[3] || vehicleid == scooter[4] || vehicleid == scooter[5]) {
  33. foreach(Player, i) {
  34. if(IsPlayerConnected(i) && HireCar[i] == vehicleid && i != playerid) HireCar[i] = -1, SCM(i, -1, "Vehiculul inchiriat a fost luat de alt jucator!");
  35. }
  36. HireCar[playerid] = vehicleid;
  37. RentPrice[playerid] =0;
  38. PlayerTextDrawSetString(playerid, FareTD, "Rent car: ~g~$0");
  39. PlayerTextDrawShow(playerid, FareTD);
  40. }
  41. }
  42. } // Aceasta paranteza daca da erori scoate-o deoarece probabil deja se inchide acel cod in gmul tau cu alta paranteza mai jos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement