Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case DIALOG_GARAGE: {
- if(!response) return 1;
- sVehicle[5][playerid] = sVehicle[listitem][playerid];
- if(CarInfo[sVehicle[listitem][playerid]][Spawned] != 0) ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", "Information\nLocate\nTow\nDespawn\nDebug\nSell", "Select", "Back");
- else if(CarInfo[sVehicle[listitem][playerid]][Spawned] == 0) ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", "Information\nLocate\nTow\nSpawn - park place\nDebug\nSell", "Select", "Back");
- }
- case DIALOG_GARAGE1: {
- if(!response) return ShowVehiclesMenu(playerid);
- new vsid = sVehicle[5][playerid];
- switch(listitem) {
- case 0: { // info
- new locktext[6];
- if(CarInfo[vsid][cLock] > 0) {locktext = "Yes";}
- else {locktext = "No";}
- SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
- format(string, sizeof(string), "Model:[%s] Value:[$%s] Locked:[%s] Color1:[%d] Color2:[%d]", aVehicleNames[CarInfo[vsid][cModel]-400], FormatNumber(CarInfo[vsid][cValue]), locktext, CarInfo[vsid][cColorOne], CarInfo[vsid][cColorTwo]);
- SendClientMessage(playerid, COLOR_GREY,string);
- format(string, sizeof(string), "Kilometers:[%.2f] Insurance:[No] Insurance price:[$51] ID:[%d]", CarInfo[vsid][KM], CarInfo[vsid][Spawned]);
- SendClientMessage(playerid, COLOR_GREY, string);
- SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
- }
- case 1: { // find
- if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
- if(CP[playerid] != 0) return SendClientMessage(playerid, COLOR_GOLD, "Ai deja un punct rosu activ. Foloseste comanda '/cancel checkpoint' pentru a renunta la el.");
- new Float:vehx, Float:vehy, Float:vehz;
- GetVehiclePos(CarInfo[vsid][Spawned], vehx, vehy, vehz);
- SetPlayerCheckpoint(playerid, vehx, vehy, vehz, 3.0);
- new szZone[128];
- GetPlayer3DZone2(vehx, vehy, vehz, szZone, sizeof(szZone));
- format(string, sizeof(string), "{FFB870}Your %s has been located near %s.", aVehicleNames[CarInfo[vsid][cModel]-400], szZone);
- SendClientMessage(playerid, COLOR_WHITE, string);
- CP[playerid] = 53;
- }
- 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);
- }
- case 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, "", "");
- }
- }
- case 4: { // Debug
- if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
- if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Vehicle is ocuppied!");
- format(string, sizeof(string), "{FFB870}You unstuck your %s, it is now near LV Airport. Please park it (/park) in a better place.", aVehicleNames[CarInfo[vsid][cModel]-400]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- SetVehiclePos(CarInfo[vsid][Spawned], 1688.9471,1306.3896,10.9159);
- SetVehicleZAngle(CarInfo[vsid][Spawned], 359.3103);
- }
- case 5: { // sell
- if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
- if(CarInfo[vsid][Spawned] != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Nu esti in vehiculul tau personal");
- if(CarInfo[vsid][cSpecial] == 1) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Acces denined!");
- if(!PlayerToPoint(5.0,playerid,321.1830,-1520.7961,36.0391)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}{FFFFCC}Eroare: Trebuie sa fii la distribuitorul de vehicule.");
- if(PlayerInfo[playerid][pPinLogged] == 0 && strlen(PlayerInfo[playerid][pPin]) != 1) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Contul tau este blocat. Scrie /pin pentru a il debloca si pentru a folosi aceasta comanda.");
- new value;
- value = floatround((CarInfo[vsid][cValue] * 7) / 10);
- format(string, sizeof(string), "\tRodeo Dealership :\n- Are you sure you want to sell your %s for %s$ ?",aVehicleNames[CarInfo[vsid][cModel]-400],FormatNumber(value));
- ShowPlayerDialog(playerid, DIALOG_SELLCAR, DIALOG_STYLE_MSGBOX, "Rodeo Dealership Office", string, "Yes", "No");
- PlayerSellCar[playerid] = vsid;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement