Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case DIALOG_VCP:
- {
- if(response)
- {
- new i = Player[playerid][carVCP];
- if(i == INVALID_VEHICLE_ID)
- {
- if(Player[playerid][english])
- Server(playerid, "Error when receiving vehicle data.");
- else
- Server(playerid, "Error ketika menerima data.");
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- if(Vehicles[i][vehLock])
- {
- Vehicles[i][vehLock] = false;
- if(Player[playerid][english])
- Info(playerid, "You "CHAT_RED"unlocked"CHAT_WHITE" this vehicle.");
- else
- Info(playerid, "Kamu "CHAT_RED"tidak mengunci"CHAT_WHITE" kendaraan ini.");
- }
- else
- {
- Vehicles[i][vehLock] = true;
- if(Player[playerid][english])
- Info(playerid, "You "CHAT_YELLOW"locked"CHAT_WHITE" this vehicle.");
- else
- Info(playerid, "Kamu "CHAT_YELLOW"mengunci"CHAT_WHITE" kendaraan ini.");
- }
- cmd_vcp(playerid, "");
- }
- case 1:
- {
- if(Vehicles[i][vehAlarm])
- {
- Vehicles[i][vehAlarm] = false;
- if(Player[playerid][english])
- Info(playerid, "You toggle the alarm "CHAT_RED"off"CHAT_WHITE".");
- else
- Info(playerid, "Kamu "CHAT_RED"menonaktifkan"CHAT_WHITE" alarm.");
- }
- else
- {
- Vehicles[i][vehAlarm] = true;
- if(Player[playerid][english])
- Info(playerid, "You toggle the alarm "CHAT_YELLOW"on"CHAT_WHITE".");
- else
- Info(playerid, "Kamu "CHAT_YELLOW"mengaktifkan"CHAT_WHITE" alarm.");
- }
- cmd_vcp(playerid, "");
- }
- case 2:
- {
- if(Player[playerid][english])
- format(message, sizeof(message), "Current Plate : "CHAT_YELLOW"%s", Vehicles[i][vehPlate]);
- else
- format(message, sizeof(message), "Plat yang sekarang : "CHAT_YELLOW"%s", Vehicles[i][vehPlate]);
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_CHANGEPLATE, DIALOG_STYLE_INPUT, "Change Plate", message, "Change", "Cancel");
- else
- ShowPlayerDialog(playerid, DIALOG_CHANGEPLATE, DIALOG_STYLE_INPUT, "Ganti Plat", message, "Ganti", "Batal");
- }
- case 3:
- {
- parkVehicles(i, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
- if(Player[playerid][english])
- Info(playerid, "Your vehicle will be spawned here next time.");
- else
- Info(playerid, "Kendaraanmu akan spawn disini lain kali.");
- }
- case 4:
- {
- if(Player[playerid][english])
- format(message, sizeof(message), "Current Color : "CHAT_YELLOW"%d", Vehicles[i][vehColor][0]);
- else
- format(message, sizeof(message), "Warna yang sekarang : "CHAT_YELLOW"%d", Vehicles[i][vehColor][0]);
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_CHANGECOLOR, DIALOG_STYLE_INPUT, "Change Color", message, "Change", "Cancel");
- else
- ShowPlayerDialog(playerid, DIALOG_CHANGECOLOR, DIALOG_STYLE_INPUT, "Ganti Warna", message, "Ganti", "Batal");
- }
- case 5:
- {
- if(Player[playerid][english])
- format(message, sizeof(message), "Current Color : "CHAT_YELLOW"%d", Vehicles[i][vehColor][1]);
- else
- format(message, sizeof(message), "Warna yang sekarang : "CHAT_YELLOW"%d", Vehicles[i][vehColor][1]);
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_CHANGECOLOR2, DIALOG_STYLE_INPUT, "Change Color", message, "Change", "Cancel");
- else
- ShowPlayerDialog(playerid, DIALOG_CHANGECOLOR2, DIALOG_STYLE_INPUT, "Ganti Warna", message, "Ganti", "Batal");
- }
- case 6:
- {
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_NEON, DIALOG_STYLE_LIST, "Choose your neon colour","Blue\nGreen\nYellow\nWhite\nPink\nTurn off Neon","Select","Back");
- else
- ShowPlayerDialog(playerid, DIALOG_NEON, DIALOG_STYLE_LIST, "Pilih warna untuk neon","Biru\nHijau\nKuning\nPutih\nPink\nMatikan Neon","Pilih","Kembali");
- }
- }
- }
- }
- case DIALOG_CHANGEPLATE:
- {
- if(response)
- {
- if(strlen(inputtext) > 10 || strlen(inputtext) < 3)
- {
- if(Player[playerid][english])
- Server(playerid, "Please insert 3-10 character.");
- else
- Server(playerid, "Masukkan 3-10 karakter.");
- }
- else
- {
- new i = Player[playerid][carVCP];
- if(i == INVALID_VEHICLE_ID)
- {
- if(Player[playerid][english])
- Server(playerid, "Error when receiving vehicle data.");
- else
- Server(playerid, "Gagal menerima data.");
- return 1;
- }
- format(Vehicles[i][vehPlate], 16, "%s", inputtext);
- SetVehicleNumberPlate(Vehicles[i][vehicleData], Vehicles[i][vehPlate]);
- createVehicle(Vehicles[i][vehicleData], true);
- }
- }
- cmd_vcp(playerid, "");
- }
- case DIALOG_MYVEHICLES:
- {
- if(response)
- {
- new count = 0;
- for(new i = 0; i < MAX_VEH; i++)
- {
- if(!Vehicles[i][vehStatus]) continue;
- if(Vehicles[i][vehOwner] == Player[playerid][pID])
- {
- if(count == listitem)
- {
- Player[playerid][carVCP] = i;
- format(message, sizeof(message), "%s - %d", vehicleNames[Vehicles[i][vehModel] - 400], Vehicles[i][vehID]);
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_MYVEHICLES2, DIALOG_STYLE_LIST, message, "Locate Vehicle\nRespawn Vehicle\nSell Vehicle To Server\nSell Vehicle To Player", "Choose", "Back");
- else
- ShowPlayerDialog(playerid, DIALOG_MYVEHICLES2, DIALOG_STYLE_LIST, message, "Cari Kendaraan\nRespawn Kendaraan\nJual kendaraan ke server\nJual kendaraan ke player", "Pilih", "Kembali");
- break;
- }
- else
- {
- count++;
- }
- }
- }
- }
- }
- case DIALOG_MYVEHICLES2:
- {
- if(response)
- {
- new i = Player[playerid][carVCP];
- switch(listitem)
- {
- case 0:
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new Float:x, Float:y, Float:z;
- GetVehiclePos(Vehicles[i][vehicleData], x, y, z);
- SetPVarFloat(playerid, "Spongebob", x);
- SetPVarFloat(playerid, "Mario", y);
- SetPVarFloat(playerid, "SpiderPig", z);
- SetPVarString(playerid, "FAIL", "Your Car");
- if(Player[playerid][english])
- Info(playerid, "Follow the arrow to find your car.");
- else
- Info(playerid, "Ikuti panah untuk mencari mobilmu.");
- GPSObject[playerid] = CreateObject(1318, 0, 0, 0, 0.0, 0.0, 0);
- SetPVarInt(playerid, "YEAH", 1);
- }
- else
- {
- if(Player[playerid][english])
- Server(playerid, "You must be in vehicle to locate your car.");
- else
- Server(playerid, "Kamu harus di kendaraan untuk mencari kendaraanmu.");
- }
- }
- case 1:
- {
- createVehicle(i, true);
- if(Player[playerid][english])
- Server(playerid, "Your vehicle has been respawned.");
- else
- Server(playerid, "Kendaraanmu telah respawn.");
- }
- case 2:
- {
- new price = 0;
- for(new m = 0; m < sizeof(Dealership); m++)
- {
- if(Dealership[m][dealerModel] == Vehicles[i][vehModel])
- {
- price = Dealership[m][dealerPrice];
- break;
- }
- }
- price = price - floatround(price * 0.20, floatround_round);
- if(Player[playerid][english])
- format(message, sizeof(message), "Are you sure you want to sell your vehicle for "CHAT_YELLOW"$%s"CHAT_WHITE"?", FormatNumber(price));
- else
- format(message, sizeof(message), "Apa kamu yakin akan menjual kendaraanmu untuk "CHAT_YELLOW"$%s"CHAT_WHITE"?", FormatNumber(price));
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_SALESERVER, DIALOG_STYLE_MSGBOX, "Sell Vehicle", message, "Sell", "Cancel");
- else
- ShowPlayerDialog(playerid, DIALOG_SALESERVER, DIALOG_STYLE_MSGBOX, "Jual Kendaraan", message, "Jual", "Batal");
- }
- case 3:
- {
- Player[playerid][vsellCar] = Player[playerid][carVCP];
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_VSELL, DIALOG_STYLE_INPUT, "Sell Vehicle", "Insert player ID", "Sell", "Cancel");
- else
- ShowPlayerDialog(playerid, DIALOG_VSELL, DIALOG_STYLE_INPUT, "Jual Kendaraan", "Masukkan player ID", "Jual", "Batal");
- }
- }
- }
- else
- {
- cmd_myvehicles(playerid, "");
- }
- }
- case DIALOG_CHANGECOLOR:
- {
- if(response)
- {
- if(strval(inputtext) >= 0 && strval(inputtext) <= 255)
- {
- new i = Player[playerid][carVCP];
- Vehicles[i][vehColor][0] = strval(inputtext);
- ChangeVehicleColor(Vehicles[i][vehicleData], Vehicles[i][vehColor][0], Vehicles[i][vehColor][1]);
- PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
- }
- else
- {
- if(Player[playerid][english])
- Info(playerid, "Please input between 0 - 255.");
- else
- Info(playerid, "Masukkan nomor antara 0 - 255.");
- }
- }
- }
- case DIALOG_CHANGECOLOR2:
- {
- if(response)
- {
- if(strval(inputtext) >= 0 && strval(inputtext) <= 255)
- {
- new i = Player[playerid][carVCP];
- Vehicles[i][vehColor][1] = strval(inputtext);
- ChangeVehicleColor(Vehicles[i][vehicleData], Vehicles[i][vehColor][0], Vehicles[i][vehColor][1]);
- PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
- }
- else
- {
- if(Player[playerid][english])
- Info(playerid, "Please input between 0 - 255.");
- else
- Info(playerid, "Masukkan nomor antara 0 - 255.");
- }
- }
- }
- case DIALOG_GPS:
- {
- if(response)
- {
- GetPlayerLocationFromId(playerid, listitem);
- }
- }
- case DIALOG_SALESERVER:
- {
- if(response)
- {
- new i = Player[playerid][carVCP], price = 0;
- for(new m = 0; m < sizeof(Dealership); m++)
- {
- if(Dealership[m][dealerModel] == Vehicles[i][vehModel])
- {
- price = Dealership[m][dealerPrice];
- break;
- }
- }
- price = price - floatround(price * 0.20, floatround_round);
- if(Player[playerid][english])
- format(message, sizeof(message), CHAT_WHITE"You sold your vehicle for "CHAT_YELLOW"$%s"CHAT_WHITE".", FormatNumber(price));
- else
- format(message, sizeof(message), CHAT_WHITE"Kamu menjual mobilmu dengan harga "CHAT_YELLOW"$%s"CHAT_WHITE".", FormatNumber(price));
- Info(playerid, message);
- giveMoney(playerid, price);
- __deleteVehicle(i);
- }
- }
- case DIALOG_VSELL:
- {
- if(response)
- {
- if(!isConnected(strval(inputtext)))
- {
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_VSELL, DIALOG_STYLE_INPUT, "Sell Vehicle", CHAT_WHITE"That player isn't connected!\nInsert player ID", "Sell", "Cancel");
- else
- ShowPlayerDialog(playerid, DIALOG_VSELL, DIALOG_STYLE_INPUT, "Jual Kendaraan", CHAT_WHITE"Player tidak login!\nMasukkan player ID", "Jual", "Batal");
- }
- else if(isMe(playerid, strval(inputtext)))
- {
- if(Player[playerid][english])
- ShowPlayerDialog(playerid, DIALOG_VSELL, DIALOG_STYLE_INPUT, "Sell Vehicle", CHAT_WHITE"You can't sell to yourself!\nInsert player ID", "Sell", "Cancel");
- else
- ShowPlayerDialog(playerid, DIALOG_VSELL, DIALOG_STYLE_INPUT, "Jual Kendaraan", CHAT_WHITE"Kamu tidak bisa menjual ke dirimu sendiri!\nnMasukkan player ID", "Jual", "Batal");
- }
- else
- {
- Player[playerid][vsellTo] = strval(inputtext);
- if(Player[playerid][english])
- format(message, sizeof(message), CHAT_WHITE"You want to sell your vehicle to "CHAT_YELLOW"%s"CHAT_WHITE".\nInsert price for your vehicle", GetName(Player[playerid][vsellTo]));
- else
- format(message, sizeof(message), CHAT_WHITE"Kamu akan menjual mobilmu ke "CHAT_YELLOW"%s"CHAT_WHITE".\nMasukkan harga", GetName(Player[playerid][vsellTo]));
- ShowPlayerDialog(playerid, DIALOG_VSELL2, DIALOG_STYLE_INPUT, "Sell Vehicle", message, "Sell", "Cancel");
- }
- }
- }
- case DIALOG_VSELL2:
- {
- if(response)
- {
- if(!isConnected(Player[playerid][vsellTo]))
- {
- if(Player[playerid][english])
- Server(playerid, "That player isn't connected.");
- else
- Server(playerid, "Player tidak login.");
- return 1;
- }
- if(strval(inputtext) >= 100000)
- {
- new msg2[512];
- Player[playerid][vsellPrice] = strval(inputtext);
- if(Player[playerid][english])
- format(msg2, sizeof(msg2), CHAT_WHITE"Are you sure you want to sell your vehicle to "CHAT_YELLOW"%s"CHAT_WHITE".\nWith price "CHAT_YELLOW"%s", GetName(Player[playerid][vsellTo]), FormatNumber(Player[playerid][vsellPrice]));
- else
- format(msg2, sizeof(msg2), CHAT_WHITE"Apa kamu yakin akan menjual mobilmu ke "CHAT_YELLOW"%s"CHAT_WHITE".\nDengan harga "CHAT_YELLOW"%s", GetName(Player[playerid][vsellTo]), FormatNumber(Player[playerid][vsellPrice]));
- ShowPlayerDialog(playerid, DIALOG_CONFVS, DIALOG_STYLE_MSGBOX, "Sell Vehicle", msg2, "Sell", "Cancel");
- }
- else
- {
- if(Player[playerid][english])
- format(message, sizeof(message), CHAT_WHITE"Minimum price is 100.000!\nYou want to sell your vehicle to "CHAT_YELLOW"%s"CHAT_WHITE".\nInsert price for your vehicle", GetName(Player[playerid][vsellTo]));
- else
- format(message, sizeof(message), CHAT_WHITE"Minimal harga adalah 100.000!\nKamu akan menjual mobilmu ke "CHAT_YELLOW"%s"CHAT_WHITE".\nMasukkan harga", GetName(Player[playerid][vsellTo]));
- ShowPlayerDialog(playerid, DIALOG_VSELL2, DIALOG_STYLE_INPUT, "Sell Vehicle", message, "Sell", "Cancel");
- }
- }
- }
- case DIALOG_CONFVS:
- {
- if(response)
- {
- new otherID = Player[playerid][vsellTo];
- if(!isConnected(Player[playerid][vsellTo]))
- {
- if(Player[playerid][english])
- Server(playerid, "That player isn't connected.");
- else
- Server(playerid, "Player tidak login.");
- return 1;
- }
- if(Player[otherID][vsellFrom] == INVALID_PLAYER_ID)
- {
- Player[otherID][vsellFrom] = playerid;
- new msg2[512], i = Player[playerid][vsellCar];
- if(Player[otherID][english])
- format(msg2, sizeof(msg2), CHAT_YELLOW"%s "CHAT_WHITE" want to sell "CHAT_YELLOW"%s"CHAT_WHITE".\nWith price "CHAT_YELLOW"%s"CHAT_WHITE".\nDo you want to buy?", GetName(playerid), vehicleNames[Vehicles[i][vehModel] - 400], FormatNumber(Player[playerid][vsellPrice]));
- else
- format(msg2, sizeof(msg2), CHAT_YELLOW"%s "CHAT_WHITE" ingin menjual "CHAT_YELLOW"%s"CHAT_WHITE".\nDengan harga "CHAT_YELLOW"%s"CHAT_WHITE".\nApakah anda mau beli?", GetName(playerid), vehicleNames[Vehicles[i][vehModel] - 400], FormatNumber(Player[playerid][vsellPrice]));
- ShowPlayerDialog(otherID, DIALOG_CONFIRMVSELL, DIALOG_STYLE_MSGBOX, "Buy Vehicle", msg2, "Buy", "Cancel");
- }
- else
- {
- Server(playerid, "That player already in transaction.");
- }
- }
- }
- case DIALOG_CONFIRMVSELL:
- {
- new otherID = Player[playerid][vsellFrom], i = Player[otherID][vsellCar];
- if(response && Player[playerid][vsellFrom] != INVALID_PLAYER_ID)
- {
- if(!isConnected(Player[playerid][vsellFrom]))
- {
- if(Player[playerid][english])
- Server(playerid, "Request is expired.");
- else
- Server(playerid, "Permintaan kadaluarsa.");
- return 1;
- }
- new maxcar, count2 = 0;
- if(Player[playerid][vipLevel] > 0)
- {
- maxcar = MAX_VIP_VEHICLES;
- }
- else
- {
- maxcar = MAX_PLAYER_VEHICLES;
- }
- count2 = countplayerVeh(playerid);
- if(count2 < maxcar)
- {
- if(Player[playerid][playerMoney] >= Player[otherID][vsellPrice])
- {
- giveMoney(otherID, Player[otherID][vsellPrice]);
- takeMoney(playerid, Player[otherID][vsellPrice]);
- RemovePlayerFromVehicle(otherID);
- if(Player[otherID][english])
- format(message, sizeof(message), CHAT_YELLOW"%s bought your car for "CHAT_YELLOW"%s"CHAT_WHITE".", GetName(playerid), FormatNumber(Player[otherID][vsellPrice]));
- else
- format(message, sizeof(message), CHAT_YELLOW"%s Membeli mobilmu dengan harga "CHAT_YELLOW"%s"CHAT_WHITE".", GetName(playerid), FormatNumber(Player[otherID][vsellPrice]));
- ShowPlayerDialog(otherID, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Congratulations!!!", message, "Confirm", "");
- if(Player[playerid][english])
- format(message, sizeof(message), CHAT_YELLOW"Succesfully bought "CHAT_YELLOW"%s "CHAT_WHITE"car for "CHAT_YELLOW"%s"CHAT_WHITE".", GetName(otherID), FormatNumber(Player[otherID][vsellPrice]));
- else
- format(message, sizeof(message), CHAT_YELLOW"Sukses membeli mobil "CHAT_YELLOW"%s "CHAT_WHITE"dengan harga "CHAT_YELLOW"%s"CHAT_WHITE".", GetName(otherID), FormatNumber(Player[otherID][vsellPrice]));
- Server(playerid, message);
- Vehicles[i][vehOwner] = Player[playerid][pID];
- saveVehicles(i);
- Player[playerid][vsellFrom] = INVALID_PLAYER_ID;
- Player[otherID][vsellCar] = -1;
- Player[otherID][vsellPrice] = -1;
- }
- else
- {
- if(Player[playerid][english])
- Server(playerid, "You didn't have enough money to buy that vehicle.");
- else
- Server(playerid, "Uangmu tidak cukup untuk membeli mobil itu.");
- if(Player[otherID][english])
- Server(otherID, "That player didn't have enough money to buy your vehicle.");
- else
- Server(otherID, "Player itu tidak mempunyai uang yang cukup untuk membeli mobilmu.");
- }
- }
- else
- {
- if(Player[playerid][english])
- Info(playerid, "You've reached maximum car limit.");
- else
- Info(playerid, "Kamu mencapai batas kepemilikan mobil pribadi.");
- if(Player[otherID][english])
- Server(otherID, "That player has reached maximum car limit.");
- else
- Server(otherID, "Player itu telah melebihi batas mobil pribadi.");
- }
- }
- else
- {
- if(isConnected(Player[playerid][vsellFrom]))
- {
- if(Player[otherID][english])
- Info(otherID, "Your vehicle sell request has been denied.");
- else
- Info(otherID, "Permintaanmu ditolak.");
- }
- }
- Player[playerid][vsellFrom] = INVALID_PLAYER_ID;
- }
- case DIALOG_PLAYERVEHICLES:
- {
- if(response)
- {
- new count = 0, otherID = Player[playerid][tempID];
- if(!isConnected(otherID))
- {
- Server(playerid, "That player isn't logged in!");
- return 1;
- }
- for(new i = 0; i < MAX_VEH; i++)
- {
- if(!Vehicles[i][vehStatus]) continue;
- if(Vehicles[i][vehOwner] == Player[otherID][pID])
- {
- if(count == listitem)
- {
- Player[playerid][carVCP] = i;
- format(message, sizeof(message), "%s - %d", vehicleNames[Vehicles[i][vehModel] - 400], Vehicles[i][vehID]);
- ShowPlayerDialog(playerid, DIALOG_PLAYERVEHICLES2, DIALOG_STYLE_LIST, message, "Locate Vehicle\nRespawn Vehicle\nGoto Vehicle", "Choose", "Back");
- break;
- }
- else
- {
- count++;
- }
- }
- }
- }
- }
- case DIALOG_PLAYERVEHICLES2:
- {
- if(response)
- {
- new i = Player[playerid][carVCP], otherID = Player[playerid][tempID];
- if(!isConnected(otherID))
- {
- Server(playerid, "That player isn't logged in!");
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new Float:x, Float:y, Float:z;
- GetVehiclePos(Vehicles[i][vehicleData], x, y, z);
- SetPVarFloat(playerid, "Spongebob", x);
- SetPVarFloat(playerid, "Mario", y);
- SetPVarFloat(playerid, "SpiderPig", z);
- SetPVarString(playerid, "FAIL", "Your Car");
- Info(playerid, "Follow the arrow to find that car.");
- GPSObject[playerid] = CreateObject(1318, 0, 0, 0, 0.0, 0.0, 0);
- SetPVarInt(playerid, "YEAH", 1);
- }
- else
- {
- Server(playerid, "You must be in vehicle to locate that car.");
- }
- }
- case 1:
- {
- createVehicle(i, true);
- Server(playerid, "That vehicle has been respawned.");
- }
- case 2:
- {
- new Float:x, Float:y, Float:z;
- GetVehiclePos(Vehicles[i][vehicleData], x, y, z);
- SetPlayerPos(playerid, x, y, z + 2);
- SetPlayerVirtualWorld(playerid, Vehicles[i][vehVW]);
- SetPlayerInterior(playerid, Vehicles[i][vehInt]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement