Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 2: { // tow
- if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
- if(PlayerInfo[playerid][pCash] < 500) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your don't have $500!");
- if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Vehicle is ocuppied!");
- SetTunning(vsid);
- SetVehicleToRespawn(CarInfo[vsid][Spawned]);GivePlayerCash(playerid, -500);
- SBizzInfo[5][sbTill] += 500;
- mysql_format(SQL, string,sizeof(string),"UPDATE sbizz SET Till = %d WHERE ID = %d",SBizzInfo[5][sbTill],5);
- mysql_tquery(SQL, string, "", "");
- format(string, sizeof(string), "{FFB870}Your %s is now at its parking place.", aVehicleNames[CarInfo[vsid][cModel]-400]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- ase 3: { // despawn & spawn
- if(CarInfo[vsid][Spawned] == 0) {
- CarInfo[vsid][Spawned] = CreateVehicle(CarInfo[vsid][cModel],CarInfo[vsid][cLocationx],CarInfo[vsid][cLocationy],CarInfo[vsid][cLocationz],CarInfo[vsid][cAngle],CarInfo[vsid][cColorOne],CarInfo[vsid][cColorTwo],-1);
- SetTunning(vsid);
- if(CarInfo[PlayerInfo[playerid][pCarKey1]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][0] = 1800;
- else if(CarInfo[PlayerInfo[playerid][pCarKey2]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][1] = 1800;
- else if(CarInfo[PlayerInfo[playerid][pCarKey3]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][2] = 1800;
- else if(CarInfo[PlayerInfo[playerid][pCarKey4]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][3] = 1800;
- else if(CarInfo[PlayerInfo[playerid][pCarKey5]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][4] = 1800;
- format(string, sizeof(string), "{FFB870}Your %s has been spawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[vsid][Spawned], vsid);
- mysql_tquery(SQL, string, "", "");
- }
- else {
- if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Vehicle is ocuppied!");
- if(CarInfo[PlayerInfo[playerid][pCarKey1]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][0] = -1;
- else if(CarInfo[PlayerInfo[playerid][pCarKey2]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][1] = -1;
- else if(CarInfo[PlayerInfo[playerid][pCarKey3]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][2] = -1;
- else if(CarInfo[PlayerInfo[playerid][pCarKey4]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][3] = -1;
- else if(CarInfo[PlayerInfo[playerid][pCarKey5]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][4] = -1;
- DestroyVehicle(CarInfo[vsid][Spawned]);
- CarInfo[vsid][Spawned] = 0;
- format(string, sizeof(string), "{FFB870}Your %s has been despawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[vsid][Spawned], vsid);
- mysql_tquery(SQL, string, "", "");
Advertisement
Add Comment
Please, Sign In to add comment