Guest User

Untitled

a guest
Feb 8th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | None | 0 0
  1. case 2: { // tow
  2. if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_GREY, "Masina ta nu este spawnata!");
  3. if(GetPlayerCash(playerid) < 500) return SendClientMessage(playerid, COLOR_GREY, "Nu ai $500!");
  4. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_GREY, "Vehiculul este ocupat!");
  5. SetVehicleToRespawn(CarInfo[vsid][Spawned]);
  6. SetTunning(vsid);
  7. GivePlayerCash(playerid, -500);
  8. BizzInfo[11][bBalance] += 500;
  9. mysql_format(SQL, string,sizeof(string),"UPDATE bizz SET Till = %d WHERE ID = %d",BizzInfo[11][bBalance],5);
  10. mysql_tquery(SQL, string, "", "");
  11. format(string, sizeof(string), "Vehiculul tau, %s, este acum in locul parcarii.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  12. SendClientMessage(playerid, COLOR_YELLOW, string);
  13. }
  14. case 3: { // despawn & spawn
  15. if(CarInfo[vsid][Spawned] == 0) {
  16. CarInfo[vsid][Spawned] = CreateVehicleEx(CarInfo[vsid][cModel],CarInfo[vsid][cLocationx],CarInfo[vsid][cLocationy],CarInfo[vsid][cLocationz],CarInfo[vsid][cAngle],CarInfo[vsid][cColorOne],CarInfo[vsid][cColorTwo],-1);
  17. VehicleOwned[CarInfo[vsid][Spawned]] = CarInfo[vsid][Spawned];
  18. VehicleSQL[CarInfo[vsid][Spawned]] = vsid;
  19. attach_vip_text(vsid);
  20. SetTunning(CarInfo[vsid][Spawned]);
  21. CheckVehicle(CarInfo[vsid][Spawned]);
  22. if(CarInfo[PlayerInfo[playerid][pCarKey][0]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][0] = 5000;
  23. else if(CarInfo[PlayerInfo[playerid][pCarKey][1]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][1] = 5000;
  24. else if(CarInfo[PlayerInfo[playerid][pCarKey][2]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][2] = 5000;
  25. else if(CarInfo[PlayerInfo[playerid][pCarKey][3]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][3] = 5000;
  26. else if(CarInfo[PlayerInfo[playerid][pCarKey][4]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][4] = 5000;
  27. else if(CarInfo[PlayerInfo[playerid][pCarKey][5]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][5] = 5000;
  28. else if(CarInfo[PlayerInfo[playerid][pCarKey][6]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][6] = 5000;
  29. else if(CarInfo[PlayerInfo[playerid][pCarKey][7]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][7] = 5000;
  30. else if(CarInfo[PlayerInfo[playerid][pCarKey][8]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][8] = 5000;
  31. else if(CarInfo[PlayerInfo[playerid][pCarKey][9]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][9] = 5000;
  32. format(string, sizeof(string), "Vehiculul tau, %s, este acum spawnat.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  33. SendClientMessage(playerid, COLOR_YELLOW, string);
  34. new engine,lights,alarm,doors,bonnet,boot,objective;
  35. GetVehicleParamsEx(CarInfo[vsid][Spawned],engine,lights,alarm,doors,bonnet,boot,objective);
  36. SetVehicleParamsEx(CarInfo[vsid][Spawned],engine,lights,alarm,CarInfo[vsid][cLock],bonnet,boot,objective);
  37. mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[vsid][Spawned], vsid);
  38. mysql_tquery(SQL, string, "", "");
  39. }
  40. else {
  41. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_GREY, "Vehiculul este ocupat!");
  42. if(CarInfo[PlayerInfo[playerid][pCarKey][0]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][0] = -1;
  43. else if(CarInfo[PlayerInfo[playerid][pCarKey][1]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][1] = -1;
  44. else if(CarInfo[PlayerInfo[playerid][pCarKey][2]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][2] = -1;
  45. else if(CarInfo[PlayerInfo[playerid][pCarKey][3]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][3] = -1;
  46. else if(CarInfo[PlayerInfo[playerid][pCarKey][4]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][4] = -1;
  47. else if(CarInfo[PlayerInfo[playerid][pCarKey][5]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][5] = -1;
  48. else if(CarInfo[PlayerInfo[playerid][pCarKey][6]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][6] = -1;
  49. else if(CarInfo[PlayerInfo[playerid][pCarKey][7]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][7] = -1;
  50. else if(CarInfo[PlayerInfo[playerid][pCarKey][8]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][8] = -1;
  51. else if(CarInfo[PlayerInfo[playerid][pCarKey][9]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][9] = -1;
  52. if(strlen(CarInfo[vsid][cText]) >= 3) {
  53. DestroyDynamicObject(nameobject[CarInfo[vsid][Spawned]]);
  54. }
  55. DestroyVehicle(CarInfo[vsid][Spawned]);
  56. VehicleOwned[CarInfo[vsid][Spawned]] = 0;
  57. VehicleSQL[CarInfo[vsid][Spawned]] = 0;
  58. SetTunning(CarInfo[vsid][Spawned]);
  59. CheckVehicle(CarInfo[vsid][Spawned]);
  60. CarInfo[vsid][Spawned] = 0;
  61. format(string, sizeof(string), "Vehiculul tau, %s, este acum despawnat.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  62. SendClientMessage(playerid, COLOR_YELLOW, string);
  63. mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[vsid][Spawned], vsid);
  64. mysql_tquery(SQL, string, "", "");
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment