Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerStateChange(playerid, newstate, oldstate) {
- new string[256];
- new vehicleid = GetPlayerVehicleID(playerid); //asta e 6823
- if(newstate == PLAYER_STATE_DRIVER)
- {
- new vehicle = GetVehicleID(GetPlayerVehicleID(playerid)), result;
- if(JobWorking[playerid] == 1 && JobVehicle[playerid] == GetPlayerVehicleID(playerid)) JobLeftTime[playerid] = 0;
- if(OnDuty[playerid] == 0) SetPlayerArmedWeapon(playerid,0);
- if(CarRadio[GetPlayerVehicleID(playerid)] != 0) {
- PlayRadio[playerid] = CarRadio[GetPlayerVehicleID(playerid)];
- if(CarRadio[GetPlayerVehicleID(playerid)] == sizeof(RadioLink)) YoutubeStreamForPlayer(playerid, CarLink[GetPlayerVehicleID(playerid)]);
- else PlayAudioStreamForPlayer(playerid, RadioLink[CarRadio[GetPlayerVehicleID(playerid)]]);
- }
- foreach(Player, i) {
- if(Spectate[i] == playerid) {
- TogglePlayerSpectating(i, 1);
- if(IsPlayerInAnyVehicle(playerid)) PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));
- else PlayerSpectatePlayer(i, playerid);
- }
- }
- 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]) {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && HireCar[i] == vehicleid && i != playerid) HireCar[i] = -1, SCM(i, -1, "Vehiculul inchiriat a fost luat de alt jucator!");
- }
- HireCar[playerid] = vehicleid;
- RentPrice[playerid] =0;
- PlayerTextDrawSetString(playerid, FareTD, "Rent car: ~g~$0");
- PlayerTextDrawShow(playerid, FareTD);
- }
- else if(vehicleid == scooter[1] || vehicleid == scooter[2] || vehicleid == scooter[3] || vehicleid == scooter[4] || vehicleid == scooter[5]) {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && HireCar[i] == vehicleid && i != playerid) HireCar[i] = -1, SCM(i, -1, "Vehiculul inchiriat a fost luat de alt jucator!");
- }
- HireCar[playerid] = vehicleid;
- RentPrice[playerid] =0;
- PlayerTextDrawSetString(playerid, FareTD, "Rent car: ~g~$0");
- PlayerTextDrawShow(playerid, FareTD);
- }
- }
- } // 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