Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- //printf("DIALOG: [%d] %s (Dialog %d, Response %d, Listitem %d, Inputtext %s)",playerid, PlayerName(playerid), dialogid, response, listitem, inputtext);
- new string[224], sendername[MAX_PLAYER_NAME];
- switch(dialogid)
- {
- case 1: // Login dialog
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 0) return true;
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Server Account","Welcome back to Diverse RP, please enter your password to login.","Login", "Other");
- if(strlen(inputtext) >= 40) {
- SendClientMessage(playerid, COLOR_WHITE, "Password is too long (40 Chars max).");
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Server Account","Welcome back to Diverse RP, please enter your password to login.","Login", "Other");
- return true;
- }
- new query[200], input[65];
- //mysql_escape_string(inputtext, input);
- SHA256_PassHash(inputtext, HASH_KEY, input, 65);
- if(PlayerInfo[playerid][pSerialBan] == 1) {
- new banpass[65];
- GetPVarString(playerid, "BanPass", banpass, 65);
- if(strlen(banpass) > 0 && strmatch(banpass, input)) {
- SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
- SendClientMessage(playerid, COLOR_YELLOW, "[System] You are banned from Diverse Roleplay.");
- SendClientMessage(playerid, COLOR_YELLOW, "[System] Ban evasion detected.");
- SendClientMessage(playerid, COLOR_YELLOW, "[System] To appeal this ban, go to www.diverseroleplay.org");
- SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
- SetPVarInt(playerid, "Banned", 1);
- DeletePVar(playerid, "BanPass");
- PlayerInfo[playerid][pSerialBan] = 0;
- KickPlayer(playerid, "");
- } else {
- DeletePVar(playerid, "BanPass");
- PlayerInfo[playerid][pSerialBan] = 0;
- }
- }
- format(query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%s' AND Pass = '%s'", PlayerName(playerid), input);
- mysql_function_query(handlesql, query, true, "LogUserIn", "i", playerid);
- format(PlayerInfo[playerid][pPass],65,"%s",input); //Sloppy, but it'll have to do since it won't retrieve the pass...
- }
- case 2: // Register dialog
- {
- // Registering password
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Server Account","There is no existing account using your playername, please create a new account!\nPlease enter your desired password.","Register", "");
- if(strlen(inputtext) < 6)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Password is too short (5 Chars min.).");
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Server Account","There is no existing account using your playername, please create a new account!\nPlease enter your desired password.","Register", "");
- return 1;
- }
- if(strlen(inputtext) >= 40)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Password is too long (40 Chars max).");
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Server Account","There is no existing account using your playername, please create a new account!\nPlease enter your desired password.","Register", "");
- return 1;
- }
- if(PlayerInfo[playerid][pSerialBan] == 1) {
- new banpass[65], input[65];
- SHA256_PassHash(inputtext, HASH_KEY, input, 65);
- GetPVarString(playerid, "BanPass", banpass, 65);
- if(strlen(banpass) > 0 && strmatch(banpass, input)) {
- SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
- SendClientMessage(playerid, COLOR_YELLOW, "[System] You are banned from Diverse Roleplay.");
- SendClientMessage(playerid, COLOR_YELLOW, "[System] Ban evasion detected.");
- SendClientMessage(playerid, COLOR_YELLOW, "[System] To appeal this ban, go to www.diverseroleplay.org");
- SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
- SetPVarInt(playerid, "Banned", 1);
- DeletePVar(playerid, "BanPass");
- PlayerInfo[playerid][pSerialBan] = 0;
- KickPlayer(playerid, "");
- } else {
- DeletePVar(playerid, "BanPass");
- PlayerInfo[playerid][pSerialBan] = 0;
- }
- }
- SetPVarInt(playerid, "Approve", 0);
- SetPVarString(playerid, "TempPass", inputtext);
- strmid(PlayerInfo[playerid][pOOC], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pMetagame], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pRevenge], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pRoleplay], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pPowergame], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pQuest1], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pQuest2], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pQuest3], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pQuest4], "None", 0, strlen("None"), 255);
- strmid(PlayerInfo[playerid][pQuest5], "None", 0, strlen("None"), 255);
- SetPVarInt(playerid, "TutQuestAmount", 0);
- return CallRemoteFunction("TutorialAnswers","i",playerid);
- }
- case 3: // Rental Agreement Dialog
- {
- switch(response)
- {
- case 1:
- {
- new result[1000];
- for(new i = 0; i < sizeof(gRentalIDs); i++) {
- if(i == 0) { format(result, 1000, "%s", VehicleName[gRentalIDs[i][0]-400]); }
- else { format(result, 1000, "%s\n%s", result, VehicleName[gRentalIDs[i][0]-400]); }
- }
- ShowPlayerDialog(playerid, 73,DIALOG_STYLE_LIST,"Rental Options", result, "Select", "");
- }
- }
- }
- case 4: // Job Options Dialog
- {
- if(!response) return true;
- new foundid = -1;
- for(new jb = 0; jb < MAX_JOBS; jb++) {
- if(JobInfo[jb][jID] >= 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, JobInfo[jb][jX], JobInfo[jb][jY], JobInfo[jb][jZ])) {
- foundid=jb;
- break;
- }
- }
- }
- if(foundid == -1) return true;
- if(GetPVarInt(playerid, "Job") != foundid+1) return true;
- switch(listitem)
- {
- case 0:
- {
- if(GetPVarInt(playerid, "OnRoute") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are already on a route!");
- if(GetPVarInt(playerid, "JobReduce") >= 1 && GetPVarInt(playerid, "MonthDon") == 0)
- {
- format(string, sizeof(string), "You must wait (%d) seconds before starting another route!", GetPVarInt(playerid, "JobReduce"));
- SCM(playerid, COLOR_LIGHTRED, string);
- return true;
- }
- new veh;
- veh = CreateVehicle(JobInfo[foundid][jVehicleID], JobInfo[foundid][jVX], JobInfo[foundid][jVY], JobInfo[foundid][jVZ], JobInfo[foundid][jVA], -1, -1, -1);
- Iter_Add(Vehicle, veh);
- VehicleInfo[veh][vFuel]=100, VehicleInfo[veh][vEngine]=1;
- VehicleInfo[veh][vWindows]=0, VehicleInfo[veh][vID]=0;
- VehicleInfo[veh][vLights]=0, VehicleInfo[veh][vCreated]=1;
- VehicleInfo[veh][vType] = VEHICLE_JOB, VehicleInfo[veh][vJob]=GetPVarInt(playerid, "Job");
- VehicleInfo[veh][vLights] = 0, VehicleInfo[veh][vLock] = 0;
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(veh,engine,lights,alarm,0,bonnet,boot,objective);
- SetVehicleNumberPlate(veh, "JOB");
- SetVehicleToRespawn(veh);
- SetPVarInt(playerid, "RouteVeh", veh);
- foreach(new i : Player) { SetVehicleParamsForPlayer(veh, i, 0, 1); }
- TogglePlayerControllableEx(playerid, false);
- SetTimerEx("ForceInVeh", 1000, false, "ifff", playerid, veh);
- TogglePlayerAllDynamicCPs(playerid, false);
- }
- case 1:
- {
- if(GetPVarInt(playerid, "OnRoute") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not on a route!");
- DeletePVar(playerid, "OnRoute");
- DeletePVar(playerid, "RouteOT");
- if(GetPVarInt(playerid, "RouteVeh") >= 1) { DespawnVehicle(GetPVarInt(playerid, "RouteVeh")); }
- DeletePVar(playerid, "RouteVeh");
- DeletePVar(playerid, "PizzaTime");
- DeletePVar(playerid, "PizzaTimeEx");
- SendClientMessage(playerid, COLOR_WHITE, "Route ended!");
- DisablePlayerCheckpoint(playerid);
- TogglePlayerAllDynamicCPs(playerid, true);
- }
- case 2:
- {
- if(GetPVarInt(playerid, "OnRoute") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently on a route!");
- SetPVarInt(playerid, "Job", 0);
- SendClientMessage(playerid, COLOR_WHITE, "You are now unemployed!");
- }
- }
- }
- case 5: // Accept Job Dialog
- {
- if(!response) return true;
- new foundid = -1;
- for(new jb = 0; jb < MAX_JOBS; jb++)
- {
- if(JobInfo[jb][jID] >= 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, JobInfo[jb][jX], JobInfo[jb][jY], JobInfo[jb][jZ]))
- {
- foundid=jb;
- break;
- }
- }
- }
- if(foundid == -1) return true;
- if(GetPVarInt(playerid, "Job") != 0) return true;
- format(string, sizeof(string), "Congratulations you are now a %s!", JobInfo[foundid][jName]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- SendClientMessage(playerid, COLOR_WHITE, "To navigate your job, press ~k~~GROUP_CONTROL_BWD~ at the job icon.");
- SetPVarInt(playerid, "Job", foundid+1);
- }
- case 6: // DMV LICENSE TEST
- {
- if(!response) return true;
- if(GetPVarInt(playerid, "ConnectTime") >= 8) GivePlayerMoneyEx(playerid, -150);
- SetPVarInt(playerid, "TakeTest", 1);
- new veh, rand = random(sizeof(gRentalIDs));
- veh = CreateVehicle(gRentalIDs[rand][0], DMVSpot[0][3], DMVSpot[0][4], DMVSpot[0][5], DMVSpot[0][6], 6, 6, -1);
- Iter_Add(Vehicle, veh);
- VehicleInfo[veh][vFuel]=100, VehicleInfo[veh][vEngine]=1;
- VehicleInfo[veh][vWindows]=0, VehicleInfo[veh][vID]=0;
- VehicleInfo[veh][vLights]=0, VehicleInfo[veh][vCreated]=1;
- VehicleInfo[veh][vType] = VEHICLE_DMV, VehicleInfo[veh][vJob]=0;
- SetVehicleNumberPlate(veh, "DMV");
- SetVehicleToRespawn(veh);
- SetPVarInt(playerid, "TestVeh", veh);
- foreach(new i : Player) { SetVehicleParamsForPlayer(veh, i, 0, 1); }
- TogglePlayerControllableEx(playerid, false);
- SetTimerEx("ForceInVeh", 1000, false, "ifff", playerid, veh);
- SetPlayerRaceCheckpoint(playerid, 0, DMVRoute[0][0], DMVRoute[0][1], DMVRoute[0][2], DMVRoute[1][0], DMVRoute[1][1], DMVRoute[1][2], 5.0);
- SendClientMessage(playerid,COLOR_LIGHTBLUE," ");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"---------------------------------------------------------------");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Los Santos Department Of Motor Vehicles");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"---------------------------------------------------------------");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Once you enter the checkpoint on your GPS the test will start,");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Keep your vehicle under 95 KPH and make sure to not go too quick or too slow.");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Also make sure your vehicle is not damaged and is in good shape,");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Judging by your status you are capable of earning a (Gold, Silver, Bronze) ribbon.");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"---------------------------------------------------------------");
- }
- //==========//
- case 7: // STORE DIALOG
- {
- if(!response) return true;
- SetPVarInt(playerid, "PDBT", 1), SetPVarInt(playerid, "PDBTLI", listitem);
- format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", StoreItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
- ConfigPayment(playerid, 1, string);
- }
- //==========//
- case 8: // Burger DIALOG
- {
- if(!response) return true;
- SetPVarInt(playerid, "PDBT", 2), SetPVarInt(playerid, "PDBTLI", listitem);
- format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", BurgerItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
- ConfigPayment(playerid, 1, string);
- }
- //==========//
- case 9: // Pizza DIALOG
- {
- if(!response) return true;
- SetPVarInt(playerid, "PDBT", 3), SetPVarInt(playerid, "PDBTLI", listitem);
- format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", PizzaItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
- ConfigPayment(playerid, 1, string);
- }
- //==========//
- case 10: // Cluck DIALOG
- {
- if(!response) return true;
- SetPVarInt(playerid, "PDBT", 4), SetPVarInt(playerid, "PDBTLI", listitem);
- format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", CluckItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
- ConfigPayment(playerid, 1, string);
- }
- //==========//
- case 11:
- {
- switch(response)
- {
- case 1:
- {
- switch(listitem)
- {
- case 0: SendBankDialog(playerid, 1);
- case 1: SendBankDialog(playerid, 2);
- case 2:
- {
- if(GetPVarInt(playerid, "CheckEarn") <= 0)
- {
- SetPVarInt(playerid, "OCC", 0);
- return SendClientMessage(playerid,COLOR_WHITE,"You have no checks to cash.");
- }
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- format(sendername, sizeof(sendername), "%s", PlayerName(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "* Bank Clerk hands the $%d to %s.", GetPVarInt(playerid, "CheckEarn"), sendername);
- SendClientMessage(playerid,COLOR_PURPLE,string);
- GivePlayerMoneyEx(playerid,GetPVarInt(playerid, "CheckEarn"));
- DeletePVar(playerid,"CheckEarn");
- OnPlayerDataSave(playerid);
- }
- }
- }
- }
- }
- case 12: // Bank Deposit dialog
- {
- switch(response)
- {
- case 0:
- {
- format(string, sizeof(string), "Bank Account: $%d", GetPVarInt(playerid, "Bank"));
- ShowPlayerDialog(playerid,11,DIALOG_STYLE_LIST,string,"{33FF66}Deposit\n{33FF66}Withdraw", "Continue", "Exit");
- }
- case 1:
- {
- if(!strlen(inputtext)) return SendBankDialog(playerid, 1);
- if(strlen(inputtext) >= 7) return SendBankDialog(playerid, 1);
- new amount = strval(inputtext);
- if(amount <= 0) return SendBankDialog(playerid, 1);
- if(amount >= 99999999) return SendBankDialog(playerid, 1);
- if(GetPlayerMoneyEx(playerid) >= amount)
- {
- PlayerPlaySound(playerid,1055, 0.0, 0.0, 0.0);
- GivePlayerMoneyEx(playerid,-amount);
- new current = GetPVarInt(playerid, "Bank");
- SetPVarInt(playerid, "Bank", amount+GetPVarInt(playerid, "Bank"));
- SendClientMessage(playerid, COLOR_GREEN," ");
- SendClientMessage(playerid,COLOR_WHITE,":Bank Statement:");
- format(string, sizeof(string), "Deposit: $%d", amount);
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string), "Old Balance: $%d", current);
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string), "New Balance: $%d", GetPVarInt(playerid, "Bank"));
- SendClientMessage(playerid, COLOR_GREEN, string);
- SetPVarInt(playerid, "OCC", 0);
- }
- else SendBankDialog(playerid, 1);
- }
- }
- }
- case 13: // BANK Withdraw dialog
- {
- switch(response)
- {
- case 0:
- {
- format(string, sizeof(string), "Bank Account: $%d", GetPVarInt(playerid, "Bank"));
- ShowPlayerDialog(playerid,11,DIALOG_STYLE_LIST,string,"{33FF66}Deposit\n{33FF66}Withdraw", "Continue", "Exit");
- }
- case 1:
- {
- if(!strlen(inputtext)) return SendBankDialog(playerid, 2);
- if(strlen(inputtext) >= 7) return SendBankDialog(playerid, 2);
- new amount = strval(inputtext);
- if(amount <= 0) return SendBankDialog(playerid, 2);
- if(amount >= 99999999) return SendBankDialog(playerid, 2);
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- if(GetPVarInt(playerid, "Bank") >= amount)
- {
- PlayerPlaySound(playerid,1055, 0.0, 0.0, 0.0);
- GivePlayerMoneyEx(playerid,amount);
- new current = GetPVarInt(playerid, "Bank");
- SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank")-amount);
- SendClientMessage(playerid, COLOR_GREEN," ");
- SendClientMessage(playerid,COLOR_WHITE,":Bank Statement:");
- format(string, sizeof(string), "Withdraw: $%d", amount);
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string), "Old Balance: $%d", current);
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string), "New Balance: $%d", GetPVarInt(playerid, "Bank"));
- SendClientMessage(playerid, COLOR_GREEN, string);
- SetPVarInt(playerid, "OCC", 0);
- }
- else SendBankDialog(playerid, 2);
- }
- }
- }
- case 14: // ATM Withdraw dialog
- {
- switch(response)
- {
- case 1:
- {
- if(!strlen(inputtext)) return SendBankDialog(playerid, 3);
- if(strlen(inputtext) >= 7) return SendBankDialog(playerid, 3);
- new amount = strval(inputtext);
- if(amount <= 0) return SendBankDialog(playerid, 3);
- if(amount >= 99999999) return SendBankDialog(playerid, 3);
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- if(GetPVarInt(playerid, "Bank") >= amount)
- {
- PlayerPlaySound(playerid,1055, 0.0, 0.0, 0.0);
- GivePlayerMoneyEx(playerid,amount);
- new current = GetPVarInt(playerid, "Bank");
- SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank")-amount);
- SendClientMessage(playerid, COLOR_GREEN," ");
- SendClientMessage(playerid,COLOR_WHITE,":Bank Statement:");
- format(string, sizeof(string), "Withdraw: $%d", amount);
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string), "Old Balance: $%d", current);
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string), "New Balance: $%d", GetPVarInt(playerid, "Bank"));
- SendClientMessage(playerid, COLOR_GREEN, string);
- SetPVarInt(playerid, "OCC", 0);
- }
- else SendBankDialog(playerid, 3);
- }
- }
- }
- case 15: // Gas Liters
- {
- if(!response) return true;
- if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return true;
- if(!strlen(inputtext)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid liter amount!");
- if(strlen(inputtext) >= 7) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid liter amount!");
- new amount = strval(inputtext), amountcheck, price;
- if(amount <= 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid liter amount!");
- if(amount >= 101) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid liter amount!");
- amountcheck = amount + VehicleInfo[GetPlayerVehicleID(playerid)][vFuel];
- if(amountcheck >= 101) return SendClientMessage(playerid, COLOR_LIGHTRED, "Your car can't hold this much more fuel!");
- new gasType = GasType(GetVehicleModel(GetPlayerVehicleID(playerid)));
- price = amount*GasPrice[gasType];
- if(GetPVarInt(playerid, "DonateRank") >= 2) price = 0;
- if(GetPVarInt(playerid, "Member") == 1 || GetPVarInt(playerid, "Member") == 2 || GetPVarInt(playerid, "Member") == 8) price = 0;
- if(GetPlayerMoneyEx(playerid) >= price)
- {
- TogglePlayerControllable(playerid, false);
- ProgressBar(playerid, "Refueling car...", 1*(amount/2), 0);
- SetTimerEx("DoFillUp", 1000*(amount/2), false, "iii", playerid, amount, price);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- }
- //==========//
- case 17:
- {
- if(!response) return true;
- new str[4848], tit[128];
- format(tit, 128, "%s", HelpMenu[listitem][0]);
- switch(listitem)
- {
- case 0:
- {
- for(new i = 0; i < sizeof(GenHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", GenHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, GenHelp[i][0]); }
- }
- }
- case 1:
- {
- for(new i = 0; i < sizeof(ConHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", ConHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, ConHelp[i][0]); }
- }
- }
- case 2:
- {
- for(new i = 0; i < sizeof(AnimHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", AnimHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, AnimHelp[i][0]); }
- }
- }
- case 3:
- {
- for(new i = 0; i < sizeof(VehHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", VehHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, VehHelp[i][0]); }
- }
- }
- case 4:
- {
- for(new i = 0; i < sizeof(HouseHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", HouseHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, HouseHelp[i][0]); }
- }
- }
- case 5:
- {
- for(new i = 0; i < sizeof(BizzHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", BizzHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, BizzHelp[i][0]); }
- }
- }
- case 6:
- {
- for(new i = 0; i < sizeof(BasketHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", BasketHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, BasketHelp[i][0]); }
- }
- }
- case 7:
- {
- for(new i = 0; i < sizeof(FactHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", FactHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, FactHelp[i][0]); }
- }
- }
- case 8:
- {
- if(GetPVarInt(playerid, "Member") != 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a police officer!");
- for(new i = 0; i < sizeof(LSPDHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", LSPDHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, LSPDHelp[i][0]); }
- }
- }
- case 9:
- {
- if(GetPVarInt(playerid, "Member") != 2) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a member of the LSFD!");
- for(new i = 0; i < sizeof(LSFDHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", LSFDHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, LSFDHelp[i][0]); }
- }
- }
- case 10:
- {
- if(GetPVarInt(playerid, "Member") != 4 && GetPVarInt(playerid, "Member") != 3) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in San News or RLS!");
- for(new i = 0; i < sizeof(NewsHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", NewsHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, NewsHelp[i][0]); }
- }
- }
- case 11:
- {
- if(GetPVarInt(playerid, "Reg") < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a registration moderator!");
- for(new i = 0; i < sizeof(RegiHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", RegiHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, RegiHelp[i][0]); }
- }
- }
- case 12:
- {
- if(GetPVarInt(playerid, "Admin") == 0 && GetPVarInt(playerid, "Helper") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not an admin!");
- for(new i = 0; i < sizeof(StaffHelp); i++)
- {
- if(i == 0) { format(str, sizeof(str), "%s", StaffHelp[i][0]); }
- else { format(str, sizeof(str), "%s\n%s", str, StaffHelp[i][0]); }
- }
- }
- case 13:
- {
- if(GetPVarInt(playerid, "Admin") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not an administrator!");
- new count;
- for(new i = 1; i <= 10; i++) {
- count = 0;
- if(i == 1) {
- format(str, sizeof(str), "{FFFFFF}Commands for {CD5C5C}Level %i {FFFFFF}Administrators:{a9c4e4}\n", i);
- } else {
- format(str, sizeof(str), "%s\n\n{FFFFFF}Commands for {CD5C5C}Level %i {FFFFFF}Administrators:{a9c4e4}\n", str, i);
- }
- for(new j = 0; j < sizeof(AdminCmds); j++) {
- if(AdminCmds[j][acRank] == i) {
- count++;
- if(count % 10 == 0) {
- format(str, sizeof(str), "%s\n/%s", str, AdminCmds[j][acCmd]);
- } else {
- if(count % 10 != 0 && count != 1) {
- format(str, sizeof(str), "%s, /%s", str, AdminCmds[j][acCmd]);
- } else {
- format(str, sizeof(str), "%s/%s", str, AdminCmds[j][acCmd]);
- }
- }
- }
- }
- if(count == 0) { format(str, sizeof(str), "%sNone.", str); }
- }
- }
- }
- ShowPlayerDialog(playerid, 18, DIALOG_STYLE_MSGBOX, tit, str, "Go Back", "");
- }
- case 18:
- {
- if(!response) return true;
- cmd_help(playerid, "");
- }
- case 19: // Fightstyle
- {
- switch(response)
- {
- case 1: // Selecting
- {
- switch(listitem)
- {
- case 0: LearnFightstyle(playerid,50,FIGHT_STYLE_NORMAL,"Normal");
- case 1: LearnFightstyle(playerid,500,FIGHT_STYLE_BOXING,"Boxing");
- case 2: LearnFightstyle(playerid,3000,FIGHT_STYLE_KUNGFU,"KungFu");
- case 3:
- {
- if(GetPVarInt(playerid, "ConnectTime") >= 250)
- {
- LearnFightstyle(playerid,6000,FIGHT_STYLE_KNEEHEAD,"KneeHead");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "You need 250+ hours played to purchase this fight style!");
- }
- case 4: LearnFightstyle(playerid,8000,FIGHT_STYLE_GRABKICK,"GrabKick");
- case 5:
- {
- if(GetPVarInt(playerid, "ConnectTime") >= 250)
- {
- LearnFightstyle(playerid,10000,FIGHT_STYLE_ELBOW,"Elbow Attack");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "You need 250+ hours played to purchase this fight style!");
- }
- }
- }
- }
- }
- //==========//
- case 20: // AMMU DIALOG
- {
- if(!response) return true;
- SetPVarInt(playerid, "PDBT", 5), SetPVarInt(playerid, "PDBTLI", listitem);
- format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d | Cash: $%d", AmmuItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
- ConfigPayment(playerid, 1, string);
- }
- //==========//
- case 21:
- {
- new id = 18645;
- switch(listitem)
- {
- case 0: id = 18645;
- case 1: id = 18976;
- case 2: id = 18977;
- case 3: id = 18978;
- case 4: id = 18979;
- }
- switch(GetPlayerSkin(playerid))
- {
- #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH1, id, 2, (%0), (%1), (%2), (%3), (%4), (%5));
- case 0, 65, 74, 149, 208, 273: SPAO{0.070000, 0.0, 0.0, 88.0, 75.0, 0.0}
- case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.0, 0.0, 88.0, 77.0, 0.0}
- case 7, 10: SPAO{0.090000, 0.019999, 0.0, 88.0, 90.0, 0.0}
- case 9: SPAO{0.059999, 0.019999, 0.0, 88.0, 90.0, 0.0}
- case 11..13: SPAO{0.070000, 0.019999, 0.0, 88.0, 90.0, 0.0}
- case 15: SPAO{0.059999, 0.0, 0.0, 88.0, 82.0, 0.0}
- case 17..21: SPAO{0.059999, 0.019999, 0.0, 88.0, 82.0, 0.0}
- case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.0, 88.0, 82.0, 0.0}
- case 40: SPAO{0.050000, 0.009999, 0.0, 88.0, 82.0, 0.0}
- case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.0, 88.0, 82.0, 0.0}
- case 51..54: SPAO{0.100000, 0.009999, 0.0, 88.0, 82.0, 0.0}
- case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.0, 88.0, 82.0, 0.0}
- case 59..62: SPAO{0.079999, 0.029999, 0.0, 88.0, 82.0, 0.0}
- case 77: SPAO{0.059999, 0.019999, 0.0, 87.0, 82.0, 0.0}
- case 85, 88, 89: SPAO{0.070000, 0.039999, 0.0, 88.0, 82.0, 0.0}
- case 90..97: SPAO{0.050000, 0.019999, 0.0, 88.0, 82.0, 0.0}
- case 132: SPAO{0.0, 0.019999, 0.0, 88.0, 82.0, 0.0}
- case 144..146: SPAO{0.090000, 0.0, 0.0, 88.0, 82.0, 0.0}
- case 220: SPAO{0.029999, 0.019999, 0.0, 88.0, 82.0, 0.0}
- case 223, 246: SPAO{0.070000, 0.050000, 0.0, 88.0, 82.0, 0.0}
- case 224..245: SPAO{0.070000, 0.029999, 0.0, 88.0, 82.0, 0.0}
- case 294: SPAO{0.070000, 0.019999, 0.0, 91.0, 84.0, 0.0}
- case 295: SPAO{0.050000, 0.019998, 0.0, 86.0, 82.0, 0.0}
- case 296..298: SPAO{0.064999, 0.009999, 0.0, 88.0, 82.0, 0.0}
- case 299: SPAO{0.064998, 0.019999, 0.0, 88.0, 82.0, 0.0}
- }
- }
- case 22: // BAR DIALOG
- {
- if(!response) return true;
- SetPVarInt(playerid, "PDBT", 6), SetPVarInt(playerid, "PDBTLI", listitem);
- format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", BarItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
- ConfigPayment(playerid, 1, string);
- }
- //==========//
- case 25: // MOD SHOP DIALOG
- {
- switch(GetPVarInt(playerid, "VEHSEC"))
- {
- case 0:
- {
- if(!response) // EXIT MOD SHOP
- {
- new id = GetPVarInt(playerid, "VEHMODID");
- new idcar = GetPlayerVehicleID(playerid);
- DeletePVar(playerid, "VEHMOD"), DeletePVar(playerid, "VEHMODKEY");
- SetVehiclePosEx(idcar, ModShop[id][0], ModShop[id][1], ModShop[id][2]);
- foreach(new i : Player)
- {
- if(GetPlayerVehicleID(i) == idcar)
- {
- if(i != playerid) SetPVarInt(i, "SeatIDm", GetPlayerVehicleSeat(i));
- TogglePlayerControllableEx(i, true);
- SetVehicleVirtualWorldEx(idcar, 0);
- SetPlayerVirtualWorld(i, 0);
- if(i != playerid) PutPlayerInVehicleEx(i, idcar, GetPVarInt(i, "SeatIDm"));
- SetCameraBehindPlayer(i);
- }
- }
- return true;
- }
- SetPVarInt(playerid, "VEHSEC", listitem+1);
- CallRemoteFunction("VehMod", "i", playerid);
- }
- case 1: // SELECT COLOR 1
- {
- if(!response) // RETURN TO MENU
- {
- SetPVarInt(playerid, "VEHSEC", 0);
- CallRemoteFunction("VehMod", "i", playerid);
- return true;
- }
- if(!strlen(inputtext)) return CallRemoteFunction("VehMod", "i", playerid);
- if(strlen(inputtext) >= 7) return CallRemoteFunction("VehMod", "i", playerid);
- new amount = strval(inputtext);
- if(amount < 0) return CallRemoteFunction("VehMod", "i", playerid);
- if(amount > 300) return CallRemoteFunction("VehMod", "i", playerid);
- new cost = 500;
- if(GetPVarInt(playerid, "DonateRank") >= 2) cost = 0;
- if(GetPlayerMoneyEx(playerid) >= cost)
- {
- new key = GetPVarInt(playerid, "VEHMODKEY"), query[65];
- GivePlayerMoneyEx(playerid, -cost);
- VehicleInfo[key][vColorOne]=amount;
- ChangeVehicleColor(GetPlayerVehicleID(playerid), VehicleInfo[key][vColorOne], VehicleInfo[key][vColorTwo]);
- CallRemoteFunction("VehMod", "i", playerid);
- format(string, 128, "ColorID %d purchased !", amount);
- SCM(playerid, COLOR_WHITE, string);
- mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `ColorOne` = %i WHERE `ID` = %i;", VehicleInfo[key][vColorOne], VehicleInfo[key][vID]);
- mysql_tquery(handlesql, query);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds !"), CallRemoteFunction("VehMod", "i", playerid);
- }
- case 2: // SELECT COLOR 2
- {
- if(!response) // RETURN TO MENU
- {
- SetPVarInt(playerid, "VEHSEC", 0);
- CallRemoteFunction("VehMod", "i", playerid);
- return true;
- }
- if(!strlen(inputtext)) return CallRemoteFunction("VehMod", "i", playerid);
- if(strlen(inputtext) >= 7) return CallRemoteFunction("VehMod", "i", playerid);
- new amount = strval(inputtext);
- if(amount < 0) return CallRemoteFunction("VehMod", "i", playerid);
- if(amount > 300) return CallRemoteFunction("VehMod", "i", playerid);
- new cost = 500;
- if(GetPVarInt(playerid, "DonateRank") >= 2) cost = 0;
- if(GetPlayerMoneyEx(playerid) >= cost)
- {
- new key = GetPVarInt(playerid, "VEHMODKEY"), query[65];
- GivePlayerMoneyEx(playerid, -cost);
- VehicleInfo[key][vColorTwo]=amount;
- ChangeVehicleColor(GetPlayerVehicleID(playerid), VehicleInfo[key][vColorOne], VehicleInfo[key][vColorTwo]);
- CallRemoteFunction("VehMod", "i", playerid);
- format(string, 128, "ColorID %d purchased !", amount);
- SCM(playerid, COLOR_WHITE, string);
- mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `ColorTwo` = %i WHERE `ID` = %i;", VehicleInfo[key][vColorTwo], VehicleInfo[key][vID]);
- mysql_tquery(handlesql, query);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds !"), CallRemoteFunction("VehMod", "i", playerid);
- }
- case 3: // SELECT WHEELS
- {
- if(!response) // RETURN TO MENU
- {
- SetPVarInt(playerid, "VEHSEC", 0);
- CallRemoteFunction("VehMod", "i", playerid);
- return true;
- }
- ShowWheels(playerid);
- }
- case 4: // BODY MODS
- {
- if(!response) // RETURN TO MENU
- {
- SetPVarInt(playerid, "VEHSEC", 0);
- CallRemoteFunction("VehMod", "i", playerid);
- return true;
- }
- new key = GetPVarInt(playerid, "VEHMODKEY");
- new price = 0;
- if(GetPVarInt(playerid, "DonateRank") == 0) price = 1000;
- if(GetPlayerMoneyEx(playerid) >= price)
- {
- new comp[20], compname[20][128];
- comp[0]=1087, compname[0]="Hydraulics";
- switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
- {
- case 534: // REMMINGTON
- {
- comp[1]=1100, compname[1]="Bullbar Chrome Grill";
- comp[2]=1101, compname[2]="Sideskirt Left `Chrome Flames`";
- comp[3]=1106, compname[3]="Sideskirt Right `Chrome Arches`";
- comp[4]=1122, compname[4]="Sideskirt Right `Chrome Flames`";
- comp[5]=1123, compname[5]="Bullbars Bullbar Chrome Bars";
- comp[6]=1124, compname[6]="Sideskirt Left `Chrome Arches`";
- comp[7]=1125, compname[7]="Bullbars Bullbar Chrome Lights";
- comp[8]=1126, compname[8]="Exhaust Chrome Exhaust";
- comp[9]=1127, compname[9]="Exhaust Slamin Exhaust";
- comp[10]=1178, compname[10]="Rear Bumper Slamin";
- comp[11]=1179, compname[11]="Front Bumper Chrome";
- comp[12]=1180, compname[12]="Rear Bumper Chrome";
- comp[13]=1185, compname[13]="Front Bumper Slamin";
- }
- case 535: // SLAMVAN
- {
- comp[1]=1109, compname[1]="Rear Bullbars Chrome";
- comp[2]=1110, compname[2]="Rear Bullbars Slamin";
- comp[3]=1111, compname[3]="Front Sign?Little Sign?";
- comp[4]=1112, compname[4]="Front Sign?Little Sign?";
- comp[5]=1113, compname[5]="Exhaust Chrome";
- comp[6]=1114, compname[6]="Exhaust Slamin";
- comp[7]=1115, compname[7]="Front Bullbars Chrome";
- comp[8]=1116, compname[8]="Front Bullbars Slamin";
- comp[9]=1117, compname[9]="Front Bumper Chrome";
- comp[10]=1118, compname[10]="Sideskirt Right `Chrome Trim`";
- comp[11]=1119, compname[11]="Sideskirt Right `Wheelcovers`";
- comp[12]=1120, compname[12]="Sideskirt Left `Chrome Trim`";
- comp[13]=1121, compname[13]="Sideskirt Left `Wheelcovers`";
- }
- case 536: // BLADE
- {
- comp[1]=1103, compname[1]="Roof Covertible";
- comp[2]=1104, compname[2]="Exhaust Chrome";
- comp[3]=1105, compname[3]="Exhaust Slamin";
- comp[4]=1107, compname[4]="Sideskirt Left `Chrome Strip`";
- comp[5]=1108, compname[5]="Sideskirt Right `Chrome Strip`";
- comp[6]=1128, compname[6]="RoofVinyl Hardtop";
- comp[7]=1181, compname[7]="Front Bumper Slamin";
- comp[8]=1182, compname[8]="Front Bumper Chrome";
- comp[9]=1183, compname[9]="Rear Bumper Slamin";
- comp[10]=1184, compname[10]="Rear Bumper Chrome";
- }
- case 567: // SAVANNA
- {
- comp[1]=1102, compname[1]="Sideskirt Left `Chrome Strip`";
- comp[2]=1129, compname[2]="Exhaust Chrome";
- comp[3]=1130, compname[3]="Roof Hardtop";
- comp[4]=1131, compname[4]="Roof Softtop";
- comp[5]=1132, compname[5]="Exhaust Slamin";
- comp[6]=1133, compname[6]="Sideskirt Right `Chrome Strip`";
- comp[7]=1186, compname[7]="Rear Bumper Slamin";
- comp[8]=1187, compname[8]="Rear Bumper Chrome";
- comp[9]=1188, compname[9]="Front Bumper Slamin";
- comp[10]=1189, compname[10]="Front Bumper Chrome";
- }
- case 558: // URANUS
- {
- comp[1]=1088, compname[1]="Roof Alien";
- comp[2]=1089, compname[2]="Exhaust X-Flow";
- comp[3]=1090, compname[3]="SideskirtRight Alien";
- comp[4]=1091, compname[4]="RoofX-Flow";
- comp[5]=1092, compname[5]="Exhaust Alien";
- comp[6]=1093, compname[6]="Sideskirt Left X-Flow";
- comp[7]=1094, compname[7]="Sideskirt Left Alien";
- comp[8]=1095, compname[8]="Sideskirt Right X-Flow";
- comp[9]=1163, compname[9]="SpoilerX-Flow";
- comp[10]=1164, compname[10]="Spoiler Alien";
- comp[11]=1165, compname[11]="Front Bumper X-Flow";
- comp[12]=1166, compname[12]="Front Bumper Alien";
- comp[13]=1167, compname[13]="Rear Bumper X-Flow";
- comp[14]=1168, compname[14]="Rear Bumper Alien";
- }
- case 559: // JESTER
- {
- comp[1]=1065, compname[1]="Exhaust Alien";
- comp[2]=1066, compname[2]="Exhaust X-Flow";
- comp[3]=1067, compname[3]="Roof Alien";
- comp[4]=1068, compname[4]="Roof X-Flow";
- comp[5]=1069, compname[5]="Right Alien Sideskirt";
- comp[6]=1070, compname[6]="Right X-Flow Sideskirt";
- comp[7]=1071, compname[7]="Left Alien Sideskirt";
- comp[8]=1072, compname[8]="Left X-Flow Sideskirt";
- comp[9]=1158, compname[9]="SpoilerX-Flow";
- comp[10]=1159, compname[10]="Rear BumperAlien";
- comp[11]=1160, compname[11]="Front BumperAlien";
- comp[12]=1161, compname[12]="Rear BumperX-Flow";
- comp[13]=1162, compname[13]="Spoiler Alien";
- comp[14]=1173, compname[14]="Front BumperX-Flow";
- }
- case 560: // SULTAN
- {
- comp[1]=1026, compname[1]="Sideskirt Right Alien";
- comp[2]=1027, compname[2]="Sideskirt Left Alien";
- comp[3]=1028, compname[3]="Exhaust Alien";
- comp[4]=1029, compname[4]="Exhaust X-Flow";
- comp[5]=1030, compname[5]="Sideskirt Left X-Flow";
- comp[6]=1031, compname[6]="Sideskirt Right X-Flow";
- comp[7]=1032, compname[7]="RoofAlien Roof Vent";
- comp[8]=1033, compname[8]="RoofX-Flow Roof Vent";
- comp[9]=1138, compname[9]="Spoiler Alien";
- comp[10]=1139, compname[10]="SpoilerX-Flow";
- comp[11]=1140, compname[11]="Rear BumperX-Flow";
- comp[12]=1141, compname[12]="Rear Bumper Alien";
- comp[13]=1169, compname[13]="Front Bumper Alien";
- comp[14]=1170, compname[14]="Front BumperX-Flow";
- }
- case 561: // stratum
- {
- comp[1]=1055, compname[1]="Roof Alien";
- comp[2]=1056, compname[2]="SideskirtRight Alien";
- comp[3]=1057, compname[3]="SideskirtRight X-Flow";
- comp[4]=1058, compname[4]="Spoiler Alien";
- comp[5]=1059, compname[5]="ExhaustX-Flow";
- comp[6]=1060, compname[6]="SpoilerX-Flow";
- comp[7]=1061, compname[7]="RoofX-Flow";
- comp[8]=1062, compname[8]="SideskirtLeft Alien";
- comp[9]=1063, compname[9]="SideskirtLeft X-Flow";
- comp[10]=1064, compname[10]="Exhaust Alien";
- comp[11]=1154, compname[11]="Rear BumperAlien";
- comp[12]=1155, compname[12]="Front BumperAlien";
- comp[13]=1156, compname[13]="Rear BumperX-Flow";
- comp[14]=1157, compname[14]="Front BumperX-Flow";
- }
- case 562: // elegy
- {
- comp[1]=1034, compname[1]="Exhaust Alien";
- comp[2]=1035, compname[2]="RoofX-Flow Roof Vent";
- comp[3]=1036, compname[3]="SideSkirt Right Alien";
- comp[4]=1037, compname[4]="ExhaustX-Flow";
- comp[5]=1038, compname[5]="RoofAlien Roof Vent";
- comp[6]=1039, compname[6]="SideSkirtLeft X-Flow";
- comp[7]=1040, compname[7]="SideSkirtLeft Alien";
- comp[8]=1041, compname[8]="SideSkirtRight X-Flow";
- comp[9]=1146, compname[9]="SpoilerX-Flow";
- comp[10]=1147, compname[10]="Spoiler Alien";
- comp[11]=1148, compname[11]="Rear BumperX-Flow";
- comp[12]=1149, compname[12]="Rear BumperAlien";
- comp[13]=1171, compname[13]="Front BumperAlien";
- comp[14]=1172, compname[14]="Front BumperX-Flow";
- }
- case 565: // flash
- {
- comp[1]=1045, compname[1]="ExhaustX-Flow";
- comp[2]=1046, compname[2]="Exhaust Alien";
- comp[3]=1047, compname[3]="SideSkirtRight Alien";
- comp[4]=1048, compname[4]="SideSkirtRight X-Flow";
- comp[5]=1049, compname[5]="Spoiler Alien";
- comp[6]=1050, compname[6]="Spoiler X-Flow";
- comp[7]=1051, compname[7]="SideSkirtLeft Alien";
- comp[8]=1052, compname[8]="SideSkirtLeft X-Flow";
- comp[9]=1053, compname[9]="RoofX-Flow";
- comp[10]=1054, compname[10]="Roof Alien";
- comp[11]=1150, compname[11]="Bumper Alien";
- comp[12]=1151, compname[12]="BumperX-Flow";
- comp[13]=1152, compname[13]="BumperX-Flow";
- comp[14]=1153, compname[14]="Bumper Alien";
- }
- case 575: // broadway
- {
- comp[1]=1042, compname[1]="SideSkirt Right Chrome";
- comp[2]=1043, compname[2]="Exhaust Slamin";
- comp[3]=1044, compname[3]="Exhaust Chrome";
- comp[4]=1099, compname[4]="SideskirtLeft Chrome";
- comp[5]=1174, compname[5]="Front Bumper Chrome";
- comp[6]=1175, compname[6]="Rear Bumper Slamin";
- comp[7]=1176, compname[7]="Front Bumper Chrome";
- comp[8]=1177, compname[8]="Rear Bumper Slamin";
- }
- case 576: // tornado
- {
- comp[1]=1134, compname[1]="SideSkirt Right `Chrome Strip`";
- comp[2]=1135, compname[2]="Exhaust Slamin";
- comp[3]=1136, compname[3]="Exhaust Chrome";
- comp[4]=1137, compname[4]="SideskirtLeft `Chrome Strip`";
- comp[5]=1190, compname[5]="Front Bumper Slamin";
- comp[6]=1191, compname[6]="Front Bumper Chrome";
- comp[7]=1192, compname[7]="Rear Bumper Chrome";
- comp[8]=1193, compname[8]="Rear Bumper Slamin";
- }
- }
- new query[300];
- key = GetPVarInt(playerid, "VEHMODKEY");
- GivePlayerMoneyEx(playerid, -price);
- AddVehicleComponent(GetPlayerVehicleID(playerid), comp[listitem]);
- format(string, 128, "%s purchased for $%d!", compname[listitem], price);
- SCM(playerid, COLOR_WHITE, string);
- CallRemoteFunction("VehMod", "i", playerid);
- PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
- AddVehMod(key, comp[listitem]);
- mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `Mod1` = %i, `Mod2` = %i, `Mod3` = %i, `Mod4` = %i, `Mod5` = %i, `Mod6` = %i, `Mod7` = %i, \
- `Mod8` = %i, `Mod9` = %i, `Mod10` = %i, `Mod11` = %i WHERE `ID` = %i;",
- VehicleInfo[key][vMod][0], VehicleInfo[key][vMod][1], VehicleInfo[key][vMod][2], VehicleInfo[key][vMod][3], VehicleInfo[key][vMod][4], VehicleInfo[key][vMod][5],
- VehicleInfo[key][vMod][6], VehicleInfo[key][vMod][7], VehicleInfo[key][vMod][8], VehicleInfo[key][vMod][9], VehicleInfo[key][vMod][10], VehicleInfo[key][vID]);
- mysql_tquery(handlesql, query);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds !"), CallRemoteFunction("VehMod", "i", playerid);
- }
- case 5: // REMOVE MODS
- {
- new found, query[300];
- key = GetPVarInt(playerid, "VEHMODKEY");
- for(new i = 1; i < 10; i++)
- {
- if(VehicleInfo[key][vMod][i] >= 1000 && VehicleInfo[key][vMod][i] <= 1193)
- {
- RemoveVehicleComponent(GetPlayerVehicleID(playerid), VehicleInfo[key][vMod][i]);
- found++;
- VehicleInfo[key][vMod][i]=0;
- }
- }
- format(string, 128, "%d components removed !", found);
- SCM(playerid, COLOR_WHITE, string);
- PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
- mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `Mod1` = %i, `Mod2` = %i, `Mod3` = %i, `Mod4` = %i, `Mod5` = %i, `Mod6` = %i, `Mod7` = %i, \
- `Mod8` = %i, `Mod9` = %i, `Mod10` = %i, `Mod11` = %i WHERE `ID` = %i;",
- VehicleInfo[key][vMod][0], VehicleInfo[key][vMod][1], VehicleInfo[key][vMod][2], VehicleInfo[key][vMod][3], VehicleInfo[key][vMod][4], VehicleInfo[key][vMod][5],
- VehicleInfo[key][vMod][6], VehicleInfo[key][vMod][7], VehicleInfo[key][vMod][8], VehicleInfo[key][vMod][9], VehicleInfo[key][vMod][10], VehicleInfo[key][vID]);
- mysql_tquery(handlesql, query);
- SetPVarInt(playerid, "VEHSEC", 0);
- CallRemoteFunction("VehMod", "i", playerid);
- }
- }
- }
- //==========//
- case 26:
- {
- format(string, sizeof(string),"%s", PlayerNameEx(playerid));
- switch(response)
- {
- case 0:
- {
- SetPlayerColor(playerid, COLOR_WHITE);
- if(GetPVarInt(playerid, "MaskUse") == 1) Update3DTextLabelText(PlayerTag[playerid], COLOR_WHITE, string);
- }
- case 1:
- {
- SetPlayerColor(playerid, 0x8080FFAA);
- if(GetPVarInt(playerid, "MaskUse") == 1) Update3DTextLabelText(PlayerTag[playerid], 0x8080FFFF, string);
- }
- }
- }
- //==========//
- case 27: // Roadblocks
- {
- switch(response)
- {
- case 1: // Selecting
- {
- new Float:X,Float:Y,Float:Z,Float:A;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid,A);
- RoadBlocks++;
- switch(listitem)
- {
- case 0: RoadBlockObject[RoadBlocks] = CreateDynamicObject(973, X, Y+1, Z, 0, 0, A, 0);
- case 1: RoadBlockObject[RoadBlocks] = CreateDynamicObject(997, X, Y, Z-1, 0, 0, A, 0);
- case 2: RoadBlockObject[RoadBlocks] = CreateDynamicObject(1237, X, Y, Z-1, 0, 0, A, 0);
- case 3: RoadBlockObject[RoadBlocks] = CreateDynamicObject(1282, X, Y, Z-0.5, 0, 0, A, 0);
- case 4: RoadBlockObject[RoadBlocks] = CreateDynamicObject(1422, X, Y, Z-0.5, 0, 0, A, 0);
- case 5: RoadBlockObject[RoadBlocks] = CreateDynamicObject(18646, X, Y, Z-1.0, 0, 0, A, 0);
- case 6: RoadBlockObject[RoadBlocks] = CreateDynamicObject(978, X, Y, Z-0.2, 0, 0, A, 0);
- case 7: RoadBlockObject[RoadBlocks] = CreateDynamicObject(3091, X, Y, Z-0.7, 0, 0, A, 0);
- case 8: RoadBlockObject[RoadBlocks] = CreateDynamicObject(981, X, Y, Z-0.3, 0, 0, A, 0);
- }
- }
- }
- }
- //==========//
- case 28:
- {
- switch(response)
- {
- case 1: // Selecting
- {
- switch(listitem)
- {
- case 0: // LSPD
- {
- ShowPlayerDialog(playerid,29,DIALOG_STYLE_LIST,"Car Color","{33FF66}Black\n{33FF66}Blue\n{33FF66}Green\n{33FF66}Grey", "Select", "");
- SetPVarInt(playerid, "CarType", 1);
- }
- case 1: // SFPD
- {
- if(GetPVarInt(playerid, "Rank") >= 5)
- {
- ShowPlayerDialog(playerid,29,DIALOG_STYLE_LIST,"Car Color","{33FF66}Black\n{33FF66}Blue\n{33FF66}Green\n{33FF66}Grey", "Select", "");
- SetPVarInt(playerid, "CarType", 2);
- }
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 2: // LVPD
- {
- if(GetPVarInt(playerid, "Rank") >= 7)
- {
- ShowPlayerDialog(playerid,29,DIALOG_STYLE_LIST,"Car Color","{33FF66}Black\n{33FF66}Blue\n{33FF66}Green\n{33FF66}Grey", "Select", "");
- SetPVarInt(playerid, "CarType", 3);
- }
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 3: // S.W.A.T Truck
- {
- if(GetPVarInt(playerid, "Rank") >= 5) CreateLSPDVehicle(playerid,427,0,1,"LSPD");
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 4: // Ranger
- {
- if(GetPVarInt(playerid, "Rank") >= 5)
- {
- ShowPlayerDialog(playerid,29,DIALOG_STYLE_LIST,"Car Color","{33FF66}Black\n{33FF66}Blue\n{33FF66}Green\n{33FF66}Grey", "Select", "");
- SetPVarInt(playerid, "CarType", 4);
- }
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 5: // Police Bike
- {
- if(GetPVarInt(playerid, "Rank") >= 2) CreateLSPDVehicle(playerid,523,0,1,"LSPD");
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 6: // Rancher
- {
- if(GetPVarInt(playerid, "Rank") >= 4) CreateLSPDVehicle(playerid,490,0,0,"LSPD");
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 7: // LSPD Chopper
- {
- if(GetPVarInt(playerid, "Rank") >= 3) CreateLSPDVehicle(playerid,497,0,0,"LSPD");
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 8: // WATER TANK
- {
- if(GetPVarInt(playerid, "Rank") >= 3) CreateLSPDVehicle(playerid,601,0,0,"LSPD");
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 9: // Tow Truck
- {
- if(GetPVarInt(playerid, "Rank") >= 2) CreateLSPDVehicle(playerid,525,0,0,"LSPD");
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- }
- }
- }
- }
- //==========//
- case 29:
- {
- switch(listitem)
- {
- case 0: // Black
- {
- switch(GetPVarInt(playerid, "CarType"))
- {
- case 1: CreateLSPDVehicle(playerid,596,0,1,"LSPD");
- case 2: CreateLSPDVehicle(playerid,597,0,1,"LSPD");
- case 3: CreateLSPDVehicle(playerid,598,0,1,"LSPD");
- case 4: CreateLSPDVehicle(playerid,599,0,1,"LSPD");
- }
- }
- case 1: // Blue
- {
- switch(GetPVarInt(playerid, "CarType"))
- {
- case 1: CreateLSPDVehicle(playerid,596,79,1,"LSPD");
- case 2: CreateLSPDVehicle(playerid,597,79,1,"LSPD");
- case 3: CreateLSPDVehicle(playerid,598,79,1,"LSPD");
- case 4: CreateLSPDVehicle(playerid,599,79,1,"LSPD");
- }
- }
- case 2: // Green
- {
- switch(GetPVarInt(playerid, "CarType"))
- {
- case 1: CreateLSPDVehicle(playerid,596,16,1,"LSPD");
- case 2: CreateLSPDVehicle(playerid,597,16,1,"LSPD");
- case 3: CreateLSPDVehicle(playerid,598,16,1,"LSPD");
- case 4: CreateLSPDVehicle(playerid,599,16,1,"LSPD");
- }
- }
- case 3: // Grey
- {
- switch(GetPVarInt(playerid, "CarType"))
- {
- case 1: CreateLSPDVehicle(playerid,596,29,29,"LSPD");
- case 2: CreateLSPDVehicle(playerid,597,29,29,"LSPD");
- case 3: CreateLSPDVehicle(playerid,598,29,29,"LSPD");
- case 4: CreateLSPDVehicle(playerid,599,29,29,"LSPD");
- }
- }
- }
- }
- //==========//
- case 30: // Inventory Menu
- {
- if(!response) return true;
- new chosen = listitem, str[50];
- if(PlayerInfo[playerid][pDelay] > 0) return 1; // Block any fix inv breaks.
- if(chosen == MAX_INV_SLOTS) // STORE WEAPON SECTION !
- {
- if(GetPVarInt(playerid, "JustChosen") == 1) return error(playerid, "You must wait a second.");
- cmd_putgun(playerid, "");
- return true;
- }
- else if(chosen == MAX_INV_SLOTS + 1) // DROP WEAPON SECTION !
- {
- if(GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- if(GetPVarInt(playerid, "LSPD_Ta") == 1) return 1; // Block taser bug.
- if(GetPVarInt(playerid, "JustChosen") == 1) return error(playerid, "You must wait a second.");
- if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_GREY, "You cannot give out weapons when your character has died.");
- if(PlayerInfo[playerid][pPlayerWeapon] == 0) return SendClientMessage(playerid, COLOR_GREY, "You aren't even holding a weapon.");
- if(GetPlayerPing(playerid) >= 500) return SendClientMessage(playerid, COLOR_WHITE, "Your ping is too high to use this!");
- new sweapon, sammo;
- for (new i = 0; i < 9; i++) {
- GetPlayerWeaponData(playerid, i, sweapon, sammo);
- if(sweapon == PlayerInfo[playerid][pPlayerWeapon]) {
- PlayerInfo[playerid][pPlayerAmmo]=sammo;
- }
- }
- if(PlayerInfo[playerid][pPlayerWeapon] >= 22 && PlayerInfo[playerid][pPlayerWeapon] <= 34)
- {
- new amount = PlayerInfo[playerid][pPlayerAmmo], am = 0;
- switch(PlayerInfo[playerid][pPlayerWeapon])
- {
- case 22 .. 24: am=7;
- case 25 .. 27: am=6;
- case 28 .. 32: am=30;
- case 33, 34: am=10;
- }
- if(amount > am)
- {
- switch(PlayerInfo[playerid][pAmmoType])
- {
- case 101: am=14;
- case 107: am=14;
- case 116: am=60;
- case 126: am=80;
- case 127: am=60;
- }
- amount = am;
- }
- PlayerInfo[playerid][pPlayerAmmo]=amount;
- if(PlayerInfo[playerid][pAmmoType] == 0) {
- PlayerInfo[playerid][pPlayerAmmo]=0; }
- }
- new Float:X, Float:Y, Float:Z, pw = PlayerInfo[playerid][pPlayerWeapon];
- GetPlayerPos(playerid, X, Y, Z);
- format(str, 50, "%s dropped!", PrintIName(pw));
- SendClientMessage(playerid, COLOR_WHITE, str);
- if(GetPVarInt(playerid, "Member") != 1 && PlayerInfo[playerid][pPlayerWeapon] != 42 && GetPVarInt(playerid, "Member") != 8)
- {
- CreateLoot(PlayerInfo[playerid][pPlayerWeapon], PlayerInfo[playerid][pPlayerAmmo], PlayerInfo[playerid][pAmmoType], PlayerInfo[playerid][pSerial], X, Y, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
- }
- ResetPlayerWeapons(playerid);
- PlayerInfo[playerid][pPlayerWeapon]=0;
- PlayerInfo[playerid][pPlayerAmmo]=0;
- ResetPlayerWeaponsEx(playerid);
- format(str, 50, "%s dropped his %s", PlayerInfo[playerid][pName], PrintIName(pw));
- WepLog(str);
- SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
- return true;
- }
- else if(chosen == MAX_INV_SLOTS + 2) // STORE AMMO SECTION !
- {
- if(GetPVarInt(playerid, "LSPD_Ta") == 1) return 1; // Block taser bug.
- if(GetPVarInt(playerid, "JustChosen") == 1) return error(playerid, "You must wait a second.");
- if(GetPlayerPing(playerid) >= 500) return SendClientMessage(playerid, COLOR_WHITE, "Your ping is too high to use this!");
- if(CheckInv(playerid) == 1)
- {
- new sweapon, sammo;
- for (new i = 0; i < 9; i++)
- {
- GetPlayerWeaponData(playerid, i, sweapon, sammo);
- if(sweapon == PlayerInfo[playerid][pPlayerWeapon])
- {
- PlayerInfo[playerid][pPlayerAmmo]=sammo;
- }
- }
- if(PlayerInfo[playerid][pPlayerWeapon] >= 22 && PlayerInfo[playerid][pPlayerWeapon] <= 34)
- {
- new amount = PlayerInfo[playerid][pPlayerAmmo], am = 0;
- switch(PlayerInfo[playerid][pPlayerWeapon])
- {
- case 22 .. 24: am=150;
- case 25 .. 27: am=150;
- case 28 .. 32: am=500;
- case 33, 34: am=250;
- }
- if(amount > am) {
- amount = am; }
- }
- ResetPlayerWeapons(playerid);
- GiveInvItem(playerid, PlayerInfo[playerid][pAmmoType], PlayerInfo[playerid][pPlayerAmmo], 0);
- format(str, 50, "%s stored into your inventory!", PrintIName(PlayerInfo[playerid][pAmmoType]));
- SendClientMessage(playerid, COLOR_WHITE, str);
- PlayerInfo[playerid][pPlayerAmmo]=0, PlayerInfo[playerid][pAmmoType]=0;
- SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
- }
- else SendClientMessage(playerid, COLOR_WHITE, "Your inventory is currently full!");
- return true;
- }
- if(GetPVarInt(playerid, "Combining"))
- {
- if(PlayerInfo[playerid][pInvItem][GetPVarInt(playerid, "CombiningChose")] != PlayerInfo[playerid][pInvItem][chosen])
- {
- SendClientMessage(playerid, COLOR_GREY, "You can only combine items of the same type.");
- SetPVarInt(playerid, "Combining", 0);
- SetPVarInt(playerid, "CombiningChose", 0);
- return 1;
- }
- switch(PlayerInfo[playerid][pInvItem][GetPVarInt(playerid, "CombiningChose")])
- {
- case 500, 501, 502, 503, 504, 505, 506, 507:
- {
- if(PlayerInfo[playerid][pInvQ][chosen] + PlayerInfo[playerid][pInvQ][GetPVarInt(playerid, "CombiningChose")] > 100)
- {
- SetPVarInt(playerid, "Combining", 0);
- SetPVarInt(playerid, "CombiningChose", 0);
- return SendClientMessage(playerid, COLOR_GREY, "Your combination can't result in a package being bigger than 100.");
- }
- if(chosen == GetPVarInt(playerid, "CombiningChose"))
- {
- SetPVarInt(playerid, "Combining", 0);
- SetPVarInt(playerid, "CombiningChose", 0);
- return SendClientMessage(playerid, COLOR_GREY, "You can't combine an item with itself.");
- }
- PlayerInfo[playerid][pInvQ][chosen] += PlayerInfo[playerid][pInvQ][GetPVarInt(playerid, "CombiningChose")];
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][GetPVarInt(playerid, "CombiningChose")], 0, GetPVarInt(playerid, "CombiningChose"));
- SendClientMessage(playerid, COLOR_WHITE, "Items combined!");
- }
- }
- SetPVarInt(playerid, "Combining", 0);
- SetPVarInt(playerid, "CombiningChose", 0);
- return 1;
- }
- if(PlayerInfo[playerid][pInvItem][chosen] > 0) {
- new option_list[128];
- switch(PlayerInfo[playerid][pInvItem][chosen])
- {
- case 500, 501, 502, 503, 504, 505, 506, 507:
- {
- format(option_list, sizeof(option_list), "Use\nDrop\nCombine\nDivide");
- }
- default:
- {
- format(option_list, sizeof(option_list), "Use\nDrop");
- }
- }
- format(str, 50, "%s", PrintIName(PlayerInfo[playerid][pInvItem][chosen]));
- SetPVarInt(playerid, "InvChose", chosen);
- new id = GetPVarInt(playerid, "HouseEnter");
- new kez = -1;
- if(GetCloseHouseSafe(playerid, id) && HouseInfo[id][sLocked] != 1) {
- format(option_list, sizeof(option_list), "%s\nStore in Property", option_list);
- }
- id = GetPVarInt(playerid, "BizzEnter");
- if(GetCloseBizzSafe(playerid, id) && BizInfo[id][sLocked] != 1) {
- format(option_list, sizeof(option_list), "%s\nStore in Business", option_list);
- }
- new keyex = -1;
- if(PlayerToCar(playerid, 1, 4.0))
- {
- keyex = PlayerToCar(playerid, 2, 4.0);
- if(IsValidTCar(keyex))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- format(option_list, sizeof(option_list), "%s\nStore in %s", option_list, PrintVehName(keyex));
- kez = keyex;
- }
- }
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- kez = GetPlayerVehicleID(playerid);
- if(!IsHelmetCar(kez) && VehicleInfo[kez][vType] == VEHICLE_PERSONAL) {
- format(option_list, sizeof(option_list), "%s\nStore in Glovebox", option_list);
- } else kez = -1;
- }
- }
- if(kez == -1)
- {
- if(IsPoliceCar(playerid))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- format(option_list, sizeof(option_list), "%s\nStore in %s", option_list, PrintVehName(GetPoliceCarID(playerid)));
- }
- }
- }
- ShowPlayerDialog(playerid, 31, DIALOG_STYLE_LIST, str, option_list, "Select", "Back");
- } else CallRemoteFunction("PrintInv", "i", playerid);
- }
- case 31: // Inventory Menu
- {
- if(!response)
- {
- DeletePVar(playerid, "InvChose");
- CallRemoteFunction("PrintInv", "i", playerid);
- return true;
- }
- new str2[50], chose = GetPVarInt(playerid, "InvChose");
- DeletePVar(playerid, "InvChose");
- switch(listitem)
- {
- case 0: // USE
- {
- switch(PlayerInfo[playerid][pInvItem][chose])
- {
- case 1 .. 99: // WEAPONS
- {
- if(PlayerInfo[playerid][pPlayerWeapon] != 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You already have a weapon equiped!");
- CallRemoteFunction("PrintInv", "i", playerid);
- return true;
- }
- if(PlayerInfo[playerid][pInvItem][chose] == 4) {
- if(GetPVarInt(playerid, "ConnectTime") < 150) {
- SendClientMessage(playerid, COLOR_WHITE, "You need (150) hours played to use a knife!");
- return 1;
- }
- }
- if(PlayerInfo[playerid][pInvItem][chose] >= 22 && PlayerInfo[playerid][pInvItem][chose] <= 34) {
- if(GetPVarInt(playerid, "ConnectTime") < 8) {
- SendClientMessage(playerid, COLOR_WHITE, "You need (8) hours played to use firearms!");
- return 1;
- }
- }
- //==========//
- PlayerInfo[playerid][pAmmoType]=PlayerInfo[playerid][pInvEx][chose];
- GivePlayerWeaponEx(playerid, PlayerInfo[playerid][pInvItem][chose], PlayerInfo[playerid][pInvQ][chose]);
- PlayerInfo[playerid][pSerial]=PlayerInfo[playerid][pInvS][chose];
- //==========//
- format(str2, 128, "%s equiped!", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
- SendClientMessage(playerid, COLOR_WHITE, str2);
- //==========//
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
- //==========//
- SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
- }
- case 100 .. 199: // AMMUNITION
- {
- if(PlayerInfo[playerid][pPlayerWeapon] != 0 && PlayerInfo[playerid][pPlayerAmmo] != 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Your weapon is currently loaded!");
- CallRemoteFunction("PrintInv", "i", playerid);
- return true;
- }
- if(PlayerInfo[playerid][pPlayerWeapon] == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You don't have any weapon equipped !");
- CallRemoteFunction("PrintInv", "i", playerid);
- return true;
- }
- if(CompatAmmo(playerid, PlayerInfo[playerid][pInvItem][chose]) == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Ammunition is not compatible with this weapon !");
- CallRemoteFunction("PrintInv", "i", playerid);
- return true;
- }
- ApplyAnimation(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);
- PlayerInfo[playerid][pAmmoType]=PlayerInfo[playerid][pInvItem][chose];
- GivePlayerWeaponEx(playerid, PlayerInfo[playerid][pPlayerWeapon], PlayerInfo[playerid][pInvQ][chose]);
- PlayerInfo[playerid][pSerial]=PlayerInfo[playerid][pInvS][chose];
- //==========//
- format(str2, 128, "%s reloaded with '%s'!", PrintIName(PlayerInfo[playerid][pPlayerWeapon]), PrintIName(PlayerInfo[playerid][pInvItem][chose]));
- SendClientMessage(playerid, COLOR_WHITE, str2);
- //==========//
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
- //==========//
- SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
- }
- case 200 .. 299: // FOOD
- {
- new Float:health, rand;
- rand = random(50)+1;
- GetPlayerHealth(playerid, health);
- health+=float(rand)+20.0;
- if(health >= 100.0) health=99.0;
- SetPlayerHealth(playerid, health);
- //==========//
- switch(PrintIid(PlayerInfo[playerid][pInvItem][chose]))
- {
- case 1: ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
- case 2: ApplyAnimation(playerid, "VENDING", "VEND_Drink2_P", 3.0, 0, 0, 0, 0, 0);
- }
- //==========//
- format(str2, 128, "%s consumed!", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
- SendClientMessage(playerid, COLOR_WHITE, str2);
- PlaySoundPlyRadius(playerid, 32200, 10.0);
- //==========//
- format(string, sizeof(string), "consumed %s", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
- ForceAME(playerid, string);
- //==========//
- SetPVarInt(playerid, "Hunger", 0);
- //==========//
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
- }
- case 300 .. 399: // SPECIAL ITEMS
- {
- SetPlayerSpecialAction(playerid, PrintIid(PlayerInfo[playerid][pInvItem][chose]));
- //==========//
- format(str2, 128, "%s used!", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
- SendClientMessage(playerid, COLOR_WHITE, str2);
- //==========//
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
- }
- case 400 .. 499: // PVARS
- {
- new allow = 0;
- switch(PlayerInfo[playerid][pInvItem][chose])
- {
- case 400 .. 405: { allow=PlayerInfo[playerid][pInvItem][chose]; }
- case 408 .. 411: { allow=PlayerInfo[playerid][pInvItem][chose]; }
- case 414 .. 415: { allow=PlayerInfo[playerid][pInvItem][chose]; }
- case 417: { allow=PlayerInfo[playerid][pInvItem][chose]; }
- }
- if(allow == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can't use this item!");
- switch(allow)
- {
- case 400: // DICE
- {
- cmd_dice(playerid, "");
- return true;
- }
- case 401: // MASK
- {
- if(GetPVarInt(playerid, "ConnectTime") <= 55) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need (56) and over hours played!");
- switch(GetPVarInt(playerid, "MaskUse"))
- {
- case 0:
- {
- SetPVarInt(playerid, "MaskUse", 1);
- GameTextForPlayer(playerid, "~w~Mask ~g~On", 5000, 6);
- format(string, sizeof(string),"%s", PlayerNameEx(playerid));
- PlayerTag[playerid] = Create3DTextLabel("NULL",0xFFFFFFFF,0.0,0.0,0.0,8.0,0,1);
- Attach3DTextLabelToPlayer(PlayerTag[playerid], playerid, 0.0, 0.0, 0.1);
- Update3DTextLabelText(PlayerTag[playerid], 0xFFFFFFFF,string);
- foreach(new i : Player) {
- if(GetPVarInt(i, "Admin") < 1) {
- ShowPlayerNameTagForPlayer(i,playerid,0);
- }
- }
- return true;
- }
- case 1:
- {
- SetPVarInt(playerid, "MaskUse", 0);
- GameTextForPlayer(playerid, "~w~Mask ~r~Off", 5000, 6);
- Delete3DTextLabel(PlayerTag[playerid]);
- foreach(new i : Player) { ShowPlayerNameTagForPlayer(i,playerid,1); }
- return true;
- }
- }
- }
- case 402: // WALKIE TALKIE
- {
- cmd_wt(playerid, "");
- return true;
- }
- case 404: // WATCH
- {
- cmd_time(playerid, "");
- return true;
- }
- case 405: // PHONE
- {
- cmd_cellphone(playerid, "");
- return true;
- }
- case 408: // MP5
- {
- cmd_mp3(playerid, "");
- return true;
- }
- case 409, 410: // Cannabis Seeds / GROWING CHEMS
- {
- if (!CheckInvItem(playerid, 409))
- {
- SCM(playerid, COLOR_LIGHTRED, "You need cannabis seeds to continue!");
- return true;
- }
- if (!CheckInvItem(playerid, 410))
- {
- SCM(playerid, COLOR_LIGHTRED, "You need growing chemicals to continue!");
- return true;
- }
- new player_plants = 0;
- for(new weed = 0; weed < sizeof(WeedInfo); weed++)
- {
- if(WeedInfo[weed][wPlanted] != 0 && strcmp(PlayerInfo[playerid][pUsername], WeedInfo[weed][wName]) == 0)
- {
- player_plants++;
- }
- }
- if(player_plants >= MAX_PLAYER_WEED_PLANTS)
- {
- return SendClientMessage(playerid, COLOR_GREY, "You have already planted the maximum allowed amount of cannabis plants per player.");
- }
- for(new weed = 0; weed < sizeof(WeedInfo); weed++)
- {
- if(WeedInfo[weed][wPlanted] == 0 && WeedInfo[weed][wTime] == 0)
- {
- new Float:X,Float:Y,Float:Z;
- RemoveInvItem(playerid, 409, 1); // Remove cannabis seeds
- RemoveInvItem(playerid, 410, 1); // Remove growing chemical
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
- GetPlayerPos(playerid, X, Y, Z);
- WeedInfo[weed][wObject] = CreateDynamicObject(3409, X, Y, Z-2.5, 0, 0, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
- WeedInfo[weed][wX] = X;
- WeedInfo[weed][wY] = Y;
- WeedInfo[weed][wZ] = Z;
- WeedInfo[weed][wWorld] = GetPlayerVirtualWorld(playerid);
- WeedInfo[weed][wTime] = 60;
- WeedInfo[weed][wPlanted] = 1;
- format(WeedInfo[weed][wName], MAX_PLAYER_NAME + 1, "%s", PlayerInfo[playerid][pUsername]);
- SendClientMessage(playerid, COLOR_WHITE, "You have planted your cannabis, it will be fully grown in sixty minutes. (press 'H' to collect)");
- format(string, sizeof(string), "AdmWarn: %s(%i) has planted cannabis.", PlayerInfo[playerid][pUsername], playerid);
- SendAdminMessage(COLOR_YELLOW, string);
- return 1;
- }
- }
- }
- case 411: // Baking Soda
- {
- if(!CheckInvItem(playerid, 501))
- {
- SendClientMessage(playerid, COLOR_GREY, "You need Cocaine to continue.");
- return true;
- }
- if(NotAbleToPlant(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, "You can't do this while in jail.");
- return true;
- }
- for(new weed = 0; weed < sizeof(CrackInfo); weed++)
- {
- if(CrackInfo[weed][cPlanted] == 0 && CrackInfo[weed][cTime] == 0)
- {
- new hasitem = HasInvItem(playerid, 501, 100);
- if(hasitem == -1) return SendClientMessage(playerid, COLOR_GREY, "You need 100 grams of Cocaine to continue.");
- RemoveInvItem(playerid, 501, 100, hasitem);
- RemoveInvItem(playerid, 411);
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- CrackInfo[weed][cObject] = CreateDynamicObject(1554, X, Y, Z-1.0, 0, 0, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
- CrackInfo[weed][cX] = X;
- CrackInfo[weed][cY] = Y;
- CrackInfo[weed][cZ] = Z;
- CrackInfo[weed][cWorld] = GetPlayerVirtualWorld(playerid);
- CrackInfo[weed][cTime] = 60;
- CrackInfo[weed][cPlanted] = 1;
- strmid(CrackInfo[weed][cName], PlayerInfo[playerid][pUsername], 0, strlen(PlayerInfo[playerid][pUsername]), 255);
- SendClientMessage(playerid, COLOR_WHITE, "You have started cooking crack, it will be done in 60 minutes. (press 'H' to collect)");
- return 1;
- }
- }
- }
- case 415:
- {
- if(!IsInLS(playerid)) {
- scm(playerid, -1, "You need to be in Los Santos for any scanner reception.");
- return 1;
- }
- switch(PlayerInfo[playerid][pScanner])
- {
- case 0:
- {
- PlayerInfo[playerid][pScanner] = 1;
- GameTextForPlayer(playerid, "~w~Scanner~n~~g~On", 4000, 3);
- format(string, sizeof(string), "turned %s police scanner on", CheckSex(playerid));
- ForceAME(playerid, string);
- }
- case 1:
- {
- PlayerInfo[playerid][pScanner] = 0;
- GameTextForPlayer(playerid, "~w~Scanner~n~~r~Off", 4000, 3);
- format(string, sizeof(string), "turned %s police scanner off", CheckSex(playerid));
- ForceAME(playerid, string);
- }
- }
- return 1;
- }
- case 417:
- {
- for(new i = 0; i < MAX_CAMPFIRES; i++)
- {
- if(Campfire[i][cID] == 0)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- Campfire[i][cID] = CreateDynamicObject(19632, x, y, z - 1.0, 0, 0, 0);
- Campfire[i][cX] = x;
- Campfire[i][cY] = y;
- Campfire[i][cZ] = z;
- Campfire[i][cTimer] = SetTimerEx("DestroyCampfire", 600000, false, "i", i);
- SendClientMessage(playerid, COLOR_WHITE, "Campfire created. (use 'H' to extinguish)");
- break;
- }
- }
- }
- }
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
- }
- case 500 .. 549: // NARCOTICS
- {
- new Float:ar, Float:ar2, gpid = PlayerInfo[playerid][pInvItem][chose];
- if(GetPVarInt(playerid, "DrugTime") > 0)
- {
- format(string, sizeof(string), "You must wait (%d) secons before using your narcotics!", GetPVarInt(playerid, "DrugTime"));
- SCM(playerid, COLOR_GREY, string);
- return true;
- }
- GetPlayerArmour(playerid, ar);
- switch(gpid)
- {
- case 500 .. 501: SetPVarInt(playerid, "Addiction", GetPVarInt(playerid, "Addiction")+4), ar2=10.0;
- case 502: ar2 = 5.0;
- case 503 .. 505: SetPVarInt(playerid, "Addiction", GetPVarInt(playerid, "Addiction")+4), ar2=10.0;
- case 506: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY), ar2=5.0;
- case 507: SetPVarInt(playerid, "Addiction", GetPVarInt(playerid, "Addiction")+6), ar2=15.0;
- }
- SetPVarInt(playerid, "AddictionID", gpid);
- SetPVarInt(playerid, "DrugTime", PrintIid(gpid)/4);
- SetPVarInt(playerid, "DrugHigh", gpid);
- ar+=ar2;
- if(ar >= 99.0) ar = 99.0;
- SetPlayerArmourEx(playerid, ar);
- //==========//
- format(str2, 128, "%s consumed!", PrintIName(gpid));
- SendClientMessage(playerid, COLOR_WHITE, str2);
- //==========//
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 1, chose);
- //==========//
- }
- case 1002: // Silencer
- {
- scm(playerid, COLOR_BLUE, "[TIP] {FFFFFF}Use the command /silencer to attach/detach a silencer to/from a colt 45.");
- cmd_silencer(playerid, "");
- return true;
- }
- case 1003:
- {
- cmd_plantradio(playerid, "");
- return true;
- }
- case 1004: // bomb
- {
- cmd_v(playerid, "bomb");
- return true;
- }
- case 1005: // bullet-proof vest
- {
- SetPlayerArmourEx(playerid, 50.0);
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "*** %s put on a bulletproof vest, strapping it securely to %s torso.", sendername, CheckSex(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE);
- RemoveInvItem(playerid, 1005);
- return true;
- }
- case 1006: // Backpack
- {
- if(GetPVarInt(playerid, "Backpack") == 1) {
- error(playerid, "You're already wearing a backpack.");
- return scm(playerid, COLOR_BLUE, "[TIP] {FFFFFF}To take off your backpack type (/backpack).");
- }
- SetPVarInt(playerid, "Backpack", 1);
- RemoveInvItem(playerid, 1006);
- if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, 6);
- if(IsPlayerAttachedObjectSlotUsed(playerid, 7)) RemovePlayerAttachedObject(playerid, 7);
- scm(playerid, COLOR_BLUE, "[TIP] {FFFFFF}To take off your backpack type (/backpack).");
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "*** %s puts on %s backpack.", sendername, CheckSex(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE);
- new query[82];
- mysql_format(handlesql, query, sizeof(query), "UPDATE accounts SET Backpack=1 WHERE `Name`='%s'",PlayerName(playerid));
- mysql_tquery(handlesql, query);
- SetPlayerAttachedObject(playerid, 6, 371, 1, 0.0, -0.14, 0.0, 0.0, 90, 359.5022, 1, 1, 1);
- return true;
- }
- case 1007: // Fishing rod
- {
- cmd_fish(playerid, "");
- return true;
- }
- case 1008: // GAS CAN
- {
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GREY, "You must be onfoot to use this!");
- if (PlayerInfo[playerid][pInvQ][chose] < 1 || PlayerInfo[playerid][pInvEx][chose] == -1) { //Fill gas can.
- if(!IsAtGasStation(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not around any fuel pumps.");
- SetPVarInt(playerid, "GC_ItemSlot", chose);
- ShowPlayerDialog(playerid, FUEL_DIALOG_FILL_GASCAN, DIALOG_STYLE_LIST, "Fuel Pump", "{C9C9C9}Regular\n{3A0BC6}Premium\n{F2C71A}Diesel", "Ok", "Cancel");
- } else { //Use gas can.
- if(PlayerToCar(playerid,1,5.0)) {
- new carid = PlayerToCar(playerid,2,5.0);
- if(IsNotAEngineCar(carid)) return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't have an engine.");
- if(VehicleInfo[carid][vFuel] >= 100) return SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicles fuel tank is full!");
- if(VehicleInfo[carid][vEngine] != 0 && VehicleInfo[carid][vFuel] >= 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicle's engine must be off to use this!");
- new vmodel = GetVehicleModel(carid);
- if(PlayerInfo[playerid][pInvEx][chose] == GasType(vmodel)) {
- new amount = (100-VehicleInfo[carid][vFuel]);
- if(PlayerInfo[playerid][pInvQ][chose] > amount) {
- VehicleInfo[carid][vFuel] = 100;
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], amount, chose);
- format(string, sizeof(string), "%sGas can{FFFFFF} used on the %s. You still have %i litres left in your gas can.", GasColor(GasType(vmodel)), VehicleName[vmodel-400], PlayerInfo[playerid][pInvQ][chose]);
- } else {
- VehicleInfo[carid][vFuel] = VehicleInfo[carid][vFuel]+PlayerInfo[playerid][pInvQ][chose];
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
- format(string, sizeof(string), "%sGas can{FFFFFF} used on the %s.", GasColor(GasType(vmodel)), VehicleName[vmodel-400]);
- }
- SendClientMessage(playerid, COLOR_WHITE, string);
- } else {
- format(string, sizeof(string), "Your gas can contains %s{AFAFAF} fuel, but the %s requires %s{AFAFAF} fuel.", FuelName(PlayerInfo[playerid][pInvEx][chose]), VehicleName[vmodel-400], FuelName(GasType(vmodel)));
- return SendClientMessage(playerid, COLOR_GREY, string);
- }
- } else {
- if(!IsAtGasStation(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not around any fuel pumps or vehicles.");
- SetPVarInt(playerid, "GC_ItemSlot", chose);
- ShowPlayerDialog(playerid, FUEL_DIALOG_FILL_GASCAN, DIALOG_STYLE_LIST, "Fuel Pump", "{C9C9C9}Regular\n{3A0BC6}Premium\n{F2C71A}Diesel", "Ok", "Cancel");
- }
- }
- return true;
- }
- case 1050: // Cigarettes
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, HOLDOBJECT_CLOTH4)) RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4);
- SetPVarInt(playerid, "usingCig", 1);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4, 19625, 6, 0.115, 0.031, 0.019, 102.9, 117.0, -110.5, 1.0, 1.0, 1.0);
- SendClientMessage(playerid,COLOR_WHITE,"Type (/drop cig) to drop your cigarette.");
- //==========//
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 1, chose);
- return true;
- }
- case 1051: // Worms
- {
- cmd_fish(playerid, "");
- return true;
- }
- }
- }
- case 1: // DROP
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- switch(PlayerInfo[playerid][pInvItem][chose])
- {
- case 401:
- {
- if(GetPVarInt(playerid, "MaskUse") == 1) {
- SendClientMessage(playerid, COLOR_LIGHTRED, "You need to take your mask off!");
- return true;
- }
- }
- case 1000 .. 1001:
- {
- if((GetPVarInt(playerid, "Member") == 1 || GetPVarInt(playerid, "Member") == 8)) return error(playerid, "You can not do this to prevent LSPD and LSG weapon distribution.");
- }
- }
- format(string, sizeof(string), "%s dropped!", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
- SendClientMessage(playerid, COLOR_WHITE, string);
- //==========//
- new allow = 0;
- if(GetPVarInt(playerid, "Member") == 1 || GetPVarInt(playerid, "Member") == 8) {
- allow++;
- } else if(PlayerInfo[playerid][pInvItem][chose] == 42) allow++;
- if(PlayerInfo[playerid][pInvItem][chose] > 200) allow=0;
- if(allow == 0) {
- CreateLoot(PlayerInfo[playerid][pInvItem][chose], PlayerInfo[playerid][pInvQ][chose], PlayerInfo[playerid][pInvEx][chose], PlayerInfo[playerid][pInvS][chose], X, Y, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); }
- //==========//
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
- //==========//
- SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
- //==========//
- Streamer_Update(playerid);
- }
- case 2: //Put in house inventory, business inventory OR Put in vehicle
- {
- switch(PlayerInfo[playerid][pInvItem][chose])
- {
- case 500, 501, 502, 503, 504, 505, 506, 507:
- {
- new combine_string[128];
- format(combine_string, sizeof(combine_string), "Select an item that you would like to combine with %s(%i).", PrintIName(PlayerInfo[playerid][pInvItem][chose]), PlayerInfo[playerid][pInvQ][chose]);
- SendClientMessage(playerid, COLOR_WHITE, combine_string);
- SetPVarInt(playerid, "Combining", 1);
- SetPVarInt(playerid, "CombiningChose", chose);
- PrintInv(playerid);
- }
- default:
- {
- StorePlayerItemInHouse(playerid, chose, GetPVarInt(playerid, "HouseEnter"));
- StorePlayerItemInBusiness(playerid, chose, GetPVarInt(playerid, "BizzEnter"));
- //Vehicle storing
- new kez = -1;
- new keyex = -1;
- if(PlayerToCar(playerid, 1, 4.0)) {
- keyex = PlayerToCar(playerid, 2, 4.0);
- if(IsValidTCar(keyex))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- kez = keyex;
- }
- }
- }
- if(kez == -1)
- {
- if(IsPoliceCar(playerid)) {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- kez = GetPoliceCarID(playerid);
- }
- else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- kez = GetPlayerVehicleID(playerid);
- }
- }
- }
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- kez = GetPlayerVehicleID(playerid);
- }
- if(kez == -1) return true;
- if(!response) return true;
- StorePlayerItemInVehicle(playerid, chose, kez);
- }
- }
- }
- case 3:
- {
- switch(PlayerInfo[playerid][pInvItem][chose])
- {
- case 500, 501, 502, 503, 504, 505, 506, 507:
- {
- new divide_string[128];
- format(divide_string, sizeof(divide_string), "How much would you like to split off from your %s(%i)?", PrintIName(PlayerInfo[playerid][pInvItem][chose]), PlayerInfo[playerid][pInvQ][chose]);
- ShowPlayerDialog(playerid, 562, DIALOG_STYLE_INPUT, "Divivde", divide_string, "Confirm","Close");
- SetPVarInt(playerid, "Dividing", 1);
- SetPVarInt(playerid, "DividingChose", chose);
- }
- default:
- {
- StorePlayerItemInHouse(playerid, chose, GetPVarInt(playerid, "HouseEnter"));
- StorePlayerItemInBusiness(playerid, chose, GetPVarInt(playerid, "BizzEnter"));
- //Vehicle storing
- new kez = -1;
- new keyex = -1;
- if(PlayerToCar(playerid, 1, 4.0)) {
- keyex = PlayerToCar(playerid, 2, 4.0);
- if(IsValidTCar(keyex))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- kez = keyex;
- }
- }
- }
- if(kez == -1)
- {
- if(IsPoliceCar(playerid)) {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- kez = GetPoliceCarID(playerid);
- }
- else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- kez = GetPlayerVehicleID(playerid);
- }
- }
- }
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- kez = GetPlayerVehicleID(playerid);
- }
- if(kez == -1) return true;
- if(!response) return true;
- StorePlayerItemInVehicle(playerid, chose, kez);
- }
- }
- }
- case 4:
- {
- switch(PlayerInfo[playerid][pInvItem][chose])
- {
- default:
- {
- StorePlayerItemInHouse(playerid, chose, GetPVarInt(playerid, "HouseEnter"));
- StorePlayerItemInBusiness(playerid, chose, GetPVarInt(playerid, "BizzEnter"));
- //Vehicle storing
- new kez = -1;
- new keyex = -1;
- if(PlayerToCar(playerid, 1, 4.0)) {
- keyex = PlayerToCar(playerid, 2, 4.0);
- if(IsValidTCar(keyex) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- kez = keyex;
- }
- }
- if(kez == -1)
- {
- if(IsPoliceCar(playerid)) {
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- kez = GetPoliceCarID(playerid);
- }
- else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- kez = GetPlayerVehicleID(playerid);
- }
- }
- }
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- kez = GetPlayerVehicleID(playerid);
- }
- if(kez == -1) return true;
- if(!response) return true;
- StorePlayerItemInVehicle(playerid, chose, kez);
- }
- }
- }
- }
- }
- case 35: // LSPD ARMOURY DIALOG
- {
- if(!response) return true;
- if(PDItems[listitem][0] == 1000) return SetPlayerArmourEx(playerid, 99.0);
- if(PDItems[listitem][0] == 1001) return SetPlayerHealth(playerid, 100.0);
- if(!CheckInv(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Your inventory is currently full!");
- if(listitem == sizeof(PDItems))
- {
- ResetPlayerWeaponsEx(playerid);
- SetPlayerArmourEx(playerid, 0.0);
- for(new p = 0; p < MAX_INV_SLOTS; p++)
- {
- if(PlayerInfo[playerid][pInvItem][p] >= 22 && PlayerInfo[playerid][pInvItem][p] <= 41) // Weapons
- {
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][p], 0, p);
- }
- if(PlayerInfo[playerid][pInvItem][p] >= 100 && PlayerInfo[playerid][pInvItem][p] <= 128) // Ammo
- {
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][p], 0, p);
- }
- }
- return 1;
- }
- else
- {
- switch(PDItems[listitem][0])
- {
- case 1 .. 99:
- {
- if(CheckInvItem(playerid, PDItems[listitem][0])) return SendClientMessage(playerid, COLOR_WHITE, "You already have this item!");
- if(GetPVarInt(playerid, "ConnectTime") <= 7) return SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient hours played!");
- }
- }
- if(GetPVarInt(playerid, "Rank") >= PDItems[listitem][1])
- {
- if(PDItems[listitem][0] == 3) GiveInvItem(playerid, PDItems[listitem][0], 1, 0);
- else if(PDItems[listitem][0] == 41) GiveInvItem(playerid, PDItems[listitem][0], 1000, 0);
- else GiveInvItem(playerid, PDItems[listitem][0], PrintIQ(PDItems[listitem][0]), 0, PlayerInfo[playerid][pWepSerial]);
- format(string, 128, "%s selected!", PrintIName(PDItems[listitem][0]), PDItems[listitem][1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient rank!");
- }
- }
- case 36:
- {
- if(GetPVarInt(playerid, "VEHC") == 0) return true;
- if(!response)
- {
- ShowPlayerDialog(playerid,37,DIALOG_STYLE_LIST,"DEALERSHIP","Select Vehicle (FORWARD)\nSelect Vehicle (BACKWARDS)\nPurchase Vehicle","Select", "Exit");
- return true;
- }
- else
- {
- new maxe;
- switch(GetPVarInt(playerid, "VEHMDL"))
- {
- case 1: maxe = sizeof(VehDealership)-1;
- case 2: maxe = sizeof(GrotDealership)-1;
- case 3: maxe = sizeof(BikeDealership)-1;
- case 4: maxe = sizeof(BoatDealership)-1;
- }
- switch(GetPVarInt(playerid, "VEHFOR"))
- {
- case 0:
- {
- if(GetPVarInt(playerid, "VEHID") >= maxe) SetPVarInt(playerid, "VEHID", 0);
- else SetPVarInt(playerid, "VEHID", GetPVarInt(playerid, "VEHID")+1);
- }
- case 1:
- {
- if(GetPVarInt(playerid, "VEHID") <= 0) SetPVarInt(playerid, "VEHID", maxe);
- else SetPVarInt(playerid, "VEHID", GetPVarInt(playerid, "VEHID")-1);
- }
- }
- CallRemoteFunction("VehCreation", "i", playerid);
- }
- }
- case 37:
- {
- new id = GetPVarInt(playerid, "VEHDEAL");
- if(!response)
- {
- DeletePVar(playerid, "VEHC"), DeletePVar(playerid, "VEHMDL");
- DeletePVar(playerid, "VEHID");
- DeletePVar(playerid, "VEHDEAL");
- if(GetPVarInt(playerid, "VEHVEH") >= 1) { DespawnVehicle(GetPVarInt(playerid, "VEHVEH")); }
- DeletePVar(playerid, "VEHVEH");
- SetPlayerPosEx(playerid, Dealerships[id][0], Dealerships[id][1], Dealerships[id][2]);
- SetPlayerVirtualWorld(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TempFreeze(playerid);
- DeletePVar(playerid, "LOADDEAL");
- return true;
- }
- //==========//
- switch(listitem)
- {
- case 0:
- {
- SetPVarInt(playerid, "VEHFOR", 0);
- CallRemoteFunction("VehCreation", "i", playerid);
- }
- case 1:
- {
- SetPVarInt(playerid, "VEHFOR", 1);
- CallRemoteFunction("VehCreation", "i", playerid);
- }
- case 2:
- {
- new id2 = GetPVarInt(playerid, "VEHID"), vehmdl = GetPVarInt(playerid, "VEHMDL"), carmdl, col = 0, id3 = GetPVarInt(playerid, "VEHDEAL"); //tls, col = 0;
- DeletePVar(playerid, "VEHC"), DeletePVar(playerid, "VEHMDL");
- DeletePVar(playerid, "VEHID");
- DeletePVar(playerid, "VEHDEAL");
- if(GetPVarInt(playerid, "VEHVEH") >= 1) { DespawnVehicle(GetPVarInt(playerid, "VEHVEH")); }
- DeletePVar(playerid, "VEHVEH");
- SetPlayerPosEx(playerid, Dealerships[id3][0], Dealerships[id3][1], Dealerships[id3][2]);
- SetPlayerVirtualWorld(playerid, 0);
- SetCameraBehindPlayer(playerid);
- TogglePlayerControllableEx(playerid, true);
- DeletePVar(playerid, "LOADDEAL");
- if(VJB == 1)
- {
- SCM(playerid, -1, "A vehicle has just been bought, please retry!");
- return true;
- }
- switch(vehmdl)
- {
- case 1: // Vehicle NORMAL Dealership
- {
- carmdl=VehDealership[id2][0];
- price=VehDealership[id2][1];
- }
- case 2: // Vehicle GROTTI Dealership
- {
- carmdl=GrotDealership[id2][0];
- price=GrotDealership[id2][1];
- }
- case 3: // Vehicle BIKE Dealership
- {
- carmdl=BikeDealership[id2][0];
- price=BikeDealership[id2][1];
- }
- case 4: // Vehicle BOAT Dealership
- {
- carmdl=BoatDealership[id2][0];
- price=BoatDealership[id2][1];
- }
- }
- if(GetPVarInt(playerid, "CarTicket") >= 1)
- {
- if(price >= 125000) price -=125000, SetPVarInt(playerid, "CTU", 2);
- else price = 0, SetPVarInt(playerid, "CTU", 1);
- }
- if(GetPlayerMoneyEx(playerid) >= price)
- {
- new query[75];
- mysql_format(handlesql, query, sizeof(query), "SELECT NULL FROM `vehicles` WHERE `Owner` = '%e';", PlayerInfo[playerid][pUsername]);
- mysql_tquery(handlesql, query, "OnDealershipVehicleBought", "iiiii", playerid, carmdl, id3, col, price);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- TempFreeze(playerid);
- }
- }
- }
- case 38: // Cellphone Dialog
- {
- switch(listitem)
- {
- case 0: // Call Number
- {
- if (GetPVarInt(playerid, "Mobile") != INVALID_MAXPL) return SendClientMessage(playerid, COLOR_GREY, "You are already on a call."), cmd_cellphone(playerid, "");
- if (GetPVarInt(playerid, "Cuffed") > 0) return SendClientMessage(playerid, COLOR_GREY, "You can't do this while handcuffed/tazed."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Jailed") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-jail."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Mute") == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: You are currently muted."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."), cmd_cellphone(playerid, "");
- if(IsPlayerInWater(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-water"), cmd_cellphone(playerid, "");
- ShowPlayerDialog(playerid,39,DIALOG_STYLE_INPUT,"Calling","Enter the number you would like to call.","Call", "Go Back");
- }
- case 1: // Contacts
- {
- if (GetPVarInt(playerid, "Mobile") != INVALID_MAXPL) return SendClientMessage(playerid, COLOR_GREY, "You are already on a call."), cmd_cellphone(playerid, "");
- if (GetPVarInt(playerid, "Cuffed") > 0) return SendClientMessage(playerid, COLOR_GREY, "You can't do this while handcuffed/tazed."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Jailed") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-jail."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Mute") == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: You are currently muted."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."), cmd_cellphone(playerid, "");
- if(IsPlayerInWater(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-water"), cmd_cellphone(playerid, "");
- new diatxt[516];
- for(new i = 1; i < 11; i++)
- {
- if(i != 11)
- {
- //Contact system
- new contactname[40], contactnumber[40], cname[50];
- format(contactname, sizeof(contactname), "ContactName%d", i);
- format(contactnumber, sizeof(contactnumber), "ContactNumber%d", i);
- GetPVarString(playerid, contactname, cname, 50);
- if(strlen(cname) < 2) format(cname, sizeof(cname), "None");
- format(diatxt, sizeof(diatxt), "%s\n{FFFFFF}%s {33FF66}(%d)",diatxt, cname, GetPVarInt(playerid, contactnumber));
- }
- }
- ShowPlayerDialog(playerid, 42, DIALOG_STYLE_LIST,"Contacts", diatxt, "Select","Edit");
- }
- case 2: // Text Message
- {
- if (GetPVarInt(playerid, "Mobile") != INVALID_MAXPL) return SendClientMessage(playerid, COLOR_GREY, "You are already on a call."), cmd_cellphone(playerid, "");
- if (GetPVarInt(playerid, "Cuffed") > 0) return SendClientMessage(playerid, COLOR_GREY, "You can't do this while handcuffed/tazed."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Jailed") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-jail."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Mute") == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: You are currently muted."), cmd_cellphone(playerid, "");
- if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."), cmd_cellphone(playerid, "");
- if(IsPlayerInWater(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-water"), cmd_cellphone(playerid, "");
- ShowPlayerDialog(playerid,40,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
- }
- case 3: // Pickup Call
- {
- new found = 0;
- foreach(new i : Player)
- {
- if(GetPVarInt(i, "PlayerLogged") == 1)
- {
- if(GetPVarInt(i, "Mobile") == playerid)
- {
- found++;
- SetPVarInt(playerid, "Mobile", i);
- SetPVarInt(playerid, "RingTone", 0);
- SetPVarInt(playerid, "RingPhone", 0);
- SetPVarInt(GetPVarInt(playerid, "Mobile"), "RingPhone", 0);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Call picked up.");
- SendClientMessage(i, COLOR_LIGHTBLUE, "They picked up the call.");
- CellphoneState(playerid,1);
- DeletePVar(playerid, "CellMenu");
- CallRemoteFunction("LoadRadios","i", playerid);
- CallRemoteFunction("LoadRadios","i", i);
- break;
- }
- }
- }
- if(found == 0) SendClientMessage(playerid, COLOR_GREY, "You are not on any phone call."), cmd_cellphone(playerid, "");
- }
- case 4: // SPEAKER
- {
- switch(GetPVarInt(playerid, "Speaker"))
- {
- case 0:
- {
- SetPVarInt(playerid, "Speaker", 1);
- GameTextForPlayer(playerid, "~w~Speaker ~g~On", 5000, 6);
- }
- case 1:
- {
- SetPVarInt(playerid, "Speaker", 0);
- GameTextForPlayer(playerid, "~w~Speaker ~r~Off", 5000, 6);
- }
- }
- DeletePVar(playerid, "ContactNum");
- DeletePVar(playerid, "CellMenu");
- CellphoneState(playerid,2);
- }
- case 5: // Pocket Phone
- {
- DeletePVar(playerid, "ContactNum");
- DeletePVar(playerid, "CellMenu");
- if(GetPVarInt(playerid, "Mobile") != INVALID_MAXPL)
- {
- if(GetPVarInt(playerid, "Mobile") < INVALID_MAXPL)
- {
- SendClientMessage(playerid, COLOR_GREY, "You hanged up.");
- SendClientMessage(GetPVarInt(playerid, "Mobile"), COLOR_GREY, "The person on the other line has ended the call.");
- if(GetPVarInt(GetPVarInt(playerid, "Mobile"), "CellMenu") == 0) CellphoneState(GetPVarInt(playerid, "Mobile"),2);
- SetPVarInt(GetPVarInt(playerid, "Mobile"), "Mobile", INVALID_MAXPL);
- SetPVarInt(GetPVarInt(playerid, "Mobile"), "RingTone", 0);
- SetPVarInt(GetPVarInt(playerid, "Mobile"), "RingPhone", 0);
- CellphoneState(playerid,2);
- if(GetPVarInt(GetPVarInt(playerid, "Mobile"), "PayPhone") == 0)
- {
- TogglePlayerControllableEx(GetPVarInt(playerid, "Mobile"),true);
- DeletePVar(GetPVarInt(playerid, "Mobile"),"PayPhone");
- DeletePVar(GetPVarInt(playerid, "Mobile"),"PhoneID");
- }
- CallRemoteFunction("LoadRadios","i", playerid);
- CallRemoteFunction("LoadRadios","i", GetPVarInt(playerid, "Mobile"));
- SetPVarInt(playerid, "Mobile", INVALID_MAXPL); // Disable the phone call.
- SetPVarInt(playerid, "RingPhone", 0);
- return 1;
- }
- }
- foreach(new i : Player)
- {
- if(GetPVarInt(i, "Mobile") == playerid)
- {
- SetPVarInt(i, "RingTone", 0);
- SetPVarInt(i, "RingPhone", 0);
- SetPVarInt(i, "Mobile", INVALID_MAXPL); // Disable the phone call.
- cancelPayphone(i);
- SendClientMessage(i, COLOR_GREY, "They hung up.");
- if(GetPVarInt(i, "CellMenu") == 0)
- {
- CellphoneState(i,2);
- }
- CallRemoteFunction("LoadRadios","i", i);
- }
- }
- SetPVarInt(playerid, "RingTone", 0);
- SetPVarInt(playerid, "RingPhone", 0);
- SetPVarInt(playerid, "Mobile", INVALID_MAXPL); // Disable the phone call.
- CellphoneState(playerid,2);
- CallRemoteFunction("LoadRadios","i", playerid);
- }
- }
- }
- case 39: // Calling
- {
- if(!response) {
- if(GetPVarInt(playerid, "usingPayphone") >= 0) {
- cancelPayphone(playerid);
- return 1;
- }
- return cmd_cellphone(playerid, "");
- }
- CallNumber(playerid, inputtext);
- }
- case 40: // Cellphone Texting FIND NUMBER
- {
- switch(response)
- {
- case 0: cmd_cellphone(playerid, "");
- case 1:
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid,40,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
- return 1;
- }
- if(strlen(inputtext) >= 15)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Number is too long (15 Chars max).");
- ShowPlayerDialog(playerid,40,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
- return 1;
- }
- foreach(new i : Player)
- {
- if(GetPVarInt(i, "PlayerLogged") == 1 && i != playerid)
- {
- format(string, 128, "%d", GetPVarInt(i, "PhoneNum"));
- if(strcmp(string, inputtext, true) == 0)
- {
- if (i == playerid) ShowPlayerDialog(playerid,110,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(i));
- GiveNameSpace(sendername);
- format(string, sizeof(string),"Enter the message you would like to send to %s.", sendername);
- ShowPlayerDialog(playerid,41,DIALOG_STYLE_INPUT,"Texting",string,"Enter", "Go Back");
- strmid(PlayerInfo[playerid][pCellname], inputtext, 0, strlen(inputtext), 255);
- return true;
- }
- }
- }
- SendClientMessage(playerid, COLOR_GREY, "Could not find anyone with that number."), ShowPlayerDialog(playerid,110,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
- }
- }
- }
- case 41: // Cellphone Texting SEND MESSAGE
- {
- if(!response) return cmd_cellphone(playerid, "");
- SmsNumber(playerid, inputtext);
- }
- case 42: //Contact selected
- {
- if(response)
- {
- SetPVarInt(playerid, "SelectedContact", listitem + 1);
- ShowPlayerDialog(playerid, 43, DIALOG_STYLE_MSGBOX, "Contacts", "Select your option.","Call","Text");
- }
- else
- {
- SetPVarInt(playerid, "SelectedContact", listitem + 1);
- ShowPlayerDialog(playerid, 44, DIALOG_STYLE_MSGBOX, "Contacts", "What would you like to edit?","Name","Number");
- }
- }
- case 43: //Call or text contact
- {
- if(!response)
- {
- new contactnumber[40], i = GetPVarInt(playerid, "SelectedContact"), number[50];
- format(contactnumber, sizeof(contactnumber), "ContactNumber%d", i);
- format(number, sizeof(number), "%d", GetPVarInt(playerid, contactnumber));
- new found = 0;
- foreach(new ip : Player)
- {
- if(GetPVarInt(ip, "PlayerLogged") == 1 && ip != playerid)
- {
- format(string, 128, "%d", GetPVarInt(ip, "PhoneNum"));
- if(strcmp(string, number, true) == 0)
- {
- found++;
- if (ip == playerid) ShowPlayerDialog(playerid,41,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(ip));
- GiveNameSpace(sendername);
- format(string, sizeof(string),"Enter the message you would like to send to %s.", sendername);
- ShowPlayerDialog(playerid,41,DIALOG_STYLE_INPUT,"Texting",string,"Enter", "Go Back");
- strmid(PlayerInfo[playerid][pCellname], number, 0, strlen(number), 255);
- return true;
- }
- }
- }
- if(found == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, "Could not find anyone with that number.");
- ShowPlayerDialog(playerid,41,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
- }
- }
- else
- {
- new contactnumber[40], i, number[50];
- i = GetPVarInt(playerid, "SelectedContact");
- format(contactnumber, sizeof(contactnumber), "ContactNumber%d", i);
- format(number, sizeof(number), "%d", GetPVarInt(playerid, contactnumber));
- CallNumber(playerid, number);
- }
- }
- case 44: //Edit contact
- {
- if(!response) //Number
- {
- ShowPlayerDialog(playerid, 45, DIALOG_STYLE_INPUT, "Contact", "Insert the number you'd like to assign to this slot.", "Select","Cancel");
- }
- if(response) //Name
- {
- ShowPlayerDialog(playerid, 46, DIALOG_STYLE_INPUT, "Contact", "Insert the name you'd like to assign to this slot.","Select","Cancel");
- }
- }
- case 45: //Edit number
- {
- if(!response) return cmd_cellphone(playerid, "");
- new number = strval(inputtext), i = GetPVarInt(playerid, "SelectedContact"), slot[50];
- format(slot, sizeof(slot), "ContactNumber%d", i);
- SetPVarInt(playerid, slot, number);
- SCM(playerid, -1, "Contact Editted!.");
- cmd_cellphone(playerid, "");
- }
- case 46: //Edit name
- {
- if(!response) return cmd_cellphone(playerid, "");
- new name[50], i = GetPVarInt(playerid, "SelectedContact"), slot[50];
- format(name, 50, "%s", inputtext);
- format(slot, sizeof(slot), "ContactName%d", i);
- SetPVarString(playerid, slot, name);
- SCM(playerid, -1, "Contact Editted!.");
- cmd_cellphone(playerid, "");
- }
- case 54: // Hospital Floor
- {
- new Float:X = 0.0, Float:Y = 0.0, Float:Z = 0.0;
- switch(listitem)
- {
- case 0:
- {
- X=2038.4750;
- Y-=1365.0499;
- Z=1271.5000;
- }
- case 1:
- {
- X=2055.4756;
- Y-=673.1822;
- Z=1478.8860;
- }
- case 2:
- {
- X=1994.9702;
- Y-=1534.0613;
- Z=1174.6000;
- }
- }
- TogglePlayerControllableEx(playerid, false);
- SetPlayerPosEx(playerid, X, Y, Z+1.0);
- SetTimerEx("TogglePlayerControllableEx", 3000, false, "ii", playerid, true);
- Streamer_Update(playerid);
- }
- case 55: // BZIZ RADIO
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0: // Radio Stations
- {
- new result[2048];
- for(new i = 0; i < sizeof(CarRadio); i++)
- {
- if(i == 0) { format(result, 2048, "%s", CarRadio[i][cName]); }
- else { format(result, 2048, "%s\n%s", result, CarRadio[i][cName]); }
- }
- ShowPlayerDialog(playerid,56,DIALOG_STYLE_LIST,"Radio Stations", result, "Select", "Go Back");
- }
- case 1: // Direct Link
- {
- ShowPlayerDialog(playerid, 57, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- }
- case 2: // Turn Off
- {
- strmid(BizInfo[GetPVarInt(playerid, "BizzKey")][bRadio], "None", 0, strlen("None"), 255);
- GameTextForPlayer(playerid, "~w~Radio~n~~r~OFF", 4000, 3);
- foreach(new i : Player)
- {
- if(GetPVarInt(i, "BizzEnter") == GetPVarInt(playerid, "BizzKey"))
- {
- StopAudioStreamForPlayerEx(i);
- }
- }
- }
- }
- }
- case 56:
- {
- if(!response) return cmd_biz(playerid, "radio");
- if(listitem != 0) {
- PlayBizzRadio(GetPVarInt(playerid, "BizzKey"), CarRadio[listitem][cURL]);
- } else {
- PlayBizzRadio(GetPVarInt(playerid, "BizzKey"), RadioLSStream, 1);
- BizInfo[GetPVarInt(playerid, "BizzKey")][bOnRLS] = 1;
- }
- }
- case 57:
- {
- if(!response) return cmd_biz(playerid, "radio");
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 57, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- if(strlen(inputtext) > 256) return ShowPlayerDialog(playerid, 57, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- PlayBizzRadio(GetPVarInt(playerid, "BizzKey"), inputtext);
- }
- case 58:
- {
- if(response != 1) return DeletePVar(playerid, "RadioInfoID");
- new id = GetPVarInt(playerid, "RadioInfoID");
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid,59,DIALOG_STYLE_INPUT,"BOOMBOX URL LINK","Enter in a direct .mp3 link and it will play on the radio\n{FF0000}Do not enter a link that will not respond.","Enter", "Close");
- case 1: // Radio Stations
- {
- new result[2048];
- for(new i = 0; i < sizeof(CarRadio); i++) {
- if(i == 0) { format(result, 2048, "%s", CarRadio[i][cName]); }
- else { format(result, 2048, "%s\n%s", result, CarRadio[i][cName]); }
- }
- ShowPlayerDialog(playerid, 60, DIALOG_STYLE_LIST, "Radio Stations", result, "Select", "Go Back");
- }
- case 2:
- {
- DeletePVar(playerid, "RadioInfoID");
- switch(RadioInfo[id][rStatus])
- {
- case 0:
- {
- if(strcmp(RadioInfo[id][rURL],"NULL", true) == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You must enter a URL before turning the radio on!");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox on!");
- RadioInfo[id][rStatus]=1;
- foreach(new i : Player)
- {
- if(GetPlayerZone(i) == RadioInfo[id][rAreaID])
- {
- PlayAudioStreamForPlayerEx(i, RadioInfo[id][rURL], RadioInfo[id][rX], RadioInfo[id][rY], RadioInfo[id][rZ], 50.0, 1);
- }
- }
- }
- case 1:
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox off!");
- RadioInfo[id][rStatus]=0;
- foreach(new i : Player)
- {
- if(GetPlayerZone(i) == RadioInfo[id][rAreaID])
- {
- StopAudioStreamForPlayerEx(i);
- }
- }
- }
- }
- }
- case 3:
- {
- if(!CheckInv(playerid)) {
- DeletePVar(playerid, "RadioInfoID");
- return SendClientMessage(playerid, COLOR_WHITE, "Your inventory is full!");
- }
- DeletePVar(playerid, "RadioInfoID");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox picked up!");
- if(RadioInfo[id][rStatus] != 0)
- {
- foreach(new ia : Player)
- {
- if(GetPlayerZone(ia) == RadioInfo[id][rAreaID])
- {
- StopAudioStreamForPlayerEx(ia);
- }
- }
- }
- RadioInfo[id][rX] = 0.0;
- RadioInfo[id][rY] = 0.0;
- RadioInfo[id][rZ] = 0.0;
- RadioInfo[id][rStatus] = 0;
- RadioInfo[id][rAreaID] = 0;
- strmid(RadioInfo[id][rOwner], "None", 0, strlen("None"), 255);
- strmid(RadioInfo[id][rURL], "None", 0, strlen("None"), 255);
- if(IsValidDynamicObject(RadioInfo[id][rObject])) DestroyDynamicObject(RadioInfo[id][rObject]);
- DestroyDynamic3DTextLabel(RadioInfo[id][rText]);
- GiveInvItem(playerid, 1003, 1, 0);
- }
- }
- }
- case 59:
- {
- if(response != 1) return DeletePVar(playerid, "RadioInfoID");
- new id = GetPVarInt(playerid, "RadioInfoID");
- for(new i=0;i<sizeof(RadioInfo);i++)
- {
- if(strcmp(RadioInfo[i][rURL], inputtext, true) == 0)
- {
- if(RadioInfo[i][rAreaID] > 0 && i != id)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You cannot use the same URL as another radio!");
- DeletePVar(playerid, "RadioInfoID");
- return true;
- }
- }
- }
- DeletePVar(playerid, "RadioInfoID");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox URL set!");
- RadioInfo[id][rOnRLS] = 0;
- format(RadioInfo[id][rURL], 128, "%s", inputtext);
- if(RadioInfo[id][rStatus] == 0) return true;
- foreach(new i : Player)
- {
- if(GetPlayerZone(i) == RadioInfo[id][rAreaID])
- {
- PlayAudioStreamForPlayerEx(i, inputtext, RadioInfo[id][rX], RadioInfo[id][rY], RadioInfo[id][rZ], 50.0, 1);
- }
- }
- }
- case 60:
- {
- if(!response) return DeletePVar(playerid, "RadioInfoID");
- new id = GetPVarInt(playerid, "RadioInfoID");
- if(listitem != 0) {
- format(RadioInfo[id][rURL], 128, "%s", CarRadio[listitem][cURL]);
- RadioInfo[id][rOnRLS] = 0;
- } else {
- format(RadioInfo[id][rURL], 128, "%s", RadioLSStream);
- RadioInfo[id][rOnRLS] = 1;
- }
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox station set!");
- if(RadioInfo[id][rStatus] == 0) return true;
- foreach(new i : Player) {
- if(GetPlayerZone(i) == RadioInfo[id][rAreaID]) {
- PlayAudioStreamForPlayerEx(i, RadioInfo[id][rURL], RadioInfo[id][rX], RadioInfo[id][rY], RadioInfo[id][rZ], 50.0, 1);
- }
- }
- DeletePVar(playerid, "RadioInfoID");
- }
- case 64: // /holdo dialog
- {
- switch(response)
- {
- case 1:
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: Make sure the object is properly roleplayed or you will be ajailed.");
- switch(listitem)
- {
- case 0: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 2114, 6, 0.075940, 0.160764, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- case 1: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 1210, 6, 0.291194, 0.091378, 0.058045, 4.921525, 258.763824, 0.0, 1.0, 1.0, 1.0);
- case 2: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 1212, 6, 0.105605, 0.043076, 0.019798, 0.0, 265.589691, 0.0, 1.0, 1.0, 1.0);
- case 3: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 2881, 6, -0.028293, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- case 4: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 2880, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- case 5: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18632, 6, 0.087079, 0.048070, 0.031638, 185.621994, 0.0, 0.0, 1.0, 1.0, 1.0);
- case 6: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 338, 6, 0.0, 0.0, 0.0);
- case 7: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 366, 6, 0.0, 0.0, 0.0);
- case 8: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 1277, 6, 0.074097, 0.016038, 0.009600, 359.580230, 350.386047, 14.481473, 0.250683, 1.0, 0.250702);
- case 9: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 2103, 6, 0.347276, 0.018217, 0.056332, 15.577089, 265.794799, 0.0, 0.719023, 1.0, 0.554738);
- case 10: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 19078, 4, -0.054276, 0.0, 0.028016, 195.591888, 204.274688, 0.0, 0.748166, 1.0, 0.740877);
- case 11: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18641, 5, 0.091820, 0.024471, -0.033493, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- case 12: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18644, 6, 0.077635, 0.014523, 0.0, 174.836212, 7.079411, 0.0, 1.008414, 1.0, 0.747666);
- case 13: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18635, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- case 14: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 19087, 6, 0.058083, 0.008219, 0.472783, 0.0, 0.0, 0.0, 1.674143, 1.0, 0.327090);
- case 15: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 339, 6, 0.0, 0.0, 0.0);
- case 16: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 341, 6, 0.0, 0.0, 0.0);
- case 17: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 932, 1, -0.780373, 0.043744, 0.089657, 188.440246, 92.957847, 355.417968, 1.0, 1.0, 1.0);
- case 18: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18634, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- case 19: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18633, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
- }
- }
- }
- }
- case 65:
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0:
- {
- if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 544, 3, 3);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 1:
- {
- if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 407, 3, 3);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 2:
- {
- if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 407, 6, 3);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 3: CreateEMSVehicle(playerid, 416, 1, 3);
- case 4: CreateEMSVehicle(playerid, 416, 3, 1);
- case 5: CreateEMSVehicle(playerid, 416, 3, 3);
- case 6: CreateEMSVehicle(playerid, 416, 1, 1);
- case 7:
- {
- if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 599, 3, 1);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 8:
- {
- if(GetPVarInt(playerid, "Rank") >= 8) CreateEMSVehicle(playerid, 427, 6, 6);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 9:
- {
- if(GetPVarInt(playerid, "Rank") >= 8) CreateEMSVehicle(playerid, 490, 3, 3);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 10:
- {
- if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 442, 1, 0);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 11: CreateEMSVehicle(playerid, 525, 3, 3);
- case 12:
- {
- if(GetPVarInt(playerid, "Rank") >= 4) CreateEMSVehicle(playerid, 563, 3, 1);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 13:
- {
- if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 497, 3, 1);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 14:
- {
- if(GetPVarInt(playerid, "Rank") >= 5) CreateEMSVehicle(playerid, 427, 3, 3);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- case 15:
- {
- if(GetPVarInt(playerid, "Rank") >= 13) CreateEMSVehicle(playerid, 596, 3, 1);
- else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
- }
- }
- }
- case 66: // SEXSHOP DIALOG
- {
- if(!response) return true;
- SetPVarInt(playerid, "PDBT", 7), SetPVarInt(playerid, "PDBTLI", listitem);
- format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", SexItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
- ConfigPayment(playerid, 1, string);
- }
- case 67: // WAREHOUSE DIALOG
- {
- if(!response) return true;
- if(listitem == sizeof(WarItems)) {
- if(!CheckInvItem(playerid, 404)) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a watch to pawn.");
- RemoveInvItem(playerid, 404);
- GivePlayerMoneyEx(playerid,150);
- scm(playerid, COLOR_WHITE, "You've pawned a watch for $150.");
- return true;
- }
- if(listitem == (sizeof(WarItems)+1)) {
- if(!CheckInvItem(playerid, 405)) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a cellphone to pawn.");
- RemoveInvItem(playerid, 405);
- GivePlayerMoneyEx(playerid,300);
- scm(playerid, COLOR_WHITE, "You've pawned a cellphone for $300.");
- return true;
- }
- if(listitem == (sizeof(WarItems)+2)) {
- if(!CheckInvItem(playerid, 408)) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a MP3 player to pawn.");
- RemoveInvItem(playerid, 408);
- GivePlayerMoneyEx(playerid,75);
- scm(playerid, COLOR_WHITE, "You've pawned a MP3 player for $75.");
- return true;
- }
- SetPVarInt(playerid, "PDBT", 8), SetPVarInt(playerid, "PDBTLI", listitem);
- format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", WarItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
- ConfigPayment(playerid, 1, string);
- }
- case 68: // HOUSE RADIO
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0: // Radio Stations
- {
- new result[2048];
- for(new i = 0; i < sizeof(CarRadio); i++)
- {
- if(i == 0) { format(result, 2048, "%s", CarRadio[i][cName]); }
- else { format(result, 2048, "%s\n%s", result, CarRadio[i][cName]); }
- }
- ShowPlayerDialog(playerid,69,DIALOG_STYLE_LIST,"Radio Stations", result, "Select", "Go Back");
- }
- case 1: // Direct Link
- {
- ShowPlayerDialog(playerid, 70, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- }
- case 2: // Turn Off
- {
- strmid(HouseInfo[GetPVarInt(playerid, "HouseKey")][hRadioU], "None", 0, strlen("None"), 255);
- GameTextForPlayer(playerid, "~w~Radio~n~~r~OFF", 4000, 3);
- foreach(new i : Player)
- {
- if(GetPVarInt(i, "HouseEnter") == GetPVarInt(playerid, "HouseKey"))
- {
- StopAudioStreamForPlayerEx(i);
- }
- }
- }
- }
- }
- case 69:
- {
- if(!response) return cmd_house(playerid, "radio");
- if(listitem != 0) {
- PlayHouseRadio(GetPVarInt(playerid, "HouseKey"), CarRadio[listitem][cURL]);
- } else {
- PlayHouseRadio(GetPVarInt(playerid, "HouseKey"), RadioLSStream, 1);
- HouseInfo[GetPVarInt(playerid, "HouseKey")][hOnRLS] = 1;
- }
- }
- case 70:
- {
- if(!response) return cmd_house(playerid, "radio");
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 70, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- if(strlen(inputtext) > 256) return ShowPlayerDialog(playerid, 70, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- PlayHouseRadio(GetPVarInt(playerid, "HouseKey"), inputtext);
- }
- case 72: // Walkstyle dialog
- {
- switch(response)
- {
- case 0: cmd_options(playerid, "");
- case 1: // Selecting
- {
- cmd_options(playerid, "");
- switch(listitem)
- {
- case 0: SetPlayerWalkStyle(playerid,WALKSTYLE_GANG1);
- case 1: SetPlayerWalkStyle(playerid,WALKSTYLE_GANG2);
- case 2: SetPlayerWalkStyle(playerid,WALKSTYLE_NORMAL);
- case 3: SetPlayerWalkStyle(playerid,WALKSTYLE_SEXY);
- case 4: SetPlayerWalkStyle(playerid,WALKSTYLE_OLD);
- case 5: SetPlayerWalkStyle(playerid,WALKSTYLE_SNEAK);
- case 6: SetPlayerWalkStyle(playerid,WALKSTYLE_BLIND);
- case 7: SetPlayerWalkStyle(playerid,WALKSTYLE_ARMED);
- case 8: SetPlayerWalkStyle(playerid,WALKSTYLE_POLICE);
- case 9: RemovePlayerWalkStyle(playerid);
- }
- }
- }
- }
- case 73: {
- if(GetPVarInt(playerid, "RentKey") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You already rent a vehicle, (/unrent)!");
- if(GetPlayerMoneyEx(playerid) >= 50) {
- if(GetPlayerScore(playerid) > 8){
- GivePlayerMoneyEx(playerid, -50);
- SendClientMessage(playerid, COLOR_WHITE, "Congratulations on your $50 purchase !");
- }
- SendClientMessage(playerid, COLOR_WHITE, "To unrent your rental vehicle type (/unrent).");
- new found = 0, foundid = 0;
- for(new r = 0; r < sizeof(RentalSpot); r++) {
- if(IsPlayerInRangeOfPoint(playerid, 20.0, RentalSpot[r][0], RentalSpot[r][1], RentalSpot[r][2])) {
- if(found == 0) {
- found++;
- foundid=r;
- }
- }
- }
- new veh;
- new rancol = random(200) + 1;
- veh = CreateVehicle(gRentalIDs[listitem][0], RentalSpot[foundid][3], RentalSpot[foundid][4], RentalSpot[foundid][5], RentalSpot[foundid][6], rancol,rancol, -1);
- Iter_Add(Vehicle, veh);
- VehicleInfo[veh][vFuel]=100, VehicleInfo[veh][vEngine]=0;
- VehicleInfo[veh][vWindows]=0, VehicleInfo[veh][vID]=0;
- VehicleInfo[veh][vLights]=0, VehicleInfo[veh][vCreated]=1;
- VehicleInfo[veh][vType] = VEHICLE_RENTAL, VehicleInfo[veh][vJob]=0;
- VehicleInfo[veh][vLights] = 0, VehicleInfo[veh][vLock] = 0;
- SetVehicleNumberPlate(veh, "RENTAL");
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(veh,engine,lights,alarm,0,bonnet,boot,objective);
- SetVehicleToRespawn(veh);
- SetPVarInt(playerid, "RentKey", veh);
- PutPlayerInVehicleEx(playerid, veh, 0);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds !");
- }
- /*case 74: // House Furniture Dialog
- {
- if(!response) return true;
- new objectid=FurnitureObject[listitem][fmodel], Float:X, Float:Y, Float:Z, obj = 0;
- GetPlayerPos(playerid, X, Y, Z);
- obj = CreatePlayerObject(playerid, objectid, X+1.0, Y+1.0, Z, 0.0, 0.0, 0.0, 100.0);
- SetPVarInt(playerid, "FurnObject", obj);
- SetPVarInt(playerid, "EditorMode", 1);
- SetPVarInt(playerid, "Mute", 1);
- SetPVarInt(playerid, "FurnID", listitem);
- EditPlayerObject(playerid, obj);
- format(string, sizeof(string),"%d selected, use the SPRINT key to navigate.", );
- SendClientMessage(playerid, COLOR_WHITE, string);
- }*/
- case 75: // House Furniture AGREEMENT Dialog
- {
- if(!response) return true;
- new keyex = FurnRight(playerid, 1);
- if(keyex == -1) return true;
- new cost = 250;
- if(GetPVarInt(playerid, "MonthDon") > 0) { cost = 0; }
- if(GetPlayerMoneyEx(playerid) >= cost) {
- if(GetPlayerInterior(playerid) == 0) {
- new Float:distance = GetDistanceFromPointToPoint(PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], HouseInfo[keyex][hXo], HouseInfo[keyex][hYo], HouseInfo[keyex][hZo]);
- if(distance > HOUSE_PLANT_DISTANCE) {
- scm(playerid, COLOR_LIGHTRED, "WARNING: Object is too far from the property and could not be planted!");
- return 1;
- } else {
- new found = 0;
- for(new i = 0; i < sizeof(FurnObjs); i++) {
- if(PlayerInfo[playerid][pFurnID] == FurnObjs[i]) {
- found++;
- break;
- }
- }
- if(found == 0) {
- if(GetCount() > GetPVarInt(playerid, "OutDelay")) {
- format(string, sizeof(string), "AdmWarn: %s has planted objectid: %d(%s) outside of houseid: %d.", PlayerInfo[playerid][pUsername], PlayerInfo[playerid][pFurnID], GetObjName(PlayerInfo[playerid][pFurnID]), keyex);
- SendAdminMessage(COLOR_YELLOW, string);
- scm(playerid, COLOR_LIGHTRED, "WARNING: Abusing the outdoor objects system will result in a permanent ban!");
- SetPVarInt(playerid, "OutDelay", GetCount()+10000);
- } else scm(playerid, COLOR_LIGHTRED, "You can only place 1 outdoor object every 10 seconds!");
- }
- }
- }
- format(string, sizeof(string),"~r~-$%d", cost);
- GameTextForPlayer(playerid, string, 5000, 1);
- GivePlayerMoneyEx(playerid, -cost);
- BuildHouseObject(playerid, PlayerInfo[playerid][pFurnID], PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], PlayerInfo[playerid][pFurnR][0], PlayerInfo[playerid][pFurnR][1], PlayerInfo[playerid][pFurnR][2]);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- }
- case 76:
- {
- if(response)
- {
- new furnid = 0, furnitname[100];
- key = FurnRight(playerid, 1);
- furnitname="N/A";
- for(new xe;xe<sizeof(FurnObjs);xe++)
- {
- if(HouseInfo[key][hoID][GetPVarInt(playerid, "FurnEditH")] == FurnObjs[xe])
- {
- format(furnitname, 100, "%d", FurnObjs[xe]);
- furnid=xe;
- break;
- }
- }
- //new priceex = 100;
- switch(listitem)
- {
- case 0: // Edit Object
- {
- new obj = 0, h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1);
- obj = CreatePlayerObject(playerid, HouseInfo[key2][hoID][h], HouseInfo[key2][hoX][h], HouseInfo[key2][hoY][h], HouseInfo[key2][hoZ][h], HouseInfo[key2][horX][h], HouseInfo[key2][horY][h], HouseInfo[key2][horZ][h], 100.0);
- SetPVarInt(playerid, "FurnObject", obj);
- SetPVarInt(playerid, "EditorMode", 2);
- SetPVarInt(playerid, "Mute", 1);
- PlayerInfo[playerid][pFurnID]=furnid;
- EditPlayerObject(playerid, obj);
- format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", furnitname);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- case 1: // Input Position
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- ShowPlayerDialog(playerid, 539, DIALOG_STYLE_LIST, "What axis do you want to edit?", "X-pos\nY-pos\nZ-pos\nX-rotation\nY-rotation\nZ-rotation", "Continue", "Close");
- }
- case 2: // Select Material
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: Editing an invalid-layer MAY cause parts of the object to turn invisible, resetting the layers material will fix this.");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"When you choose a layer to edit, that layer becomes highlighted in red.");
- ShowPlayerDialog(playerid, 503, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
- }
- case 3: // Reset Material
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- new i = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1);
- if(IsValidDynamicObject(HouseInfo[key2][hObject][i])) DestroyDynamicObject(HouseInfo[key2][hObject][i]);
- HouseInfo[key2][hObject][i] = CreateDynamicObject(HouseInfo[key2][hoID][i], HouseInfo[key2][hoX][i], HouseInfo[key2][hoY][i], HouseInfo[key2][hoZ][i], HouseInfo[key2][horX][i], HouseInfo[key2][horY][i], HouseInfo[key2][horZ][i], key2);
- Streamer_Update(playerid);
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"You've reset the selected objects material.");
- for(new v=0; v < 13; v++) {
- HouseMInfo[key2][i][v] = 0;
- }
- SaveFurnObj(key2, i);
- }
- case 4: // Remove Object
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1), priceex = 100;
- if(IsValidDynamicObject(HouseInfo[key2][hObject][h])) DestroyDynamicObject(HouseInfo[key2][hObject][h]);
- HouseInfo[key2][hObject][h]=0;
- HouseInfo[key2][hoID][h]=0;
- HouseInfo[key2][hoX][h] = 0.0;
- HouseInfo[key2][hoY][h] = 0.0;
- HouseInfo[key2][hoZ][h] = 0.0;
- HouseInfo[key2][horX][h] = 0.0;
- HouseInfo[key2][horY][h] = 0.0;
- HouseInfo[key2][horZ][h] = 0.0;
- HouseInfo[key2][hoInt][h]--;
- format(string, 128, "%s removed.", furnitname);
- SendClientMessage(playerid,COLOR_WHITE,string);
- GivePlayerMoneyEx(playerid, priceex);
- SaveFurnObj(key2, h);
- }
- }
- }
- }
- case 78:
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0: CreateGovVehicle(playerid, 560, 0, 0);
- case 1: CreateGovVehicle(playerid, 426, 0, 0);
- case 2: CreateGovVehicle(playerid, 490, 0, 0);
- case 3: CreateGovVehicle(playerid, 409, 0, 0);
- case 4: CreateGovVehicle(playerid, 487, 0, 0);
- }
- }
- case 79: // GOV ARMOURY DIALOG
- {
- if(!response) return true;
- if(GovItems[listitem][0] == 1000) return SetPlayerArmourEx(playerid, 99.0);
- if(GovItems[listitem][0] == 1001) return SetPlayerHealth(playerid, 100.0);
- if(!CheckInv(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Your inventory is currently full!");
- if(listitem == sizeof(GovItems))
- {
- ResetPlayerWeaponsEx(playerid);
- SetPlayerArmourEx(playerid, 0.0);
- for(new p = 0; p < MAX_INV_SLOTS; p++)
- {
- if(PlayerInfo[playerid][pInvItem][p] >= 22 && PlayerInfo[playerid][pInvItem][p] <= 41) // Weapons
- {
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][p], 0, p);
- }
- if(PlayerInfo[playerid][pInvItem][p] >= 100 && PlayerInfo[playerid][pInvItem][p] <= 128) // Armmo
- {
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][p], 0, p);
- }
- }
- return 1;
- }
- else
- {
- switch(GovItems[listitem][0])
- {
- case 1 .. 99:
- {
- if(CheckInvItem(playerid, GovItems[listitem][0])) return SendClientMessage(playerid, COLOR_WHITE, "You already have this item!");
- if(GetPVarInt(playerid, "ConnectTime") <= 7) return SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient hours played!");
- }
- }
- if(GetPVarInt(playerid, "Rank") >= GovItems[listitem][1])
- {
- if(GovItems[listitem][0] == 3) GiveInvItem(playerid, GovItems[listitem][0], 1, 0);
- else if(GovItems[listitem][0] == 41) GiveInvItem(playerid, GovItems[listitem][0], 1000, 0);
- else if(GovItems[listitem][0] == 43) GiveInvItem(playerid, GovItems[listitem][0], 50, 0);
- else GiveInvItem(playerid, GovItems[listitem][0], PrintIQ(GovItems[listitem][0]), 0, PlayerInfo[playerid][pWepSerial]);
- format(string, 128, "%s selected!", PrintIName(GovItems[listitem][0]), GovItems[listitem][1]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient rank!");
- }
- }
- case 80:
- {
- if(!response) return EnableUCP(playerid, 0);
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid, 81, DIALOG_STYLE_INPUT, "Chat Style", "Select a preferred chat-style animation for your character\nChoose from numbers (1-8)", "Enter", "Go Back");
- case 1: ShowPlayerDialog(playerid,72,DIALOG_STYLE_LIST,"Walk Style","Gang 1\nGang 2\nNormal\nSexy\nOld\nSneaking\nBlind\nArmed\nPolice\nRemove","Select", "Go Back");
- case 2:
- {
- cmd_options(playerid, "");
- switch(GetPVarInt(playerid, "TogPM"))
- {
- case 0:
- {
- SetPVarInt(playerid, "TogPM", 1);
- SendClientMessage(playerid, COLOR_GREY, "Private Messages disabled!");
- }
- case 1:
- {
- SetPVarInt(playerid, "TogPM", 0);
- SendClientMessage(playerid, COLOR_GREY, "Private Messages enabled!");
- }
- }
- }
- case 3:
- {
- cmd_options(playerid, "");
- switch(GetPVarInt(playerid, "TogHud"))
- {
- case 0:
- {
- SetPVarInt(playerid, "TogHud", 1);
- SendClientMessage(playerid, COLOR_GREY, "HUD disabled!");
- TextDrawHideForPlayer(playerid,MoneyDraw[playerid]);
- TextDrawHideForPlayer(playerid,MoneyDraw2);
- TextDrawHideForPlayer(playerid,LocationDraw[playerid]);
- }
- case 1:
- {
- SetPVarInt(playerid, "TogHud", 0);
- SendClientMessage(playerid, COLOR_GREY, "HUD enabled!");
- TextDrawShowForPlayer(playerid,MoneyDraw[playerid]);
- TextDrawShowForPlayer(playerid,MoneyDraw2);
- TextDrawShowForPlayer(playerid,LocationDraw[playerid]);
- }
- }
- }
- case 4:
- {
- cmd_options(playerid, "");
- if(GetPVarInt(playerid, "AudioT") == 0)
- {
- SetPVarInt(playerid, "AudioT", 1);
- SCM(playerid, -1, "Audio toggled off.");
- }
- else
- {
- SetPVarInt(playerid, "AudioT", 0);
- SCM(playerid, -1, "Audio toggled on.");
- }
- }
- case 5:
- {
- cmd_options(playerid, "");
- if(GetPVarInt(playerid, "AutoReload") == 0)
- {
- SetPVarInt(playerid, "AutoReload", 1);
- SCM(playerid, -1, "Auto-reload toggled OFF.");
- }
- else
- {
- SetPVarInt(playerid, "AutoReload", 0);
- SCM(playerid, -1, "Auto-reload toggled ON.");
- }
- }
- case 6: ShowPlayerDialog(playerid,82,DIALOG_STYLE_LIST,"Money Bar Color","Green\nRed\nWhite\nYellow\nPink\nBlue","Select", "Go Back");
- case 7: ShowPlayerDialog(playerid,88,DIALOG_STYLE_LIST,"Cellphone Color","Dark Orange\nBlue\nLight Orange\nBlack\nPink\nRed\nGreen\nDark Blue\nYellow\nGrey\nWhite","Select", "Go Back");
- case 8:
- {
- cmd_options(playerid, "");
- if(GetPVarInt(playerid, "TogNews") == 0)
- {
- SetPVarInt(playerid, "TogNews", 1);
- SCM(playerid, -1, "San News Radio toggled OFF.");
- }
- else
- {
- SetPVarInt(playerid, "TogNews", 0);
- SCM(playerid, -1, "San News Radio toggled ON.");
- }
- }
- case 9:
- {
- cmd_options(playerid, "");
- if(GetPVarInt(playerid, "TogRadio") == 0)
- {
- SetPVarInt(playerid, "TogRadio", 1);
- SCM(playerid, -1, "RLS Radio toggled OFF.");
- }
- else
- {
- SetPVarInt(playerid, "TogRadio", 0);
- SCM(playerid, -1, "RLS Radio toggled ON.");
- }
- }
- case 10:
- {
- cmd_options(playerid, "");
- if(GetPVarInt(playerid, "TogB") == 0)
- {
- SetPVarInt(playerid, "TogB", 1);
- SCM(playerid, -1, "Local-OOC Chat toggled OFF.");
- }
- else
- {
- SetPVarInt(playerid, "TogB", 0);
- SCM(playerid, -1, "Local-OOC Chat toggled ON.");
- }
- }
- case 11:
- {
- cmd_options(playerid, "");
- if(PlayerInfo[playerid][pBuyDialog] == 0) {
- PlayerInfo[playerid][pBuyDialog] = 1;
- SCM(playerid, -1, "Payment type textdraw disabled.");
- format(string, sizeof(string), "UPDATE `accounts` SET `BuyDialog`=1 WHERE Name='%s'", PlayerName(playerid));
- mysql_tquery(handlesql, string);
- } else {
- PlayerInfo[playerid][pBuyDialog] = 0;
- SCM(playerid, -1, "Payment type textdraw enabled.");
- format(string, sizeof(string), "UPDATE `accounts` SET `BuyDialog`=0 WHERE Name='%s'", PlayerName(playerid));
- mysql_tquery(handlesql, string);
- }
- }
- }
- }
- case 81:
- {
- cmd_options(playerid, "");
- if(!response) return true;
- if(!strlen(inputtext)) return true;
- if(strlen(inputtext) >= 7) return true;
- new amount = strval(inputtext);
- if(amount <= 0) return true;
- if(amount > 8) return true;
- format(string, sizeof(string), "Chatstyle set to [%d].", amount);
- SCM(playerid, COLOR_WHITE, string);
- SetPVarInt(playerid, "ChatStyle", amount);
- }
- case 82:
- {
- cmd_options(playerid, "");
- if(!response) return true;
- new result[50];
- switch(listitem)
- {
- case 0: result="green";
- case 1: result="red";
- case 2: result="white";
- case 3: result="yellow";
- case 4: result="pink";
- case 5: result="blue";
- }
- format(string, sizeof(string), "Moneybar color set to [%s].", result);
- SCM(playerid, COLOR_WHITE, string);
- SetPVarInt(playerid, "HudCol", listitem);
- SetSlidedMoneyBar(playerid);
- }
- case 86:
- {
- if(!response) return true;
- format(string, sizeof(string),"GPS marker set on lcoation [%s]." , Locations[listitem][lname]);
- SCM(playerid, COLOR_WHITE, string);
- SetPlayerCheckpoint(playerid, Locations[listitem][lx], Locations[listitem][ly], Locations[listitem][lz], 1.5);
- }
- case 87:
- {
- if(!response) return 1;
- new i, text[128];
- i = listitem;
- format(text, sizeof(text), "Government: You took skin '%s'", Govskin[i][Name]);
- SetPlayerSkinEx(playerid, Govskin[i][SkinID]);
- SCM(playerid, -1, text);
- }
- case 88:
- {
- cmd_options(playerid, "");
- if(!response) return 1;
- new object = 0;
- switch(listitem)
- {
- case 0: object=18865;
- case 1: object=18866;
- case 2: object=18867;
- case 3: object=18868;
- case 4: object=18869;
- case 5: object=18870;
- case 6: object=18871;
- case 7: object=18872;
- case 8: object=18873;
- case 9: object=18874;
- case 10: object=19513;
- }
- SCM(playerid, COLOR_WHITE, "Cellphone color changed!");
- SetPVarInt(playerid, "CellCol", object);
- }
- case 89:
- {
- new option[5], optionname[5][128];
- option[0]=1, optionname[0]="Last Location";
- if(GetPVarInt(playerid,"HouseKey") != 0) option[1]=1, optionname[1]="Property";
- if(GetPVarInt(playerid,"BizzKey") != 0) option[2]=1, optionname[2]="Business";
- if(GetPVarInt(playerid,"Member") == 1 || GetPVarInt(playerid,"Member") == 2) option[3]=1, optionname[3]="Faction HQ";
- for(new i = 1; i < 4; i++)
- {
- if(listitem == i && option[i] == 0)
- {
- listitem=i+1;
- }
- }
- format(string, sizeof(string), "Selected Spawnpoint: %s!", optionname[listitem]);
- SCM(playerid, COLOR_WHITE, string);
- switch(listitem)
- {
- /*case 0: // Last Location
- {
- }*/
- case 1: // Property
- {
- key = GetPVarInt(playerid,"HouseKey");
- SetPVarFloat(playerid, "PosX", HouseInfo[key][hXi]);
- SetPVarFloat(playerid, "PosY", HouseInfo[key][hYi]);
- SetPVarFloat(playerid, "PosZ", HouseInfo[key][hZi]);
- SetPVarInt(playerid, "World", key);
- SetPVarInt(playerid, "Interior", HouseInfo[key][hIntIn]);
- }
- case 2: // Business
- {
- key = GetPVarInt(playerid,"BizzKey");
- SetPVarFloat(playerid, "PosX", BizInfo[key][Xi]);
- SetPVarFloat(playerid, "PosY", BizInfo[key][Xi]);
- SetPVarFloat(playerid, "PosZ", BizInfo[key][Xi]);
- SetPVarInt(playerid, "World", key);
- SetPVarInt(playerid, "Interior", BizInfo[key][IntIn]);
- }
- case 3:
- {
- switch(GetPVarInt(playerid,"Member"))
- {
- case 1: // LSPD
- {
- SetPVarFloat(playerid, "PosX", 1553.4929);
- SetPVarFloat(playerid, "PosY", -1675.7034);
- SetPVarFloat(playerid, "PosZ", 16.1953);
- SetPVarInt(playerid, "World", 0);
- SetPVarInt(playerid, "Interior", 0);
- }
- case 2: // LSFD
- {
- SetPVarFloat(playerid, "PosX", 1182.5016);
- SetPVarFloat(playerid, "PosY", -1321.9572);
- SetPVarFloat(playerid, "PosZ", 13.5788);
- SetPVarInt(playerid, "World", 0);
- SetPVarInt(playerid, "Interior", 0);
- }
- }
- }
- }
- SetPVarInt(playerid, "SpawnLocation", 0);
- SetTimerEx("OnLoginInit", 500, false, "ii", playerid, 1);
- }
- case 90: // FACTION SHIPMENT
- {
- // Options
- ShowPlayerDialog(playerid, 91, DIALOG_STYLE_LIST, "Shipment Options", "Order Info\nSelect Items\nProceed", "Select", "Close");
- }
- case 91:
- {
- if(!response) return true;
- new member = GetPVarInt(playerid, "Member");
- switch(listitem)
- {
- case 0: PrintShipment(playerid);
- case 1:
- {
- if(FactionInfo[member][fShipment] > 0)
- {
- SCM(playerid, COLOR_LIGHTRED, "Your faction is currently in a shipping process already!");
- PrintShipment(playerid);
- return true;
- }
- new result[624];
- for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
- if(FactionInfo[member][fShipmentID][i] > 0) {
- if(FactionInfo[member][fShipmentA][i] > 1 || IsQuantityItem(FactionInfo[member][fShipmentID][i])) {
- format(result, sizeof(result), "%s\n%s (%d)", result, PrintIName(FactionInfo[member][fShipmentID][i]), FactionInfo[member][fShipmentA][i]);
- } else format(result, sizeof(result), "%s\n%s", result, PrintIName(FactionInfo[member][fShipmentID][i]));
- } else format(result, sizeof(result), "%s\nEMPTY SLOT", result);
- }
- ShowPlayerDialog(playerid, 93, DIALOG_STYLE_LIST, "Select Slot", result, "Select", "Back");
- }
- case 2:
- {
- DeletePVar(playerid, "ShipmentSlot");
- if(FactionInfo[member][fShipment] > 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Your faction is currently waiting for a shipment to be delivered!");
- new priceex = 0, added = 0, wepcount, drugcount;
- FactionInfo[member][fShipment] = 0;
- FactionInfo[member][fShipmentApproved] = 1;
- for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
- if(FactionInfo[member][fShipmentID][i] < 1) continue;
- if(IsQuantityItem(FactionInfo[member][fShipmentID][i])) {
- priceex += (GetItemPrice(FactionInfo[member][fShipmentID][i])*FactionInfo[member][fShipmentA][i]);
- } else priceex += GetItemPrice(FactionInfo[member][fShipmentID][i]);
- switch(FactionInfo[member][fShipmentID][i])
- {
- case 22 .. 34:
- {
- if(added == 0) {
- added = 1;
- FactionInfo[member][fShipment] += 15;
- }
- wepcount++;
- FactionInfo[member][fShipment] += 15;
- if(FactionInfo[member][fShipmentID][i] > 27 && FactionInfo[member][fShipmentID][i] < 33) { FactionInfo[member][fShipmentApproved] = 0; }
- }
- case 100 .. 150:
- {
- if(added == 0) {
- added = 1;
- FactionInfo[member][fShipment] += 15;
- }
- FactionInfo[member][fShipment] += FactionInfo[member][fShipmentA][i];
- }
- case 409:
- {
- FactionInfo[member][fShipment] += 10;
- }
- case 500 .. 550:
- {
- drugcount += FactionInfo[member][fShipmentA][i];
- FactionInfo[member][fShipment] += (FactionInfo[member][fShipmentA][i]/2);
- }
- case 1002 .. 1020:
- {
- FactionInfo[member][fShipment] += FactionInfo[member][fShipmentA][i];
- if(FactionInfo[member][fShipmentID][i] == 1004) { FactionInfo[member][fShipmentApproved] = 0; }
- }
- }
- }
- if(FactionInfo[member][fShipment] < 1) {
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have to select at least one item before ordering a faction shipment.");
- return PrintShipment(playerid);
- }
- if((FactionInfo[member][fWepCount]+wepcount) > FACTION_WEAPON_LIMIT || (FactionInfo[member][fDrugCount]+drugcount) > FACTION_DRUG_LIMIT) {
- format(string, sizeof(string), "Your faction can only order %d weapons and %d grams of drugs at this time.", (FACTION_WEAPON_LIMIT-FactionInfo[member][fWepCount]), (FACTION_DRUG_LIMIT-FactionInfo[member][fDrugCount]));
- SendFactionMessage(member, COLOR_LIGHTRED, string);
- SendFactionMessage(member, COLOR_BLUE, "[TIP] {FFFFFF}Every hour your faction can order 1 extra gun, and 100 grams more of any/all drugs.");
- FactionInfo[member][fShipment] = 0;
- return PrintShipment(playerid);
- }
- new Float:Pos[3];
- if(FactionInfo[member][fShipmentApproved] == 0) {
- if(ShipmentCache[member][sUsed] == 1) SendClientMessage(playerid, COLOR_WHITE, "You've replaced your existing shipment request with a new one.");
- ShipmentCache[member][sUsed] = 1;
- ShipmentCache[member][sTime] = FactionInfo[member][fShipment];
- FactionInfo[member][fShipment] = 0;
- ShipmentCache[member][sPrice] = priceex;
- ShipmentCache[member][sWepCount] = wepcount;
- ShipmentCache[member][sDrugCount] = drugcount;
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- ShipmentCache[member][sPosX] = Pos[0];
- ShipmentCache[member][sPosY] = Pos[1];
- ShipmentCache[member][sPosZ] = Pos[2];
- format(ShipmentCache[member][sName], MAX_PLAYER_NAME, "%s", PlayerName(playerid));
- for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
- ShipmentCache[member][sShipmentID][i] = FactionInfo[member][fShipmentID][i];
- ShipmentCache[member][sShipmentA][i] = FactionInfo[member][fShipmentA][i];
- }
- SendClientMessage(playerid, COLOR_ORANGE, "[NOTICE] {FFFFFF}Your shipment request has been sent to online administrators for approval. If approved the shipment will spawn where you ordered it after the time listed has passed.");
- format(string, sizeof(string), "[NOTICE] {FFFFFF}The faction '%s' has submitted a shipment order that requires administrative approval. (/viewshipment %i)", FactionInfo[member][fName], member);
- SendAdminMessage(COLOR_ORANGE, string);
- SendFactionMessage(member, COLOR_ORANGE, "[NOTICE] {FFFFFF}Your faction has submitted a shipment order that requires administrative approval.");
- } else {
- if(GetPlayerMoneyEx(playerid) >= priceex)
- {
- FactionInfo[member][fWepCount] += wepcount;
- FactionInfo[member][fDrugCount] += drugcount;
- SaveFactionShipment(member);
- GivePlayerMoneyEx(playerid, -priceex);
- format(string, sizeof(string), "~r~-$%d", priceex);
- GameTextForPlayer(playerid, string, 5000, 1);
- SCM(playerid, COLOR_WHITE, "Shipment has been ordered!");
- format(string, sizeof(string), "Estimated Time: %d minutes.", FactionInfo[member][fShipment]);
- SCM(playerid, COLOR_WHITE, string);
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- FactionInfo[member][fObj] = CreateDynamicObject(19606, Pos[0], Pos[1], Pos[2] + 0.05, 0.0, 0.0, 0.0, 0);
- format(string, sizeof(string), "Your faction can order %d more weapons and %d more grams of drugs at this time.", (FACTION_WEAPON_LIMIT-FactionInfo[member][fWepCount]), (FACTION_DRUG_LIMIT-FactionInfo[member][fDrugCount]));
- SendFactionMessage(member, COLOR_LIGHTBLUE, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!"), PrintShipment(playerid);
- }
- }
- }
- }
- case 92:
- {
- if(!response) return PrintShipment(playerid);
- new member = GetPVarInt(playerid, "Member"), slot = GetPVarInt(playerid, "ShipmentSlot");
- if(listitem == 0) {
- FactionInfo[member][fShipmentID][slot]=0;
- FactionInfo[member][fShipmentA][slot]=0;
- } else {
- new index = listitem-1;
- switch(FactionInfo[member][fRights])
- {
- case 1:
- {
- FactionInfo[member][fShipmentID][slot]=FactGuns[index][0];
- if(FactGuns[index][0] > 27 && FactGuns[index][0] < 33) {
- SendClientMessage(playerid, COLOR_BLUE, "[TIP] {FFFFFF}Adding automatic weapons to this shipment will make it require administrative approval.");
- } else if(FactGuns[index][0] == 1004) { SendClientMessage(playerid, COLOR_BLUE, "[TIP] {FFFFFF}Adding car bombs to this shipment will make it require administrative approval."); }
- switch(FactGuns[index][0])
- {
- case 100 .. 199: { FactionInfo[member][fShipmentA][slot] = PrintIQ(FactGuns[index][0]); }
- default: { FactionInfo[member][fShipmentA][slot] = 0; }
- }
- }
- case 2:
- {
- FactionInfo[member][fShipmentID][slot]=FactDrug1[index][0];
- FactionInfo[member][fShipmentA][slot]=1;
- }
- case 3:
- {
- FactionInfo[member][fShipmentID][slot]=FactDrug2[index][0];
- FactionInfo[member][fShipmentA][slot]=1;
- }
- }
- }
- if(IsQuantityItem(FactionInfo[member][fShipmentID][slot])) {
- ShowPlayerDialog(playerid, DIALOG_SHIPMENT_QUANTITY, DIALOG_STYLE_INPUT, "Enter a quantity. (1-100)", "How much of this item would you like to order?", "Enter", "Back");
- } else {
- new result[624];
- for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
- if(FactionInfo[member][fShipmentID][i] > 0) {
- if(FactionInfo[member][fShipmentA][i] > 1 || IsQuantityItem(FactionInfo[member][fShipmentID][i])) {
- format(result, sizeof(result), "%s\n%s (%d)", result, PrintIName(FactionInfo[member][fShipmentID][i]), FactionInfo[member][fShipmentA][i]);
- } else format(result, sizeof(result), "%s\n%s", result, PrintIName(FactionInfo[member][fShipmentID][i]));
- } else format(result, sizeof(result), "%s\nEMPTY SLOT", result);
- }
- ShowPlayerDialog(playerid, 93, DIALOG_STYLE_LIST, "Select Slot", result, "Select", "Back");
- }
- }
- case 93: //Shipment slot-selection.
- {
- if(!response) return ShowPlayerDialog(playerid, 91, DIALOG_STYLE_LIST, "Shipment Options", "Order Info\nSelect Item\nProceed", "Select", "Close");
- SetPVarInt(playerid, "ShipmentSlot", listitem);
- if(FactionInfo[GetPVarInt(playerid, "Member")][fShipmentID][listitem] > 0 && IsQuantityItem(FactionInfo[GetPVarInt(playerid, "Member")][fShipmentID][listitem])) {
- ShowPlayerDialog(playerid, DIALOG_SHIPMENT_SLOTSELECTED, DIALOG_STYLE_LIST, "Shipment Options", "Select Item\nSelect Quantity", "Select", "Back");
- } else {
- ShowShipmentSelection(playerid);
- }
- }
- case DIALOG_SHIPMENT_SLOTSELECTED:
- {
- if(!response) {
- DeletePVar(playerid, "ShipmentSlot");
- return ShowPlayerDialog(playerid, 91, DIALOG_STYLE_LIST, "Shipment Options", "Order Info\nSelect Items\nProceed", "Select", "Close");
- }
- if(listitem == 0) {
- ShowShipmentSelection(playerid);
- } else {
- ShowPlayerDialog(playerid, DIALOG_SHIPMENT_QUANTITY, DIALOG_STYLE_INPUT, "Enter a quantity. (1-100)", "How much of this item would you like to order?", "Enter", "Back");
- }
- }
- case DIALOG_SHIPMENT_QUANTITY:
- {
- if(!response) {
- DeletePVar(playerid, "ShipmentSlot");
- return ShowPlayerDialog(playerid, 91, DIALOG_STYLE_LIST, "Shipment Options", "Order Info\nSelect Items\nProceed", "Select", "Close");
- }
- new amt = strval(inputtext);
- if(!amt || amt < 1 || amt > 100) {
- SendClientMessage(playerid, COLOR_WHITE, "You can only enter a quantity between 1 and 100 for this item.");
- return ShowPlayerDialog(playerid, DIALOG_SHIPMENT_QUANTITY, DIALOG_STYLE_INPUT, "Enter a quantity. (1-100)", "How much of this item would you like to order?", "Enter", "Back");
- }
- new member = GetPVarInt(playerid, "Member"), slot = GetPVarInt(playerid, "ShipmentSlot");
- if(IsQuantityItem(FactionInfo[member][fShipmentID][slot])) { FactionInfo[member][fShipmentA][slot] = amt; }
- DeletePVar(playerid, "ShipmentSlot");
- new result[624];
- for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
- if(FactionInfo[member][fShipmentID][i] > 0) {
- if(FactionInfo[member][fShipmentA][i] > 1 || IsQuantityItem(FactionInfo[member][fShipmentID][i])) {
- format(result, sizeof(result), "%s\n%s (%d)", result, PrintIName(FactionInfo[member][fShipmentID][i]), FactionInfo[member][fShipmentA][i]);
- } else format(result, sizeof(result), "%s\n%s", result, PrintIName(FactionInfo[member][fShipmentID][i]));
- } else format(result, sizeof(result), "%s\nEMPTY SLOT", result);
- }
- ShowPlayerDialog(playerid, 93, DIALOG_STYLE_LIST, "Select Slot", result, "Select", "Back");
- }
- case DIALOG_SHIPMENT_AVIEW:
- {
- if(!response) {
- DeletePVar(playerid, "ShipmentAdmin");
- return 1;
- }
- ShowPlayerDialog(playerid, DIALOG_SHIPMENT_APPROVAL, DIALOG_STYLE_MSGBOX, "Shipment Request", "Would you like to approve or deny this factions request?", "Approve", "Deny");
- }
- case DIALOG_SHIPMENT_APPROVAL:
- {
- new factionid = GetPVarInt(playerid, "ShipmentAdmin");
- DeletePVar(playerid, "ShipmentAdmin");
- if(ShipmentCache[factionid][sUsed] == 0) return SendClientMessage(playerid, COLOR_WHITE, "There is no longer a pending shipment request from this faction.");
- if(!response) {
- format(string, sizeof(string), "[NOTICE] {FFFFFF}%s has denied your factions shipment request.", AdminName(playerid));
- SendFactionMessage(factionid, COLOR_ORANGE, string);
- ClearShipmentCache(factionid);
- } else {
- if(FactionInfo[factionid][fShipment] > 0) {
- SendFactionMessage(factionid, COLOR_ORANGE, "[NOTICE] {FFFFFF}Your pending faction shipment request has been cancelled since your faction is already waiting for an order to be delivered.");
- ClearShipmentCache(factionid);
- return 1;
- }
- new found = -1;
- foreach(new i : Player) {
- if(strcmp(PlayerName(i), ShipmentCache[factionid][sName], true) == 0) {
- found = i;
- break;
- }
- }
- if(found == -1) {
- SendFactionMessage(factionid, COLOR_ORANGE, "[NOTICE] {FFFFFF}Your pending faction shipment request has been cancelled as the buyer is offline.");
- ClearShipmentCache(factionid);
- return SendClientMessage(playerid, COLOR_ORANGE, "[NOTICE] {FFFFFF}The player who ordered the shipment is no longer online, so the shipment has been cancelled.");
- }
- new wepcount = ShipmentCache[factionid][sWepCount], drugcount = ShipmentCache[factionid][sDrugCount];
- if((FactionInfo[factionid][fWepCount]+wepcount) > FACTION_WEAPON_LIMIT || (FactionInfo[factionid][fDrugCount]+drugcount) > FACTION_DRUG_LIMIT) {
- format(string, sizeof(string), "Pending shipment cancelled. Your faction can only order %d weapons and %d grams of drugs at this time.", (FACTION_WEAPON_LIMIT-FactionInfo[factionid][fWepCount]), (FACTION_DRUG_LIMIT-FactionInfo[factionid][fDrugCount]));
- SendFactionMessage(factionid, COLOR_LIGHTRED, string);
- SendFactionMessage(factionid, COLOR_BLUE, "[TIP] {FFFFFF}Every hour your faction can order 1 extra gun, and 100 grams more of any/all drugs.");
- return PrintShipment(playerid);
- }
- for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
- FactionInfo[factionid][fShipmentID][i] = ShipmentCache[factionid][sShipmentID][i];
- FactionInfo[factionid][fShipmentA][i] = ShipmentCache[factionid][sShipmentA][i];
- }
- new priceex = ShipmentCache[factionid][sPrice];
- if(GetPlayerMoneyEx(found) >= priceex) {
- FactionInfo[factionid][fShipment] = ShipmentCache[factionid][sTime];
- FactionInfo[factionid][fWepCount] += wepcount;
- FactionInfo[factionid][fDrugCount] += drugcount;
- SaveFactionShipment(factionid);
- GivePlayerMoneyEx(found, -priceex);
- format(string, sizeof(string), "~r~-$%d", priceex);
- GameTextForPlayer(found, string, 5000, 1);
- SCM(found, COLOR_WHITE, "Shipment has been ordered!");
- format(string, sizeof(string), "Estimated Time: %d minutes.", FactionInfo[factionid][fShipment]);
- SCM(found, COLOR_WHITE, string);
- FactionInfo[factionid][fObj] = CreateDynamicObject(19606, ShipmentCache[factionid][sPosX], ShipmentCache[factionid][sPosY], ShipmentCache[factionid][sPosZ] + 0.05, 0.0, 0.0, 0.0, 0);
- format(string, sizeof(string), "[NOTICE] {FFFFFF}Admin %s has approved your factions pending shipment request, and the shipment has been ordered. Estimated Time: %d minutes.", AdminName(playerid), FactionInfo[factionid][fShipment]);
- SendFactionMessage(factionid, COLOR_ORANGE, string);
- format(string, sizeof(string), "Your faction can order %d more weapons and %d more grams of drugs at this time.", (FACTION_WEAPON_LIMIT-FactionInfo[factionid][fWepCount]), (FACTION_DRUG_LIMIT-FactionInfo[factionid][fDrugCount]));
- SendFactionMessage(factionid, COLOR_LIGHTBLUE, string);
- } else {
- format(string, sizeof(string), "[NOTICE] {FFFFFF}Admin %s has approved your factions pending shipment request, but the buyer couldn't afford it.", AdminName(playerid));
- SendFactionMessage(factionid, COLOR_ORANGE, string);
- }
- ClearShipmentCache(factionid);
- }
- }
- case 94: // CRATE OPTIONS
- {
- if(!response) return true;
- new id = GetPVarInt(playerid, "CrateID");
- switch(listitem)
- {
- case 0:
- {
- new result[1000], found;
- for(new i = 0; i < MAX_SHIPMENT_SLOTS; i++)
- {
- if(CrateInfo[id][cInvID][i] > 0)
- {
- found++;
- if(CrateInfo[id][cInvA][i] > 1 || IsQuantityItem(CrateInfo[id][cInvID][i])) {
- format(result, 1000, "%s\n%d: %s (%d)", result, i, PrintIName(CrateInfo[id][cInvID][i]), CrateInfo[id][cInvA][i]);
- } else format(result, 1000, "%s\n%d: %s", result, i, PrintIName(CrateInfo[id][cInvID][i]));
- }
- else
- {
- format(result, 1000, "%s\n%d: EMPTY SLOT", result, i);
- }
- }
- if(found == 0) return SCM(playerid, COLOR_LIGHTRED, "This crate is empty!");
- ShowPlayerDialog(playerid, 95, DIALOG_STYLE_LIST, "Crate Options", result, "Take", "Close");
- }
- case 1:
- {
- if(CrateInfo[id][cVeh] != 0) return SendClientMessage(playerid,COLOR_GREY,"This crate is currently bugged.");
- new vehid = PlayerToCar(playerid,2,8.0);
- if (vehid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_WHITE, "No nearby vehicle found.");
- if (VehicleInfo[vehid][vType] != VEHICLE_PERSONAL) return SendClientMessage(playerid, COLOR_WHITE, "Crates can only be stored in personal vehicles.");
- if (!IsTrunkCar(GetVehicleModel(vehid))) return SendClientMessage(playerid, COLOR_WHITE, "This vehicle doesn't have an appropriate trunk.");
- if (VehicleInfo[vehid][vTrunk] == 0) return SendClientMessage(playerid, COLOR_GREY, "The vehicles trunk must be opened.");
- new weight = 0; // max weight 300 for non-heavy carry.
- for(new i = 0; i < MAX_SHIPMENT_SLOTS; i++)
- {
- if(CrateInfo[id][cInvID][i] > 0) {
- switch(CrateInfo[id][cInvID][i]) {
- case 22 .. 34: { weight += 20; }
- case 100 .. 150: { weight += 10; }
- case 409: { weight += 2; }
- case 500 .. 550: { weight += (CrateInfo[id][cInvA][i]*1); }
- case 1004: { weight += 30; }
- default: { weight += 2; }
- }
- }
- }
- if(weight > 300 && !IsHeavyCar(vehid)) { //Too heavy for this car!
- format(string, sizeof(string), "This vehicle can't carry more than 300lbs! (Crate weight: %dlbs.)", weight);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- CrateInfo[id][cVeh]=vehid;
- if(IsValidDynamicObject(CrateInfo[id][cObject])) DestroyDynamicObject(CrateInfo[id][cObject]);
- CrateInfo[id][cObject]=0;
- DestroyDynamic3DTextLabel(CrateInfo[id][cText]);
- SendClientMessage(playerid, COLOR_WHITE, "Crate stored in your vehicle, type (/v crate) to unload it.");
- }
- }
- }
- case 95:
- {
- if(!response) return true;
- new id = GetPVarInt(playerid, "CrateID");
- if(CrateInfo[id][cInvID][listitem] == 0) return true;
- if(!CheckInv(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Your inventory is currently full!");
- format(string, sizeof(string), "'%s' taken!", PrintIName(CrateInfo[id][cInvID][listitem]));
- SendClientMessage(playerid, COLOR_WHITE, string);
- GiveInvItem(playerid, CrateInfo[id][cInvID][listitem], CrateInfo[id][cInvA][listitem], 0);
- RemoveFromCrate(id, listitem);
- }
- case 96:
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0: // Radio Stations
- {
- new result[2048];
- for(new i = 0; i < sizeof(CarRadio); i++)
- {
- if(i == 0) { format(result, 2048, "%s", CarRadio[i][cName]); }
- else { format(result, 2048, "%s\n%s", result, CarRadio[i][cName]); }
- }
- ShowPlayerDialog(playerid,97,DIALOG_STYLE_LIST,"Radio Stations", result, "Select", "Go Back");
- }
- case 1: // Direct Link
- {
- ShowPlayerDialog(playerid, 98, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- }
- case 2: // Turn Off
- {
- GameTextForPlayer(playerid, "~w~MP3~n~~r~OFF", 4000, 3);
- StopAudioStreamForPlayerEx(playerid);
- }
- }
- }
- case 97:
- {
- if(!response) return cmd_mp3(playerid, "");
- PlayAudioStreamForPlayerEx(playerid, CarRadio[listitem][cURL]);
- }
- case 98:
- {
- if(!response) return cmd_mp3(playerid, "");
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 98, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- if(strlen(inputtext) > 256) return ShowPlayerDialog(playerid, 98, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
- PlayAudioStreamForPlayerEx(playerid, inputtext);
- }
- case 99:
- {
- switch(response)
- {
- case 0:
- {
- format(string,sizeof(string),"%s denied your marriage offer.",PlayerName(playerid));
- SendClientMessage(GetPVarInt(playerid, "MarriagePlayer"),COLOR_WHITE,string);
- DeletePVar(GetPVarInt(playerid, "MarriagePlayer"),"MarriagePlayer");
- DeletePVar(playerid,"MarriagePlayer");
- }
- case 1:
- {
- strmid(PlayerInfo[playerid][pMarriedTo], PlayerName(GetPVarInt(playerid, "MarriagePlayer")), 0, strlen(PlayerName(GetPVarInt(playerid, "MarriagePlayer"))), 255);
- strmid(PlayerInfo[GetPVarInt(playerid, "MarriagePlayer")][pMarriedTo], PlayerName(playerid), 0, strlen(PlayerName(playerid)), 255);
- format(string,sizeof(string),"Marriage News: We have a new lovely couple, %s & %s have been married.",PlayerName(playerid),PlayerName(GetPVarInt(playerid, "MarriagePlayer")));
- SendClientMessage(playerid, COLOR_WHITE,string);
- SendClientMessage(GetPVarInt(playerid, "MarriagePlayer"), COLOR_WHITE,string);
- DeletePVar(GetPVarInt(playerid, "MarriagePlayer"),"MarriagePlayer");
- DeletePVar(playerid,"MarriagePlayer");
- }
- }
- }
- //=========//
- case 100:
- {
- switch(response)
- {
- case 0: // NO
- {
- DeletePVar(playerid, "PDBT");
- }
- case 1: // YES
- {
- CallRemoteFunction("PurchaseItem","iiii", playerid, GetPVarInt(playerid, "PDBT"), GetPVarInt(playerid, "PDBTLI"), 1);
- }
- }
- }
- case 101: // Fire Dialog
- {
- switch(listitem)
- {
- case 0:
- {
- switch(GetPVarInt(playerid, "FDDUTY"))
- {
- case 0:
- {
- SetPVarInt(playerid, "FDDUTY", 1);
- SetPlayerColor(playerid, 0xFF800096);
- SendClientMessage(playerid, COLOR_WHITE, "You are now on fire duty!");
- DeletePVar(playerid, "SubaGear");
- }
- case 1:
- {
- SetPVarInt(playerid, "FDDUTY", 0);
- SetPlayerColor(playerid,0xFF8282AA);
- RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH1);
- RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH2);
- RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH3);
- RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4);
- SendClientMessage(playerid, COLOR_WHITE, "You are now off fire duty!");
- DeletePVar(playerid, "SubaGear");
- }
- }
- }
- case 1:
- {
- if(GetPVarInt(playerid, "FDDUTY") == 0) return SendClientMessage(playerid, COLOR_GREY, "You aren't on duty!");
- GiveInvItem(playerid, 42, 9999, 0);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH1, 366, 1, 0.39999988, -0.33199998, -0.07199998, 102.39997863, 132.00007629, -4.30000448, 1.07200002, 1.42599999, 1.25799977);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH2, 19472, 2, 0.000, 0.14700001, 0.00300004, 4.09999942, 87.90000915, 90.80001831, 0.48099988, 1.32099997, 1.07500040);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH3, 19033, 2, 0.08499999, 0.05699998, 0.00099998, 81.90000152, 85.39998626, 7.69999837, 1.00500023, 1.14899992, 1.03999996);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4, 18641, 2, 0.17600002, 0.04700000, 0.08900001, 84.69998168, -5.49999904, 0.000, 0.88199973, 0.98299992, 0.79199993);
- SendClientMessage(playerid, COLOR_GREY, "Fire fighter items equiped!");
- DeletePVar(playerid, "SubaGear");
- }
- case 2:
- {
- if(GetPVarInt(playerid, "FDDUTY") == 0) return SendClientMessage(playerid, COLOR_GREY, "You aren't on duty!");
- SetPlayerSkin(playerid, 285);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH1, 19514, 2, 0.11199998, 0.01800000, 0.00600000, 0.000, 0.000, 0.000, 1.05900001, 1.03100013, 1.09200048);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH2, 19515, 1, 0.08199999, 0.03599999, 0.01700007, 0.000, 0.000, 0.000, 1.02300012, 1.03900003, 1.02300000);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH3, 19472, 2, 0.01000000, 0.12899997, 0.00600000, -18.59999847, 91.19998931, 102.59998321, 1.01100003, 1.14500010, 1.000);
- SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4, 19163, 2, 0.06099998, 0.04099998, 0.00699991, -5.59999370, 93.79998779, -175.49990844, 0.92300033, 0.94700014, 0.88500010);
- SendClientMessage(playerid, COLOR_GREY, "Scuba gear equiped!");
- SetPVarInt(playerid, "SubaGear", 1);
- }
- }
- }
- case 102: // BIZZ Furniture AGREEMENT Dialog
- {
- if(!response) return true;
- new keyex = FurnRight(playerid, 2);
- if(keyex == -1) return true;
- new cost = 250;
- if(GetPVarInt(playerid, "MonthDon") > 0) { cost = 0; }
- if(GetPlayerMoneyEx(playerid) >= cost)
- {
- if(GetPlayerInterior(playerid) == 0) {
- new Float:distance = GetDistanceFromPointToPoint(PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], BizInfo[keyex][Xo], BizInfo[keyex][Yo], BizInfo[keyex][Zo]);
- if(distance > BUSINESS_PLANT_DISTANCE) {
- scm(playerid, COLOR_LIGHTRED, "WARNING: Object is too far from the business and could not be planted!");
- return 1;
- } else {
- new found = 0;
- for(new i = 0; i < sizeof(FurnObjs); i++) {
- if(PlayerInfo[playerid][pFurnID] == FurnObjs[i]) {
- found++;
- break;
- }
- }
- if(found == 0) {
- if(GetCount() > GetPVarInt(playerid, "OutDelay")) {
- format(string, sizeof(string), "AdmWarn: %s has planted objectid: %d(%s) outside of business ID: %d.", PlayerInfo[playerid][pUsername], PlayerInfo[playerid][pFurnID], GetObjName(PlayerInfo[playerid][pFurnID]), keyex);
- SendAdminMessage(COLOR_YELLOW,string);
- scm(playerid, COLOR_LIGHTRED, "WARNING: Abusing the outdoor objects will result in a permanent ban!");
- SetPVarInt(playerid, "OutDelay", GetCount()+10000);
- } else scm(playerid, COLOR_LIGHTRED, "You can only place 1 outdoor object every 10 seconds!");
- }
- }
- }
- format(string, sizeof(string),"~r~-$%d", cost);
- GameTextForPlayer(playerid, string, 5000, 1);
- GivePlayerMoneyEx(playerid, -cost);
- BuildBizzObject(playerid, PlayerInfo[playerid][pFurnID], PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], PlayerInfo[playerid][pFurnR][0], PlayerInfo[playerid][pFurnR][1], PlayerInfo[playerid][pFurnR][2]);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- }
- case 103:
- {
- if(response)
- {
- new furnid = 0, furnitname[100];
- key = FurnRight(playerid, 2);
- furnitname="N/A";
- for(new xe;xe<sizeof(FurnObjs);xe++)
- {
- if(BizInfo[key][boID][GetPVarInt(playerid, "FurnEditH")] == FurnObjs[xe])
- {
- format(furnitname, 100, "%d", FurnObjs[xe]);
- furnid=xe;
- break;
- }
- }
- //new priceex = 100;
- switch(listitem)
- {
- case 0: // Edit Object
- {
- new obj = 0, h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
- obj = CreatePlayerObject(playerid, BizInfo[key2][boID][h], BizInfo[key2][boX][h], BizInfo[key2][boY][h], BizInfo[key2][boZ][h], BizInfo[key2][borX][h], BizInfo[key2][borY][h], BizInfo[key2][borZ][h], 100.0);
- SetPVarInt(playerid, "FurnObject", obj);
- SetPVarInt(playerid, "EditorMode", 4);
- SetPVarInt(playerid, "Mute", 1);
- PlayerInfo[playerid][pFurnID]=furnid;
- EditPlayerObject(playerid, obj);
- format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", furnitname);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- case 1: // Input Position
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- ShowPlayerDialog(playerid, 541, DIALOG_STYLE_LIST, "What axis do you want to edit?", "X-pos\nY-pos\nZ-pos\nX-rotation\nY-rotation\nZ-rotation", "Continue", "Close");
- }
- case 2: // Select Material
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: Editing an invalid-layer MAY cause parts of the object to turn invisible, resetting the layers material will fix this.");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"When you choose a layer to edit, that layer becomes highlighted in red.");
- ShowPlayerDialog(playerid, 501, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
- }
- case 3: // Reset Material
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
- if(IsValidDynamicObject(BizInfo[key2][bObject][h])) DestroyDynamicObject(BizInfo[key2][bObject][h]);
- BizInfo[key2][bObject][h] = CreateDynamicObject(BizInfo[key2][boID][h], BizInfo[key2][boX][h], BizInfo[key2][boY][h], BizInfo[key2][boZ][h], BizInfo[key2][borX][h], BizInfo[key2][borY][h], BizInfo[key2][borZ][h], key2);
- Streamer_Update(playerid);
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"You've reset the selected objects material.");
- for(new v=0; v < 13; v++) {
- BizMInfo[key2][h][v] = 0;
- }
- SaveBizzObj(key2, h);
- }
- case 4: // Remove Object
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
- if(IsValidDynamicObject(BizInfo[key2][bObject][h])) DestroyDynamicObject(BizInfo[key2][bObject][h]);
- BizInfo[key2][bObject][h]=0;
- BizInfo[key2][boID][h]=0;
- BizInfo[key2][boX][h] = 0.0;
- BizInfo[key2][boY][h] = 0.0;
- BizInfo[key2][boZ][h] = 0.0;
- BizInfo[key2][borX][h] = 0.0;
- BizInfo[key2][borY][h] = 0.0;
- BizInfo[key2][borZ][h] = 0.0;
- BizInfo[key2][boInt][h]--;
- format(string, 128, "%s removed.", furnitname);
- SendClientMessage(playerid,COLOR_WHITE,string);
- SaveBizzObj(key2, h);
- }
- }
- }
- }
- case 104: // TREATWOUND DIALOG
- {
- if(!response) return true;
- new priceex = GetPVarInt(playerid,"WoundC");
- if(GetPlayerMoneyEx(playerid) >= priceex)
- {
- PlayerPlaySound(playerid,1054, 0.0, 0.0, 0.0);
- format(string, sizeof(string),"~r~-$%d",priceex);
- GameTextForPlayer(playerid, string, 5000, 1);
- GivePlayerMoneyEx(playerid,-priceex);
- DeathPlayer(playerid, "You need to rest to heal your wounds!");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- }
- //====200 - 250 house system==//
- //
- //===========================//
- case 200: //House buy dialog
- {
- if(!response) return true;
- new foundid = 0;
- for(new h = 1; h < MAX_HOUSES; h++)
- {
- if(HouseInfo[h][hID] != 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hXo], HouseInfo[h][hYo], HouseInfo[h][hZo]) && GetPlayerVirtualWorld(playerid) == HouseInfo[h][hVwOut])
- {
- if(HouseInfo[h][hOwned] == 0)
- {
- foundid=h;
- break;
- }
- }
- }
- }
- if(foundid == -1) return true;
- format(string, sizeof(string), "Do you want to buy this house?\nPrice: $%d \nBank Account: $%d", HouseInfo[foundid][hBuyValue], GetPVarInt(playerid, "Bank"));
- ShowPlayerDialog(playerid, 207, DIALOG_STYLE_MSGBOX, "Payment Type", string, "Buy", "Close");
- }
- case 201: //Business inventory
- {
- if(!response) return SCM(playerid, -1, "You didn't take anything from the business.");
- new hid = GetPVarInt(playerid, "BizzEnter");
- if(hid != 0 && GetPlayerVirtualWorld(playerid) == hid)
- {
- if(GetCloseBizzSafe(playerid, hid) && BizInfo[hid][sLocked] != 1)
- {
- new stri2[84];
- if(response)
- {
- if(CheckInv(playerid) == 0) return error(playerid, "Your inventory is full.");
- if(BizInfo[hid][InvID][listitem] == 0) return error(playerid, "Slot is empty.");
- GiveInvItem(playerid, BizInfo[hid][InvID][listitem], BizInfo[hid][InvQ][listitem], BizInfo[hid][InvE][listitem], BizInfo[hid][InvS][listitem]);
- format(stri2, sizeof(stri2), "You took a (%s) from the business.", PrintIName(BizInfo[hid][InvID][listitem]));
- scm(playerid, -1, stri2);
- format(stri2, sizeof(stri2), "takes a %s from the business.", PrintIName(BizInfo[hid][InvID][listitem]));
- ForceAME(playerid, stri2);
- BizInfo[hid][InvID][listitem] = 0;
- BizInfo[hid][InvQ][listitem] = 0;
- BizInfo[hid][InvE][listitem] = 0;
- BizInfo[hid][InvS][listitem] = 0;
- SaveBiz(hid);
- }
- }
- }
- }
- case 202: //House inventory
- {
- if(!response) return SCM(playerid, -1, "You didn't take anything from the property.");
- new hid = GetPVarInt(playerid, "HouseEnter");
- if(hid != 0)
- {
- if(GetPlayerVirtualWorld(playerid) == hid)
- {
- if(GetCloseHouseSafe(playerid, hid) && HouseInfo[hid][sLocked] != 1)
- {
- new stri2[84];
- if(response)
- {
- if(CheckInv(playerid) == 0) return error(playerid, "Your inventory is full.");
- if(HouseInfo[hid][hInvID][listitem] == 0) return error(playerid, "Slot is empty.");
- GiveInvItem(playerid, HouseInfo[hid][hInvID][listitem], HouseInfo[hid][hInvQ][listitem], HouseInfo[hid][hInvE][listitem], HouseInfo[hid][hInvS][listitem]);
- format(stri2, sizeof(stri2), "You took a (%s) from the property.", PrintIName(HouseInfo[hid][hInvID][listitem]));
- scm(playerid, -1, stri2);
- format(stri2, sizeof(stri2), "takes a %s from the property.", PrintIName(HouseInfo[hid][hInvID][listitem]));
- ForceAME(playerid, stri2);
- HouseInfo[hid][hInvID][listitem] = 0;
- HouseInfo[hid][hInvQ][listitem] = 0;
- HouseInfo[hid][hInvE][listitem] = 0;
- HouseInfo[hid][hInvS][listitem] = 0;
- SaveHouse(hid);
- }
- }
- }
- }
- }
- case 203: //Vehicle inventory
- {
- new kez = -1, keyex = -1;
- if(PlayerToCar(playerid, 1, 4.0)) {
- keyex = PlayerToCar(playerid, 2, 4.0);
- if(IsValidTCar(keyex)) {
- kez = keyex; }
- }
- if(kez == -1) {
- if(IsPoliceCar(playerid)) {
- kez = GetPoliceCarID(playerid); }
- }
- if(kez == -1) return SendClientMessage(playerid, COLOR_GREY, "You are not around any valid vehicle!");
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return scm(playerid, -1, "You must be on foot to use this!");
- if(VehicleInfo[kez][vType] == VEHICLE_PERSONAL || VehicleInfo[kez][vType] == VEHICLE_LSPD)
- {
- new Float:xx,Float:yy,Float:zz;
- GetVehiclePos(kez,xx,yy,zz);
- if(IsPlayerInRangeOfPoint(playerid,10.0,xx,yy,zz))
- {
- new stri2[84];
- if(response)
- {
- if(CheckInv(playerid) == 0) return error(playerid, "Your inventory is full.");
- if(DisabledWeapon(GetPVarInt(playerid, "ConnectTime"), VehicleInfo[kez][vGBID][listitem])) return error(playerid, "You need 8 hours played to use take this.");
- if(VehicleInfo[kez][vInvID][listitem] == 0) return error(playerid, "Slot is empty.");
- if(VehicleInfo[kez][vInvID][listitem] <= 800 || VehicleInfo[kez][vInvID][listitem] >= 1002) {
- GiveInvItem(playerid, VehicleInfo[kez][vInvID][listitem], VehicleInfo[kez][vInvQ][listitem], VehicleInfo[kez][vInvE][listitem], VehicleInfo[kez][vInvS][listitem]); }
- format(stri2, sizeof(stri2), "You took a (%s) from your vehicle.", PrintIName(VehicleInfo[kez][vInvID][listitem]));
- scm(playerid, -1, stri2);
- format(stri2, sizeof(stri2), "takes a %s from the vehicle.", PrintIName(VehicleInfo[kez][vInvID][listitem]));
- ForceAME(playerid, stri2);
- VehicleInfo[kez][vInvID][listitem] = 0;
- VehicleInfo[kez][vInvQ][listitem] = 0;
- VehicleInfo[kez][vInvE][listitem] = 0;
- VehicleInfo[kez][vInvS][listitem] = 0;
- //LoadCarIDObjects(kez);
- }
- }
- }
- }
- case 204:
- {
- if(!response) return 1;
- if(listitem == 0)
- {
- PrintInv(playerid);
- }
- if(listitem == 1)
- {
- new hh = GetPVarInt(playerid, "HouseEnter");
- new bh = GetPVarInt(playerid, "BizzEnter");
- if(hh != 0 && GetCloseHouseSafe(playerid, hh) && HouseInfo[hh][sLocked] != 1)
- {
- PrintHouseInv(playerid);
- }
- else if(bh != 0 && GetCloseBizzSafe(playerid, bh) && BizInfo[bh][sLocked] != 1)
- {
- PrintBizInv(playerid);
- }
- else
- {
- if(!IsPlayerInAnyVehicle(playerid)) {
- key = -1;
- new keyex = -1;
- if(PlayerToCar(playerid, 1, 4.0)) {
- keyex = PlayerToCar(playerid, 2, 4.0);
- if(IsValidTCar(keyex)) {
- key = keyex; }
- }
- if(key == -1) {
- if(IsPoliceCar(playerid)) {
- key = GetPoliceCarID(playerid); }
- }
- if(key == -1) return 1;
- if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
- PrintVehInv(playerid, key);
- }
- } else {
- PrintVehGB(playerid, GetPlayerVehicleID(playerid));
- }
- }
- }
- }
- case 205:
- {
- if(!response) return 1;
- new text[128];
- format(text, sizeof(text), "LSPD: You took skin '%s'", LSPDskin[listitem][Name]);
- if(GetPVarInt(playerid, "Rank") < LSPDskin[listitem][Rank]) return error(playerid, "You are not allowed to wear this skin.");
- SetPlayerSkinEx(playerid, LSPDskin[listitem][SkinID]);
- SCM(playerid, -1, text);
- }
- case 206:
- {
- if(response)
- {
- new pmtext[128], targetid;
- GetPVarString(playerid, "APMMSG", pmtext, 128);
- targetid = GetPVarInt(playerid, "APMID");
- format(string, sizeof(string), "(( PM from [%d] %s: %s ))", playerid, PlayerName(playerid), pmtext);
- SendClientMessage(targetid, 0xF9F900FF, string);
- format(string, sizeof(string), "(( PM sent to [%d]%s: %s ))", targetid, PlayerName(targetid), pmtext);
- SendClientMessage(playerid, 0xE5C43EAA, string);
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- SetPVarInt(playerid, "APMWRN", 1);
- }
- }
- case 207: // Property Buy Dialog
- {
- if(response) {
- foreach(new h : HouseIterator) {
- if(GetPVarInt(playerid, "OnRoute") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently on a route!");
- if(HouseInfo[h][hID] != 0)
- {
- if(GetPlayerVirtualWorld(playerid) == HouseInfo[h][hVwOut] && GetPlayerInterior(playerid) == HouseInfo[h][hIntOut] && IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hXo], HouseInfo[h][hYo], HouseInfo[h][hZo]))
- {
- if(HouseInfo[h][hOwned] == 0)
- {
- if(GetPVarInt(playerid, "HouseKey") == 0)
- {
- if(GetPVarInt(playerid, "Bank") < HouseInfo[h][hBuyValue])
- {
- error(playerid, "Insufficient funds.");
- }
- else
- {
- SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank") - HouseInfo[h][hBuyValue]);
- SendClientMessage(playerid, -1, "Congratulations on your property!");
- SetPVarInt(playerid, "HouseKey", h);
- HouseInfo[h][hOwned] = 1;
- format(HouseInfo[h][hOwner], 25, "%s", PlayerName(playerid));
- HouseInfo[h][hCombo] = 1000+random(8999);
- SaveHouse(h);
- OnPlayerDataSave(playerid);
- return 1;
- }
- }
- else { error(playerid, "You already own a property."); }
- }
- else { error(playerid, "Property not for sale."); }
- }
- }
- }
- }
- }
- case 280: //Toys
- {
- if(!response) return 1;
- SetPVarInt(playerid, "ToyModelC", AttachmentObjects[listitem][attachmodel]);
- ShowPlayerDialog(playerid, 294, DIALOG_STYLE_LIST, "Select bone", "Spine\nHead\nLeft Upper Arm\nRight Upper Arm\nLeft Hand\nRight Hand\nLeft Thigh\nRight Thigh\nLeft foot\nRight Foot\nRight Calf\nLeft Calf\nLeftForearm\nRight Forearm\nLeft Shoulder\nRight Shoulder\nNeck\nJaw", "Select","Cancel");
- }
- case 281: //MDC
- {
- if(!response) return 1;
- switch(listitem)
- {
- /*case 0: ShowPlayerDialog(playerid, 282, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the name.", "Continue","Back");
- case 1: ShowPlayerDialog(playerid, 287, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the vehicle plate.", "Continue","Back");*/
- case 2: ShowPlayerDialog(playerid, 433, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert a serial ID.", "Insert","Cancel");
- /*case 3: ShowPlayerDialog(playerid, 289, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the Case ID.", "Continue","Back");
- case 4:
- {
- if(GetPVarInt(playerid, "Member") == 1) ShowPlayerDialog(playerid, 297, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the phone number.", "Continue","Back");
- else nal(playerid);
- }*/
- }
- }
- case 282: //MDC - Person
- {
- if(!response) return ShowPlayerDialog(playerid, 281, DIALOG_STYLE_LIST, "Mobile data computer", "Check Person\nCheck Vehicle\nCheck Serial ID\nCase ID\nTrace Phone", "Select","Close");
- new input[500], query[400];
- mysql_escape_string(inputtext, input); //Protecting the database.
- format(MDCinfo[playerid][1][mChecking], 25, "%s", input);
- format(query, sizeof(query), "SELECT `PhoneNum`, `Name`, `Sex`, `Age`, `DriveLic` `GunLic`, `HouseKey`, `BizzKey` FROM `accounts` LEFT JOIN `vehicles` ON `accounts`.`Name` = `vehicles`.`Owner` WHERE `accounts`.`Name` = '%s'", input);
- mysql_function_query(handlesql, query, true, "MDCPlayer", "d", playerid);
- }
- case 283: //MDC - Check criminal record
- {
- new query[128];
- if(!response) return 1;
- switch(listitem)
- {
- /*case 5 .. 7: //Vehicle
- {
- if(MDCinfo[playerid][listitem - 4][mVID] == 0)
- {
- format(query, sizeof(query), "SELECT * FROM accounts WHERE Name='%s'", MDCinfo[playerid][1][mChecking]);
- mysql_function_query(handlesql, query, true, "MDCPlayer", "d", playerid);
- }
- else
- {
- format(query, sizeof(query), "SELECT * FROM vehicles WHERE ID=%d", MDCinfo[playerid][listitem - 4][mVID]);
- mysql_function_query(handlesql, query, true, "MDCPlayer4", "d", playerid);
- }
- }*/
- case 11: //Criminal record
- {
- format(query, sizeof(query), "SELECT * FROM criminals WHERE player='%s' AND type=1 ORDER BY ID DESC", MDCinfo[playerid][1][mChecking]);
- mysql_function_query(handlesql, query, true, "MDCPlayer2", "d", playerid);
- }
- case 12: //Ticket record
- {
- format(query, sizeof(query), "SELECT * FROM tickets WHERE player='%s' AND paid=0 ORDER BY ID DESC", MDCinfo[playerid][1][mChecking]);
- mysql_function_query(handlesql, query, true, "MDCPlayer5", "d", playerid);
- }
- }
- }
- case 284: //MDC - Check crime in detail
- {
- new query[128];
- if(!response)
- {
- format(query, sizeof(query), "SELECT * FROM accounts WHERE Name='%s'", MDCinfo[playerid][1][mChecking]);
- mysql_function_query(handlesql, query, true, "MDCPlayer", "d", playerid);
- }
- else
- {
- format(query, sizeof(query), "SELECT * FROM criminals WHERE time='%e' AND type=1", MDCinfo[playerid][listitem][mTime]);
- mysql_function_query(handlesql, query, true, "MDCPlayer3", "d", playerid);
- }
- }
- case 285: //MDC - Check crime in detail (selected)
- {
- new query[128];
- format(query, sizeof(query), "SELECT * FROM criminals WHERE player='%s' AND type=1 ORDER BY ID DESC", MDCinfo[playerid][1][mChecking]);
- mysql_function_query(handlesql, query, true, "MDCPlayer2", "d", playerid);
- }
- case 286: //MDC - Check vehicle in detail (selected)
- {
- new query[128];
- format(query, sizeof(query), "SELECT * FROM accounts WHERE Name='%s'", MDCinfo[playerid][1][mChecking]);
- mysql_function_query(handlesql, query, true, "MDCPlayer5", "d", playerid);
- }
- case 287: //MDC - Vehicle
- {
- if(!response) return ShowPlayerDialog(playerid, 281, DIALOG_STYLE_LIST, "Mobile data computer", "Check Person\nCheck Vehicle\nCheck Serial ID\nCase ID\nTrace Phone", "Select","Close");
- new input[500], query[128];
- mysql_escape_string(inputtext, input); //Protecting the database.
- format(MDCinfo[playerid][1][mChecking], 25, "%s", input);
- format(query, sizeof(query), "SELECT * FROM vehicles WHERE Plate='%e'", input);
- mysql_function_query(handlesql, query, true, "MDCVehicle", "d", playerid);
- }
- case 288: //MDC - Vehicle in detail from vehicle (selected)
- {
- ShowPlayerDialog(playerid, 287, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the vehicle plate.", "Continue","Back");
- }
- case 289: //MDC - Case ID
- {
- if(!response) return ShowPlayerDialog(playerid, 281, DIALOG_STYLE_LIST, "Mobile data computer", "Check Person\nCheck Vehicle\nCheck Serial ID\nCase ID\nTrace Phone", "Select","Close");
- new input[500], query[128], inputid;
- mysql_escape_string(inputtext, input); //Protecting the database.
- format(MDCinfo[playerid][1][mChecking], 25, "%s", input);
- inputid = strval(input);
- format(query, sizeof(query), "SELECT * FROM criminals WHERE ID=%d", inputid - 900);
- mysql_function_query(handlesql, query, true, "MDCCase", "d", playerid);
- }
- case 290: //MDC - Case in detail from case ID (selected)
- {
- ShowPlayerDialog(playerid, 289, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the Case ID.", "Continue","Back");
- }
- case 291: //MDC - Check crime in detail
- {
- new query[128];
- if(!response)
- {
- format(query, sizeof(query), "SELECT * FROM accounts WHERE Name='%s'", MDCinfo[playerid][1][mChecking]);
- mysql_function_query(handlesql, query, true, "MDCPlayer", "d", playerid);
- }
- else
- {
- format(query, sizeof(query), "SELECT * FROM tickets WHERE time='%e'", MDCinfo[playerid][listitem][mTime]);
- mysql_function_query(handlesql, query, true, "MDCPlayer6", "d", playerid);
- }
- }
- case 292:
- {
- new query[128];
- format(query, sizeof(query), "SELECT * FROM tickets WHERE player='%s' ORDER BY ID DESC", MDCinfo[playerid][1][mChecking]);
- mysql_function_query(handlesql, query, true, "MDCPlayer5", "d", playerid);
- }
- //==========================================================//
- case 293: // Using /tickets
- {
- new query[128];
- if(response)
- {
- format(query, sizeof(query), "SELECT * FROM tickets WHERE time='%s'", MDCinfo[playerid][listitem][mTime]);
- mysql_function_query(handlesql, query, true, "GetTicketsP2", "i", playerid);
- }
- }
- //==========================================================//
- case 294: //Toys
- {
- if(!response) return 1;
- SetPVarInt(playerid, "ToyBoneC", listitem + 1);
- new countid = -1;
- for(new i = 0; i < 5; i++) {
- if(ToyInfo[playerid][i][tModel] == 0) {
- countid = i;
- break;
- }
- }
- if(countid == -1) {
- SetPVarInt(playerid, "ToyBoneC", 0);
- return SendClientMessage(playerid, COLOR_RED, "No free toy slots!");
- }
- new modelid = GetPVarInt(playerid,"ToyModelC");
- new boneid = GetPVarInt(playerid,"ToyBoneC");
- SetPlayerAttachedObject(playerid, countid, modelid, boneid, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
- EditAttachedObject(playerid, countid);
- }
- case 295: //Toys buying
- {
- new countid = -1;
- for(new i = 0; i < 5; i++) {
- if(ToyInfo[playerid][i][tModel] == 0) {
- countid = i;
- break;
- }
- }
- if(countid == -1) {
- SetPVarInt(playerid, "ToyBoneC", 0);
- SetPVarInt(playerid, "ToyModelC", 0);
- return SendClientMessage(playerid, COLOR_RED, "No free toy slots!");
- }
- if(!response) {
- RemovePlayerAttachedObject(playerid, countid);
- SetPVarInt(playerid, "ToyBoneC", 0);
- SetPVarInt(playerid, "ToyModelC", 0);
- } else {
- if(GetPVarInt(playerid, "ToyModelC") > 0) //to avoid crashes.
- {
- ToyInfo[playerid][countid][tID] = countid;
- ToyInfo[playerid][countid][tBone] = GetPVarInt(playerid, "ToyBoneC");
- ToyInfo[playerid][countid][tModel] = GetPVarInt(playerid, "ToyModelC");
- ToyInfo[playerid][countid][toX] = GetPVarFloat(playerid, "ToyoX");
- ToyInfo[playerid][countid][toY] = GetPVarFloat(playerid, "ToyoY");
- ToyInfo[playerid][countid][toZ] = GetPVarFloat(playerid, "ToyoZ");
- ToyInfo[playerid][countid][trX] = GetPVarFloat(playerid, "ToyrX");
- ToyInfo[playerid][countid][trY] = GetPVarFloat(playerid, "ToyrY");
- ToyInfo[playerid][countid][trZ] = GetPVarFloat(playerid, "ToyrZ");
- ToyInfo[playerid][countid][tsX] = GetPVarFloat(playerid, "ToysX");
- ToyInfo[playerid][countid][tsY] = GetPVarFloat(playerid, "ToysY");
- ToyInfo[playerid][countid][tsZ] = GetPVarFloat(playerid, "ToysZ");
- if(IsPlayerAttachedObjectSlotUsed(playerid,countid)) {
- RemovePlayerAttachedObject(playerid, countid);
- }
- scm(playerid, -1, "Item bought - use /items to put it on.");
- new query[516];
- format(query, sizeof(query), "INSERT INTO toys (`PlayerName`, `indexID`,`modelid`,`bone`) VALUES ('%s',%d,%d,%d)", PlayerName(playerid), countid, ToyInfo[playerid][countid][tModel], ToyInfo[playerid][countid][tBone]);
- mysql_tquery(handlesql, query);
- SaveToys(playerid);
- }
- }
- }
- case 296: //Edit/Take off/Delete items
- {
- if(!response) return 1;
- new diatxt[255], count = 0;
- for(new i = 0; i < 5; i++) {
- if(ToyInfo[playerid][i][tModel] != 0) {
- count++;
- format(diatxt, sizeof(diatxt), "%s Slot %d: %s\n", diatxt, i,GetAttachmentName(ToyInfo[playerid][i][tModel]));
- } else {
- format(diatxt, sizeof(diatxt), "%s Slot %d: NONE\n", diatxt, i);
- }
- }
- if(count == 0) { ShowPlayerDialog(playerid, 400, DIALOG_STYLE_MSGBOX, "Items", "No items found", "Close", " "); }
- switch(listitem)
- {
- case 0: //Edit
- {
- ShowPlayerDialog(playerid, 401, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
- }
- case 1: //Edit Color
- {
- ShowPlayerDialog(playerid, 563, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
- }
- case 2: //Take off
- {
- ShowPlayerDialog(playerid, 402, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
- }
- case 3: //Put on
- {
- ShowPlayerDialog(playerid, 403, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
- }
- case 4: //Remove
- {
- ShowPlayerDialog(playerid, 404, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
- }
- }
- }
- case 297:
- {
- new found = 0;
- foreach(new i : Player)
- {
- if(GetPVarInt(i, "PlayerLogged") == 1)
- {
- format(string, 128, "%d", GetPVarInt(i, "PhoneNum"));
- if(strcmp(string, inputtext, true) == 0)
- {
- found++;
- if(GetPVarInt(i, "OnPhone") > 60)
- {
- format(string, sizeof(string), "HQ: Officer %s requested a trace of (%d)",PlayerName(playerid), inputtext);
- SendFactionMessage(1, COLOR_BLUE, string);
- format(string, sizeof(string), "HQ: Location: %s",GetPlayerArea(i));
- SendFactionMessage(1, COLOR_BLUE, string);
- }
- else return scm(playerid, COLOR_BLUE, "HQ: Sorry, number could not be localized. It hasn't been in use for sixty seconds.");
- }
- }
- }
- if(found == 0) return scm(playerid, COLOR_BLUE, "HQ: Phone Number unknown.");
- }
- //==========================================================//
- case 300: //Bizz buy dialog
- {
- if(response)
- {
- foreach(new h : BizIterator) {
- if(GetPVarInt(playerid, "OnRoute") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently on a route!");
- if(BizInfo[h][ID] != 0) {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[h][Xo], BizInfo[h][Yo], BizInfo[h][Zo]))
- {
- if(BizInfo[h][Owned] == 0)
- {
- if(GetPVarInt(playerid, "BizzKey") == 0)
- {
- if(GetPVarInt(playerid, "Bank") < BizInfo[h][Value])
- {
- error(playerid, "Insufficient funds.");
- }
- else
- {
- SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank") - BizInfo[h][Value]);
- SendClientMessage(playerid, -1, "Congratulations on your property!");
- SetPVarInt(playerid, "BizzKey", h);
- BizInfo[h][Owned] = 1;
- format(BizInfo[h][Owner], 25, PlayerName(playerid));
- BizInfo[h][Combo] = 1000+random(8999);
- SaveBiz(h);
- OnPlayerDataSave(playerid);
- return 1;
- }
- }
- else
- {
- error(playerid, "You already own a business.");
- }
- }
- else
- {
- error(playerid, "Property not for sale.");
- }
- }
- }
- }
- }
- }
- case 301:
- {
- if(!response) return 1;
- if(strlen(inputtext) > 80) return error(playerid, "Slogan is too long.");
- new bid = GetPVarInt(playerid, "BizzKey");
- format(BizInfo[bid][Slogan], 80, inputtext);
- scm(playerid, -1, "Slogan has been changed.");
- SaveBiz(bid);
- OnPlayerDataSave(playerid);
- }
- case 302:
- {
- if(!response) return 1;
- if(strval(inputtext) > 100 || strval(inputtext) < 1) return error(playerid, "Invalid number.");
- new bid = GetPVarInt(playerid, "BizzKey");
- BizInfo[bid][EnterPrice] = strval(inputtext);
- scm(playerid, -1, "Entrance Fee has been changed.");
- SaveBiz(bid);
- OnPlayerDataSave(playerid);
- }
- case 303:
- {
- if(!response) return 1;
- if(strlen(inputtext) > 14) return error(playerid, "Name is too long.");
- new slg[128], bid = GetPVarInt(playerid, "BizzKey");
- mysql_escape_string(inputtext, slg);
- format(BizInfo[bid][Name], 80, slg);
- scm(playerid, -1, "Name has been changed.");
- SaveBiz(bid);
- OnPlayerDataSave(playerid);
- }
- case 401: //Edit item
- {
- if(!response) return 1;
- if(ToyInfo[playerid][listitem][tModel] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, listitem))
- {
- EditAttachedObject(playerid, listitem);
- }
- else
- {
- error(playerid, "You have no equipped item in this slot.");
- }
- }
- case 402: //Take off item
- {
- if(!response) return 1;
- if(ToyInfo[playerid][listitem][tModel] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, listitem))
- {
- RemovePlayerAttachedObject(playerid, listitem);
- }
- else
- {
- error(playerid, "You have no equipped item in this slot.");
- }
- }
- case 403: //Put on item
- {
- if(!response) return 1;
- if(ToyInfo[playerid][listitem][tModel] == 0) return error(playerid, "You have no item in this slot.");
- if(IsPlayerAttachedObjectSlotUsed(playerid, listitem) == 0)
- {
- if(IsValidClothing(ToyInfo[playerid][listitem][tModel]))
- {
- SetPlayerAttachedObject(playerid, ToyInfo[playerid][listitem][tID], ToyInfo[playerid][listitem][tModel], ToyInfo[playerid][listitem][tBone],
- ToyInfo[playerid][listitem][toX],ToyInfo[playerid][listitem][toY],ToyInfo[playerid][listitem][toZ],
- ToyInfo[playerid][listitem][trX],ToyInfo[playerid][listitem][trY],ToyInfo[playerid][listitem][trZ],
- ToyInfo[playerid][listitem][tsX],ToyInfo[playerid][listitem][tsY],ToyInfo[playerid][listitem][tsZ],
- ARGBColors[ToyInfo[playerid][listitem][tColor]][Hex], ARGBColors[ToyInfo[playerid][listitem][tColor2]][Hex]);
- }
- }
- else
- {
- error(playerid, "You are already wearing this item.");
- }
- }
- case 404: //Delete item
- {
- if(!response) return 1;
- if(ToyInfo[playerid][listitem][tModel] != 0)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))RemovePlayerAttachedObject(playerid, listitem);
- new query[255];
- format(query, sizeof(query), "DELETE FROM `toys` WHERE PlayerName='%s' AND indexID=%d", PlayerName(playerid), listitem);
- mysql_tquery(handlesql, query);
- ToyInfo[playerid][listitem][tID] = 0;
- ToyInfo[playerid][listitem][tModel] = 0;
- }
- else
- {
- error(playerid, "You have no item in this slot.");
- }
- }
- case 405:
- {
- if(!response) return 1;
- new diatxt[1028];
- if(listitem == 0) //View
- {
- for(new i = 0; i < 19; i++)
- {
- format(diatxt, sizeof(diatxt), "%s{cccccc}APB %d:{8BE0DF} %s\n", diatxt, i + 1, APB[i]);
- }
- ShowPlayerDialog(playerid, 406, DIALOG_STYLE_LIST, "APB", diatxt, "Close","");
- }
- if(listitem == 1) //Add
- {
- new found = 0;
- for(new i = 0; i < 19; i++)
- {
- if(strlen(APB[i]) > 3) found++;
- }
- if(found < 19) ShowPlayerDialog(playerid, 407, DIALOG_STYLE_INPUT, "APB", "Enter your APB", "Add","Cancel");
- else error(playerid, "No free spots.");
- }
- if(listitem == 2) //Remove
- {
- for(new i = 0; i < 19; i++)
- {
- format(diatxt, sizeof(diatxt), "%s{cccccc}APB %d:{8BE0DF} %s\n", diatxt, i + 1, APB[i]);
- }
- ShowPlayerDialog(playerid, 408, DIALOG_STYLE_LIST, "APB", diatxt, "Remove APB","Cancel");
- }
- }
- case 407: //Add APB
- {
- if(!response) return 1;
- if(strlen(inputtext) > 80) return error(playerid, "APB too long.");
- new found = -1;
- for(new i = 0; i < 19; i++)
- {
- if(found == -1)
- {
- if(strlen(APB[i]) < 3) found = i;
- }
- }
- if(found != -1)
- {
- format(APB[found], 80, "%s",inputtext);
- scm(playerid, -1, "APB placed!");
- }
- }
- case 408:
- {
- format(APB[listitem], 80, "");
- scm(playerid, -1, "APB removed!");
- }
- case 409: //Clothing store
- {
- if(!response) return 1;
- if(listitem == 0) //Buy attachment
- {
- new countid = -1;
- for(new i = 0; i < 5; i++) {
- if(ToyInfo[playerid][i][tModel] == 0) {
- countid = i;
- break;
- }
- }
- if(countid == -1) return error(playerid, "You have no free slots left.");
- new oblist[sizeof(AttachmentObjects)];
- for(new i = 0; i < sizeof(AttachmentObjects); i++)
- {
- oblist[i] = AttachmentObjects[i][attachmodel];
- }
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(AttachmentObjects), "Select item", 1, 16.0, 0.0, -55.0);
- }
- if(listitem == 1)
- {
- switch(GetPVarInt(playerid,"Sex"))
- {
- case 1: ShowModelSelectionMenuEx(playerid, MaleSkins, sizeof(MaleSkins), "[UCP] Select skin (Male)", 5, 0.0, 0.0, 0.0);
- case 2: ShowModelSelectionMenuEx(playerid, FemaleSkins, sizeof(FemaleSkins), "[UCP] Select skin (Female)", 5, 0.0, 0.0, 0.0);
- default: ShowModelSelectionMenuEx(playerid, MaleSkins, sizeof(MaleSkins), "[UCP] Select skin (Male)", 5, 0.0, 0.0, 0.0);
- }
- }
- }
- case 410: //new house int
- {
- if(!response) return 1;
- new keyh = GetPVarInt(playerid, "HouseKey");
- scm(playerid, COLOR_ORANGE, "Don't forget to '/house removeall' to clean-up old house objects. This isn't automated in-case you didn't mean to change the interior.");
- new count = -1;
- new Houseclass = HouseInfo[keyh][hClass];
- for(new i = 0; i < sizeof(HouseCor); i++)
- {
- if(HouseCor[i][Class] == Houseclass)
- {
- if(count != listitem)
- {
- count++;
- HouseInfo[keyh][hXi] = HouseCor[i][mbX];
- HouseInfo[keyh][hYi] = HouseCor[i][mbY];
- HouseInfo[keyh][hZi] = HouseCor[i][mbZ];
- HouseInfo[keyh][hIntIn] = HouseCor[i][Houseint];
- }
- }
- }
- scm(playerid, -1, "Interior changed.");
- SaveHouse(keyh);
- }
- case 411: //PCR - index
- {
- if(!response) return 1;
- if(strlen(inputtext) < 3) return error(playerid, "Invalid entry");
- new name[24], query[200];
- mysql_escape_string(inputtext, name);
- SetPVarString(playerid, "PCR-name", name);
- //ShowPlayerDialog(playerid, 412, DIALOG_STYLE_LIST, "Patient Care Report", "View record\nAdd record","Continue","Close");
- format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
- mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
- }
- case 412: //PCR - Name selected - NOT IN USE.
- {
- if(!response) return 1;
- if(strlen(inputtext) < 3) return error(playerid, "Invalid entry");
- new query[200], name[24];
- GetPVarString(playerid, "PCR-name", name, 24);
- switch(listitem)
- {
- case 0:
- {
- format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
- mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
- }
- }
- }
- case 413: //PCR - See record
- {
- new query[128], name[24];
- GetPVarString(playerid, "PCR-name", name, 24);
- if(!response)
- {
- format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
- mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
- }
- else
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid, 414, DIALOG_STYLE_INPUT, "Patient Care Report", "Insert a short title/summary of the file.","Continue","");
- }
- else
- {
- format(query, sizeof(query), "SELECT * FROM pcr WHERE time='%s'", MDCinfo[playerid][listitem -1][mTime]);
- mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid,2);
- }
- }
- }
- case 414: //PCR - Insert Name
- {
- if(strlen(inputtext) < 3) return error(playerid, "Invalid entry");
- new title[50];
- mysql_escape_string(inputtext, title);
- SetPVarString(playerid, "PCR-insert-title", title);
- ShowPlayerDialog(playerid, 415, DIALOG_STYLE_LIST, "Patient Care Report - Select impact", "{33A0FF}Check-up\n{33FF66}Casual\n{FFCC33}Normal\n{FF0000}Severe","Continue","");
- }
- case 415: //PCR - Insert Severity
- {
- SetPVarInt(playerid, "PCR-insert-critic", listitem);
- ShowPlayerDialog(playerid, 416, DIALOG_STYLE_INPUT, "Patient Care Report", "Insert the detailed text of the incident (max 400 words)","Continue","");
- }
- case 416: //PCR- Insert Text
- {
- if(strlen(inputtext) < 3) return error(playerid, "Invalid entry");
- new text[400];
- mysql_escape_string(inputtext, text);
- SetPVarString(playerid, "PCR-insert-text", text);
- new query[1024], year, month, day, hour, minute, second;
- getdate(year, month, day);
- gettime(hour,minute,second);
- new datum[64], time[64];
- new name[24], title[50];
- GetPVarString(playerid, "PCR-name", name, 24);
- GetPVarString(playerid, "PCR-insert-title", title, 50);
- format(time, sizeof(time), "%d:%d:%d", hour, minute, second);
- format(datum, sizeof(datum), "%d-%d-%d", year, month, day);
- format(query, sizeof(query), "INSERT INTO `pcr`(`player`, `medic`, `date`, `time`, `text`, `title`, `critic`) VALUES ('%s','%s','%s','%s','%s','%s','%d')",
- name, PlayerName(playerid), datum, time, text, title, GetPVarInt(playerid, "PCR-insert-critic"));
- mysql_tquery(handlesql, query);
- GetPVarString(playerid, "PCR-name", name, 24);
- format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
- mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
- }
- case 417: //PCR - See in detail
- {
- new query[128], name[24];
- GetPVarString(playerid, "PCR-name", name, 24);
- format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
- mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
- }
- case 418: //Lottery
- {
- if(strval(inputtext) < 1 || strval(inputtext) > 500) return ShowPlayerDialog(playerid, 418, DIALOG_STYLE_INPUT, "Lottery ticket", "What number would you like your ticket to be? \nInsert any number between 1-500", "Buy","");
- new number = strval(inputtext);
- new query[500];
- format(query, sizeof(query), "SELECT * FROM lottery WHERE Number=%d AND Active=1", number);
- mysql_function_query(handlesql, query, true, "LotteryCheck", "iii", playerid, 1, number);
- }
- case 419: // Using /lottery
- {
- }
- case 423: //Ingame UCP
- {
- if(!response) {
- SendClientMessage(playerid, COLOR_ORANGE, "Did you know? You can use 'N' to access your inventory, or the inventory of buildings/objects.");
- return 1;
- }
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid,424,DIALOG_STYLE_LIST,"[UCP] Player Options", "Change in-game name\nChange player model\nChange player age\nChange player gender\nChange password\nChange email", "Select", "Back");
- case 1: ShowPlayerDialog(playerid,80,DIALOG_STYLE_LIST,"[UCP] Settings","Select Chatstyle\nSelect Walkstyle\nToggle Private Messages\nToggle HUD\nToggle Basic Audios\nToggle Auto Reload\nMoney Bar Color\nCellphone Color\nToggle San News\nToggle RLS Radio\nToggle L-OOC Chat\nToggle Payment TD","Select", "Back");
- case 2:
- {
- if(GetPVarInt(playerid,"Admin") < 8)
- {
- new mymem = GetPVarInt(playerid, "Member");
- if(mymem == 0 || (GetPVarInt(playerid,"Rank") < MaxRank(mymem)))
- {
- SendClientMessage(playerid,COLOR_LIGHTRED,"You don't have access to Faction Management.");
- }
- else
- {
- ShowPlayerDialog(playerid,425,DIALOG_STYLE_LIST,"[UCP] Faction Options", "Faction management", "Select", "Back");
- }
- }
- else
- {
- ShowPlayerDialog(playerid,425,DIALOG_STYLE_LIST,"[UCP] Faction Options", "Faction management\nCreate a faction\nDelete a Faction", "Select", "Back");
- }
- }
- case 3: ShowPlayerDialog(playerid,427,DIALOG_STYLE_LIST,"[UCP] Staff Options", "Change staff name", "Select", "Back");
- case 4:
- {
- if(GetPVarInt(playerid,"Admin") > 2)
- {
- curPopVar[playerid] = 0;
- curPopVarEx[playerid] = 0;
- ShowPlayerDialog(playerid,430,DIALOG_STYLE_LIST,"[UCP] Admin Options", "Ban list\nSearch ban list", "Select", "Back");
- }
- else
- {
- //ShowPlayerDialog(playerid,430,DIALOG_STYLE_LIST,"[UCP] Admin Options", "No options", "Select", "Back");
- SendClientMessage(playerid,COLOR_YELLOW,"No options currently available for your admin-level.");
- }
- }
- }
- }
- case 424: //UCPRelated Player Options
- {
- if(!response) return EnableUCP(playerid, 0);
- switch(listitem)
- {
- case 0: //UCPRelated Change ingame name (dialogid: 426)
- {
- if(GetPVarInt(playerid,"UCPMode") != 1) {
- ShowPlayerDialog(playerid,426,DIALOG_STYLE_INPUT,"[UCP] Choose your name","Firstname_Lastname ($10,000 or NC Ticket)","Continue", "Cancel");
- } else { return SendClientMessage(playerid,COLOR_LIGHTRED,"You cannot change your name during your first use of the UCP."); }
- }
- case 1: //UCPRelated Change player model (dialogid: 427)
- {
- new myint = GetPlayerInterior(playerid);
- if((myint != 1 && myint != 5 && myint != 15 && myint != 18 && myint != 14) && GetPVarInt(playerid,"UCPMode") != 1)
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "You must be inside a clothing store to change your clothes.");
- }
- else
- {
- switch(GetPVarInt(playerid,"Sex"))
- {
- case 1: ShowModelSelectionMenuEx(playerid, MaleSkins, sizeof(MaleSkins), "[UCP] Select skin (Male)", 5, 0.0, 0.0, 0.0);
- case 2: ShowModelSelectionMenuEx(playerid, FemaleSkins, sizeof(FemaleSkins), "[UCP] Select skin (Female)", 5, 0.0, 0.0, 0.0);
- default: ShowModelSelectionMenuEx(playerid, MaleSkins, sizeof(MaleSkins), "[UCP] Select skin (Male)", 5, 0.0, 0.0, 0.0);
- }
- }
- }
- case 2: //UCPRelated Change player age (dialogid: 428)
- {
- ShowPlayerDialog(playerid,428,DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 10 and 110.","Continue", "Cancel");
- }
- case 3: //UCPRelated Change player gender (dialogid: 429)
- {
- ShowPlayerDialog(playerid,429,DIALOG_STYLE_LIST,"[UCP] Choose your gender", "Male\nFemale", "Select", "Cancel");
- }
- case 4: //UCPRelated Change player password (dialogid: 442)
- {
- ShowPlayerDialog(playerid,442,DIALOG_STYLE_INPUT,"[UCP] Choose a new password","Enter your new password below","Continue", "Cancel");
- }
- case 5: //UCPRelated Change player email (dialogid: 516)
- {
- ShowPlayerDialog(playerid,516,DIALOG_STYLE_INPUT,"[UCP] Choose a new email","Enter your new email below","Continue", "Cancel");
- }
- }
- }
- case 425: //UCPRelated Faction Options
- {
- if(!response) return EnableUCP(playerid, 0);
- switch(listitem)
- {
- case 0: //Faction management
- {
- if(GetPVarInt(playerid,"Admin") < 8)
- {
- new mymem = GetPVarInt(playerid, "Member");
- if(mymem != 1 && (GetPVarInt(playerid, "Rank") >= MaxRank(mymem)))
- {
- new query[64];
- format(query,64,"SELECT Name FROM factions WHERE ID=%d",mymem);
- mysql_function_query(handlesql,query,true,"ManageFaction","d",playerid);
- }
- }
- else
- {
- mysql_function_query(handlesql,"SELECT Name FROM factions",true,"AManageFactions","d",playerid);
- }
- }
- case 1:
- {
- ShowPlayerDialog(playerid,438,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 1)","What is this factions ID? (number)", "Next", "Cancel");
- }
- case 2: //Delete-A-Faction
- {
- ShowPlayerDialog(playerid, 535, DIALOG_STYLE_INPUT, "Delete a faction", "What is the ID of the faction you'd like to delete?", "Go", "Cancel");
- }
- }
- }
- case 426: //UCPRelated Change ingame name
- {
- if(response != 1) return 1;
- if(!strlen(inputtext)) return 1;
- if(strlen(inputtext) < 3 || strlen(inputtext) > 24) return SendClientMessage(playerid,COLOR_LIGHTRED,"Names must be between 3 and 24 characters long.");
- if(!NameIsRP(inputtext)) return SendClientMessage(playerid,COLOR_LIGHTRED,"The name you have selected doesn't qualify as an RP name. (FORMAT: Firstname_Lastname)");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your request is being processed...");
- SetPVarString(playerid, "NCTo", inputtext);
- new query[82];
- mysql_format(handlesql, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%s'", inputtext);
- mysql_function_query(handlesql, query, true, "HandleNC", "i", playerid);
- }
- case 427: //Staff member options
- {
- if(!response) return EnableUCP(playerid, 0);
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid,431,DIALOG_STYLE_INPUT,"[UCP] Choose your staff-name","Pick your OOC staff-member name","Continue", "Cancel");
- }
- }
- case 428: //UCPRelated Change player age
- {
- if(!response) {
- if(GetPVarInt(playerid,"UCPMode") == 1) {
- SetPVarInt(playerid, "Age", 21);
- ShowPlayerDialog(playerid, 429, DIALOG_STYLE_LIST, "[UCP] Choose your gender", "Male\nFemale", "Select", "Cancel");
- }
- return 1;
- }
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 428, DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 10 and 110.", "Continue", "Cancel");
- new age = strval(inputtext);
- if(age < 10 || age > 110) {
- ShowPlayerDialog(playerid, 428, DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 19 and 110.", "Continue", "Cancel");
- return SendClientMessage(playerid, COLOR_LIGHTRED, "Your age must be between 10 and 110.");
- }
- SetPVarInt(playerid,"Age",age);
- format(string,sizeof(string),"Your age has been set to %i.",age);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- OnPlayerDataSave(playerid);
- if(GetPVarInt(playerid,"UCPMode") == 1) { ShowPlayerDialog(playerid, 429, DIALOG_STYLE_LIST, "[UCP] Choose your gender", "Male\nFemale", "Select", "Cancel"); }
- }
- case 429: //UCPRelated Change player gender
- {
- if(!response) {
- if(GetPVarInt(playerid,"UCPMode") == 1) { CallRemoteFunction("StartingUCP", "i", playerid); }
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- SetPVarInt(playerid, "Sex", 1);
- SendClientMessage(playerid, COLOR_YELLOW, "Your gender has been set to 'Male'.");
- OnPlayerDataSave(playerid);
- }
- case 1:
- {
- SetPVarInt(playerid,"Sex",2);
- SendClientMessage(playerid, COLOR_YELLOW, "Your gender has been set to 'Female'.");
- OnPlayerDataSave(playerid);
- }
- }
- if(GetPVarInt(playerid,"UCPMode") == 1) { CallRemoteFunction("StartingUCP", "i", playerid); }
- }
- case 430: //UCPRelated Admin UCP options
- {
- if(!response) return EnableUCP(playerid, 0);
- switch(listitem)
- {
- case 0:
- {
- mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanList","i",playerid);
- }
- case 1: ShowPlayerDialog(playerid,437,DIALOG_STYLE_INPUT,"[UCP] Search for ban","Name or part of banned player name.","Continue", "Cancel");
- default: mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanList","i",playerid);
- }
- }
- case 431: //UCPRelated Change Staff Name
- {
- if(response != 1) return 1;
- if(!strlen(inputtext)) return 1;
- if(strlen(inputtext) < 3 || strlen(inputtext) > 24) return SendClientMessage(playerid,COLOR_LIGHTRED,"Staff names must be between 3 and 24 characters long.");
- new safename[25];
- mysql_real_escape_string(inputtext, safename);
- mysql_format(handlesql, string, sizeof(string), "SELECT NULL FROM accounts WHERE ForumName='%s'", safename);
- mysql_tquery(handlesql, string, "CheckForumName", "is", playerid, inputtext);
- }
- case 432:
- {
- if(response)
- {
- SetPVarString(playerid,"CurBLPlayer",inputtext);
- return ShowPlayerDialog(playerid,433,DIALOG_STYLE_LIST,"Ban list options","Previous page\nView ban info","Select", "Exit");
- }
- else
- {
- if(GetPVarInt(playerid,"EndOfBL") == 1) return 1;
- curPopVar[playerid]++;
- mysql_tquery(handlesql, "SELECT bUsername FROM bans", "PopulateBanList", "i", playerid);
- }
- }
- case 433:
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- curPopVar[playerid]--;
- if(curPopVar[playerid] < 0) curPopVar[playerid] = 0;
- mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanList","i",playerid);
- }
- case 1:
- {
- new curBanPly[MAX_PLAYER_NAME];
- GetPVarString(playerid,"CurBLPlayer",curBanPly,MAX_PLAYER_NAME);
- new query[80];
- format(query,80,"SELECT * FROM bans WHERE bUsername='%s'",curBanPly);
- mysql_tquery(handlesql,query,"ShowBanInfo","i",playerid);
- }
- }
- }
- case 434:
- {
- if(response)
- {
- SetPVarString(playerid,"CurBLPlayer",inputtext);
- return ShowPlayerDialog(playerid,435,DIALOG_STYLE_LIST,"Ban list options","Previous page\nView ban info","Select", "Exit");
- }
- else
- {
- if(GetPVarInt(playerid,"EndOfBL") == 1) return 1;
- curPopVarEx[playerid]++;
- new filter[128];
- GetPVarString(playerid,"CurBLFilter",filter,128);
- mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanListEx","is",playerid,filter);
- }
- }
- case 435:
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- curPopVarEx[playerid]--;
- if(curPopVarEx[playerid] < 0) curPopVarEx[playerid] = 0;
- new filter[128];
- GetPVarString(playerid,"CurBLFilter",filter,128);
- mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanListEx","is",playerid,filter);
- }
- case 1:
- {
- new curBanPly[MAX_PLAYER_NAME];
- GetPVarString(playerid,"CurBLPlayer",curBanPly,MAX_PLAYER_NAME);
- new query[80];
- format(query,80,"SELECT * FROM bans WHERE bUsername = '%s'",curBanPly);
- mysql_tquery(handlesql,query,"ShowBanInfo","i",playerid);
- }
- }
- }
- case 436:
- {
- if(!response) return 1;
- new curBanPly[MAX_PLAYER_NAME];
- GetPVarString(playerid,"CurBLPlayer",curBanPly,MAX_PLAYER_NAME);
- new query[128];
- format(query, sizeof(query), "DELETE FROM bans WHERE bUsername = '%s'", curBanPly);
- mysql_tquery(handlesql, query);
- format(string, 128, "AdmCmd: %s was un-banned by %s.", curBanPly, AdminName(playerid));
- SendClientMessageToAll(COLOR_LIGHTRED, string);
- format(string, sizeof(string), "[UNBAN][%s] %s", PlayerName(playerid), string);
- BanLog(string);
- }
- case 437:
- {
- if(!response) return 1;
- if(!strlen(inputtext)) return 1;
- SetPVarString(playerid,"CurBLFilter",inputtext);
- mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanListEx","is",playerid,inputtext);
- }
- case 438: //Create-A-Faction step1 (Faction ID)
- {
- if(!response)
- {
- DeletePVar(playerid,"NewF_ID");
- DeletePVar(playerid,"NewF_Name");
- DeletePVar(playerid,"NewF_Ranks");
- return SendClientMessage(playerid,COLOR_LIGHTRED,"Faction creation cancelled!");
- }
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid,438,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 1)","What is this factions ID? (number)", "Next", "Cancel");
- new num = strval(inputtext);
- if(num < 1 || num > (MAX_FACTIONS-1)) return ShowPlayerDialog(playerid,439,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 1)","What is this factions ID? (1-49)", "Next", "Cancel");
- if(FactionInfo[num][fUsed] == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"A faction with this ID already exists.");
- SetPVarInt(playerid,"NewF_ID",num);
- ShowPlayerDialog(playerid,439,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 2)","Pick a name for the faction.", "Next", "Go back");
- }
- case 439: //Create-A-Faction step2 (Pick a name)
- {
- if(!response) return ShowPlayerDialog(playerid,438,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 1)","What is this factions ID? (number)", "Next", "Cancel");
- if(!strlen(inputtext) || strlen(inputtext) < 1) return ShowPlayerDialog(playerid,439,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 2)","Pick a name for the faction.", "Next", "Go back");
- new eStr[128];
- mysql_real_escape_string(inputtext, eStr);
- SetPVarString(playerid,"NewF_Name",eStr);
- ShowPlayerDialog(playerid,440,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 3)","What is the max-rank in this faction?(1-25)", "Next", "Go back");
- }
- case 440: //Create-A-Faction step3 (What is the highest rank in this faction?)
- {
- if(!response) return ShowPlayerDialog(playerid,439,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 2)","Pick a name for the faction.", "Next", "Go back");
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid,440,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 3)","What is the max-rank in this faction?(1-25)", "Next", "Go back");
- new num = strval(inputtext);
- if(num < 1 || num > 25) return ShowPlayerDialog(playerid,440,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 3)","What is the max-rank in this faction?(1-25)", "Next", "Go back");
- SetPVarInt(playerid,"NewF_Ranks",num);
- ShowPlayerDialog(playerid,441,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 4)","Does the faction have weapon/drug rights?\n(0-None/1-Guns/2-Drugs[1]/3-Drugs[2])", "Finish", "Go back");
- }
- case 441: //Create-A-Faction step4 (Should the faction have weapon rights?)
- {
- if(!response) return ShowPlayerDialog(playerid,440,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 3)","What is the max-rank in this faction?(1-25)", "Next", "Go back");
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid,441,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 4)","Does the faction have weapon/drug rights?\n(0-None/1-Guns/2-Drugs[1]/3-Drugs[2])", "Finish", "Go back");
- new num = strval(inputtext);
- if(num < 0 || num > 3) return ShowPlayerDialog(playerid,441,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 4)","Does the faction have weapon/drug rights?\n(0-None/1-Guns/2-Drugs[1]/3-Drugs[2])", "Finish", "Go back");
- new name[48];
- GetPVarString(playerid,"NewF_Name",name,48);
- CreateFaction(playerid,GetPVarInt(playerid,"NewF_ID"),name,GetPVarInt(playerid,"NewF_Ranks"),num);
- }
- case 442: //UCPRelated Change password
- {
- if(response != 1) return 1;
- if(!strlen(inputtext)) return 1;
- if(strlen(inputtext) < 4) return SendClientMessage(playerid,COLOR_LIGHTRED,"Your password must be at least 4 characters long.");
- new newpass[128];
- format(newpass,128,"%s",inputtext);
- SetPVarString(playerid,"NewPass",newpass);
- ShowPlayerDialog(playerid,443,DIALOG_STYLE_INPUT,"Confirm your new password","Enter the same password.", "Finish", "Cancel");
- }
- case 443: //UCPRelated Confirm new password
- {
- if(response != 1)
- {
- DeletePVar(playerid,"NewPass");
- return 1;
- }
- if(!strlen(inputtext))
- {
- DeletePVar(playerid,"NewPass");
- return 1;
- }
- if(strlen(inputtext) < 4)
- {
- DeletePVar(playerid,"NewPass");
- return SendClientMessage(playerid,COLOR_LIGHTRED,"Your password must be at least 4 characters long.");
- }
- new newpass[128];
- GetPVarString(playerid,"NewPass",newpass,128);
- if(!strmatch(newpass,inputtext)) return SendClientMessage(playerid,COLOR_LIGHTRED,"The passwords you have entered do not match!");
- new query[256];
- SHA256_PassHash(newpass, HASH_KEY, newpass, 65);
- format(query,256,"UPDATE accounts SET Pass='%s' WHERE Name='%s'",newpass,PlayerName(playerid));
- mysql_tquery(handlesql, query);
- format(PlayerInfo[playerid][pPass],65,"%s",newpass);
- SendClientMessage(playerid, COLOR_GREEN, "Your password has been successfully changed!");
- DeletePVar(playerid,"NewPass");
- }
- case 447:
- {
- if(!response) return 1;
- new keyex = FurnRight(playerid, 2);
- if(keyex == -1) return 1;
- CallRemoteFunction("SetBizCP", "ii", playerid, keyex);
- }
- case 501: //What layer do you want to change? Material-editing.
- {
- if(!response) return 1;
- SetPVarInt(playerid, "FurnEditL", listitem);
- new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
- ChangeDynamicObjectMaterial(BizInfo[key2][bObject][h], listitem, 30);
- new list[2048];
- for(new i=0; i < sizeof(MaterialIDs); i++)
- {
- format(list,2048,"%s\n%s",list,MaterialIDs[i][Name]);
- }
- ShowPlayerDialog(playerid, 502, DIALOG_STYLE_LIST, "Material List", list, "Select", "Back");
- }
- case 502: //Object Material List
- {
- new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
- if(!response) {
- if(IsValidDynamicObject(BizInfo[key2][bObject][h])) DestroyDynamicObject(BizInfo[key2][bObject][h]);
- BizInfo[key2][bObject][h] = CreateDynamicObject(BizInfo[key2][boID][h], BizInfo[key2][boX][h], BizInfo[key2][boY][h], BizInfo[key2][boZ][h], BizInfo[key2][borX][h], BizInfo[key2][borY][h], BizInfo[key2][borZ][h], key2);
- for( new v=0; v < 13; v++) {
- if(BizMInfo[key2][h][v] != 0) {
- ChangeDynamicObjectMaterial(BizInfo[key2][bObject][h], v, BizMInfo[key2][h][v]);
- }
- }
- Streamer_Update(playerid);
- DeletePVar(playerid,"FurnEditL");
- return ShowPlayerDialog(playerid, 501, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
- }
- if(listitem == 0) {
- BizMInfo[key2][h][GetPVarInt(playerid,"FurnEditL")] = 0;
- if(IsValidDynamicObject(BizInfo[key2][bObject][h])) DestroyDynamicObject(BizInfo[key2][bObject][h]);
- BizInfo[key2][bObject][h] = CreateDynamicObject(BizInfo[key2][boID][h], BizInfo[key2][boX][h], BizInfo[key2][boY][h], BizInfo[key2][boZ][h], BizInfo[key2][borX][h], BizInfo[key2][borY][h], BizInfo[key2][borZ][h], key2);
- for( new v=0; v < 13; v++) {
- if(BizMInfo[key2][h][v] != 0) {
- ChangeDynamicObjectMaterial(BizInfo[key2][bObject][h], v, BizMInfo[key2][h][v]);
- }
- }
- Streamer_Update(playerid);
- SaveBizzObj(key2, h);
- format(string, sizeof(string), "Object %d's material layer %d reset to default.",BizInfo[key2][bObject][h],GetPVarInt(playerid,"FurnEditL"));
- return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- }
- ChangeDynamicObjectMaterial(BizInfo[key2][bObject][h], GetPVarInt(playerid,"FurnEditL"), listitem);
- BizMInfo[key2][h][GetPVarInt(playerid,"FurnEditL")] = listitem;
- SaveBizzObj(key2, h);
- format(string, sizeof(string), "Object %d's material layer %d changed to: '%s'.",BizInfo[key2][bObject][h],GetPVarInt(playerid,"FurnEditL"),MaterialIDs[listitem][Name]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid,"FurnEditL");
- }
- case 503: //What layer do you want to change? Material-editing.
- {
- if(!response) return 1;
- SetPVarInt(playerid, "FurnEditL", listitem);
- new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1);
- ChangeDynamicObjectMaterial(HouseInfo[key2][hObject][h], listitem, 30);
- new list[2048];
- for(new i=0; i < sizeof(MaterialIDs); i++)
- {
- format(list,2048,"%s\n%s",list,MaterialIDs[i][Name]);
- }
- ShowPlayerDialog(playerid, 504, DIALOG_STYLE_LIST, "Material List", list, "Select", "Back");
- }
- case 504: //Object Material List
- {
- new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1);
- if(!response) {
- if(IsValidDynamicObject(HouseInfo[key2][hObject][h])) DestroyDynamicObject(HouseInfo[key2][hObject][h]);
- HouseInfo[key2][hObject][h] = CreateDynamicObject(HouseInfo[key2][hoID][h], HouseInfo[key2][hoX][h], HouseInfo[key2][hoY][h], HouseInfo[key2][hoZ][h], HouseInfo[key2][horX][h], HouseInfo[key2][horY][h], HouseInfo[key2][horZ][h], key2);
- for( new v=0; v < 13; v++) {
- if(HouseMInfo[key2][h][v] != 0) {
- ChangeDynamicObjectMaterial(HouseInfo[key2][hObject][h], v, HouseMInfo[key2][h][v]);
- }
- }
- Streamer_Update(playerid);
- DeletePVar(playerid,"FurnEditL");
- return ShowPlayerDialog(playerid, 503, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
- }
- if(listitem == 0) {
- HouseMInfo[key2][h][GetPVarInt(playerid,"FurnEditL")] = 0;
- if(IsValidDynamicObject(HouseInfo[key2][hObject][h])) DestroyDynamicObject(HouseInfo[key2][hObject][h]);
- HouseInfo[key2][hObject][h] = CreateDynamicObject(HouseInfo[key2][hoID][h], HouseInfo[key2][hoX][h], HouseInfo[key2][hoY][h], HouseInfo[key2][hoZ][h], HouseInfo[key2][horX][h], HouseInfo[key2][horY][h], HouseInfo[key2][horZ][h], key2);
- for( new v=0; v < 13; v++) {
- if(HouseMInfo[key2][h][v] != 0) {
- ChangeDynamicObjectMaterial(HouseInfo[key2][hObject][h], v, HouseMInfo[key2][h][v]);
- }
- }
- Streamer_Update(playerid);
- SaveFurnObj(key2, h);
- format(string, sizeof(string), "Object %d's material layer %d reset to default.",HouseInfo[key2][hObject][h],GetPVarInt(playerid,"FurnEditL"));
- return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- }
- ChangeDynamicObjectMaterial(HouseInfo[key2][hObject][h], GetPVarInt(playerid,"FurnEditL"), listitem);
- HouseMInfo[key2][h][GetPVarInt(playerid,"FurnEditL")] = listitem;
- SaveFurnObj(key2, h);
- format(string, sizeof(string), "Object %d's material layer %d changed to: '%s'.",HouseInfo[key2][hObject][h],GetPVarInt(playerid,"FurnEditL"),MaterialIDs[listitem][Name]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid,"FurnEditL");
- }
- case 505:
- {
- if(response)
- {
- new found, foundid, Float:pos[3], result[500];
- for(new i = 0; i < sizeof(CorpInfo); i++)
- {
- if(CorpInfo[i][cUsed] == 1 && found == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, CorpInfo[i][cX], CorpInfo[i][cY], CorpInfo[i][cZ]))
- {
- found++;
- foundid = i;
- }
- }
- }
- if(found == 0) return 1;
- switch(listitem)
- {
- case 0: // Examine
- {
- format(result, 500, "%s\n%s", CorpInfo[foundid][cNote1], CorpInfo[foundid][cNote2]);
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Corpse Information", result, "Close", "");
- }
- case 1: // Store In Vehicle
- {
- if(GetPVarInt(playerid, "Dead") > 0) return 1;
- if(GetPVarInt(playerid, "Mute") == 1) return 1;
- if(GetPVarInt(playerid, "Cuffed") != 0) return 1;
- new vehicleID = PlayerToCar(playerid, 2, 4.0);
- if(vehicleID == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_GREY, "You aren't near any vehicles.");
- if(!IsTrunkCar(GetVehicleModel(vehicleID))) return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't have a suitable trunk!");
- if(VehicleInfo[vehicleID][vTrunk] == 0) return SendClientMessage(playerid, COLOR_GREY, "The vehicles trunk must be opened.");
- GetVehiclePos(vehicleID, pos[0], pos[1], pos[2]);
- if(IsPlayerInRangeOfPoint(playerid, 10.0, pos[0], pos[1], pos[2]))
- {
- if(VehicleInfo[vehicleID][vCorp] > 0 && CorpInfo[VehicleInfo[vehicleID][vCorp]][cUsed] == 1) return scm(playerid, -1, "There's a corpse already in this vehicle!");
- scm(playerid, -1, "Corpse stored in the vehicle!");
- CorpInfo[foundid][cTime]=60;
- CorpInfo[foundid][cVeh]=vehicleID;
- VehicleInfo[vehicleID][vCorp]=foundid;
- DestroyDynamic3DTextLabel(CorpInfo[foundid][cText]);
- if(IsValidActor(CorpInfo[foundid][cBody])) {
- DestroyActorEx(CorpInfo[foundid][cBody]);
- }
- }
- else SendClientMessage(playerid, COLOR_GREY, "You are not around your vehicle.");
- }
- case 2: // Corpse removed
- {
- RemoveCorpse(foundid);
- scm(playerid, -1, "Corpse discarded.");
- }
- }
- }
- }
- case 506:
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return scm(playerid,-1,"Safe-combos are numeric. (4-digits)");
- new combo = strval(inputtext);
- if(combo < 1000 || combo > 9999) return scm(playerid,-1,"Safe-combos are 4 digits long.");
- new id = GetPVarInt(playerid,"HouseEnter");
- if(HouseInfo[id][hCombo] == combo) {
- HouseInfo[id][sLocked] = 0;
- scm(playerid,COLOR_ORANGE,"House safe(s) unlocked!");
- SaveHouse(id);
- format(string, sizeof(string), "%s tried to open house-safe #%i with the combination %i and succeeded.", PlayerName(playerid), id, inputtext);
- SafeLog(string);
- } else {
- SendMessageByName(HouseInfo[id][hOwner],COLOR_BLUE,"[Safe-Alert] Someone has entered an incorrect combination for your house-safe.");
- format(string, sizeof(string), "%s tried to open house-safe #%i with the combination %i and failed.", PlayerName(playerid), id, inputtext);
- SafeLog(string);
- }
- }
- case 507:
- {
- if(!response) return 1;
- if(!IsNumeric(inputtext)) return scm(playerid,-1,"Safe-combos are numeric. (4-digits)");
- new combo = strval(inputtext);
- if(combo < 1000 || combo > 9999) return scm(playerid,-1,"Safe-combos are 4 digits long.");
- new id = GetPVarInt(playerid,"BizzEnter");
- if(BizInfo[id][Combo] == combo) {
- BizInfo[id][sLocked] = 0;
- scm(playerid,COLOR_ORANGE,"Business safe(s) unlocked!");
- SaveBiz(id);
- format(string, sizeof(string), "%s tried to open business-safe #%i with the combination %i and succeeded.", PlayerName(playerid), id, inputtext);
- SafeLog(string);
- } else {
- SendMessageByName(BizInfo[id][Owner],COLOR_BLUE,"[Safe-Alert] Someone has entered an incorrect combination for your business-safe.");
- format(string, sizeof(string), "%s tried to open business-safe #%i with the combination %i and failed.", PlayerName(playerid), id, inputtext);
- SafeLog(string);
- }
- }
- case 508:
- {
- new mtg = GetPVarInt(playerid, "MarriagePlayer"), result[256];
- DeletePVar(playerid,"MarriagePlayer");
- switch(response)
- {
- case 0:
- {
- format(string,sizeof(string),"%s denied your marriage offer.", PlayerName(playerid));
- SendClientMessage(mtg, COLOR_WHITE, string);
- DeletePVar(mtg, "MarriagePlayer");
- }
- case 1:
- {
- strmid(PlayerInfo[playerid][pMarriedTo], PlayerName(mtg), 0, strlen(PlayerName(mtg)), 255);
- strmid(PlayerInfo[mtg][pMarriedTo], PlayerName(playerid), 0, strlen(PlayerName(playerid)), 255);
- if(GetPVarInt(playerid, "Sex") == GetPVarInt(mtg, "Sex")) {
- format(result, 256,"(( Marriage News: We have a new lovely gay couple, %s & %s have been legally married. ))", PlayerName(playerid), PlayerName(mtg));
- } else {
- format(result, 256,"(( Marriage News: We have a new lovely couple, %s & %s have been married. ))", PlayerName(playerid), PlayerName(mtg)); }
- SendClientMessageToAll(-1, result);
- DeletePVar(mtg,"MarriagePlayer");
- GivePlayerMoneyEx(playerid,-20000);
- scm(playerid,COLOR_GREY,"You've spent $20,000 on your wedding.");
- OnPlayerDataSave(playerid);
- OnPlayerDataSave(mtg);
- }
- }
- }
- case 509:
- {
- if(!response) // RETURN TO MENU
- {
- DeletePVar(playerid, "RimID");
- SetPVarInt(playerid, "VEHSEC", 0);
- CallRemoteFunction("VehMod", "i", playerid);
- return 1;
- }
- new id = GetPVarInt(playerid, "RimID");
- new rcost;
- if(GetPVarInt(playerid, "DonateRank") == 0) {
- rcost = Components[id][cPrice];
- format(string, sizeof(string), "You've bought '%s' rims for $%d.", Components[id][cName], rcost);
- }
- else {
- rcost = 0;
- format(string, sizeof(string), "You've bought '%s' rims. They were free because you are a donor.", Components[id][cName]);
- }
- if(GetPlayerMoneyEx(playerid) < rcost) {
- DeletePVar(playerid, "RimID");
- SetPVarInt(playerid, "VEHSEC", 0);
- CallRemoteFunction("VehMod", "i", playerid);
- return scm(playerid, COLOR_GREY, "You can't afford these rims.");
- }
- new keyex = GetPlayerVehicleID(playerid);
- AddVehicleComponent(keyex, Components[id][cID]);
- AddVehMod(keyex, Components[id][cID]);
- CallRemoteFunction("VehMod", "i", playerid);
- new query[300];
- mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `Mod1` = %i, `Mod2` = %i, `Mod3` = %i, `Mod4` = %i, `Mod5` = %i, `Mod6` = %i, `Mod7` = %i, \
- `Mod8` = %i, `Mod9` = %i, `Mod10` = %i, `Mod11` = %i WHERE `ID` = %i;",
- VehicleInfo[keyex][vMod][0], VehicleInfo[keyex][vMod][1], VehicleInfo[keyex][vMod][2], VehicleInfo[keyex][vMod][3], VehicleInfo[keyex][vMod][4], VehicleInfo[keyex][vMod][5],
- VehicleInfo[keyex][vMod][6], VehicleInfo[keyex][vMod][7], VehicleInfo[keyex][vMod][8], VehicleInfo[keyex][vMod][9], VehicleInfo[keyex][vMod][10], VehicleInfo[keyex][vID]);
- mysql_tquery(handlesql, query);
- GivePlayerMoneyEx(playerid, -rcost);
- PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
- scm(playerid, -1, string);
- DeletePVar(playerid, "RimID");
- }
- case 510: // Application list
- {
- if(!response) return 1;
- SetPVarString(playerid, "ReviewName", inputtext);
- format(string, sizeof(string), "You are currently viewing %s's application.", inputtext);
- scm(playerid, -1, string);
- ShowPlayerDialog(playerid, 511, DIALOG_STYLE_LIST, "Options", "Approve Player\nDeny Player\nView Application", "Select", "Exit");
- }
- case 511: // View/Accept/Deny/
- {
- if(GetPVarInt(playerid, "Delay") > GetCount()) return scm(playerid, COLOR_WHITE, "Please try again - spam prevention stopped your last action.");
- new query[128];
- if(!response) {
- DeletePVar(playerid, "ReviewName");
- mysql_format(handlesql, query, sizeof(query), "SELECT `Name` FROM applications");
- mysql_tquery(handlesql, query, "PopulateAppMenu", "i", playerid);
- return 1;
- }
- switch(listitem)
- {
- case 0: //Approve app
- {
- new name[25];
- GetPVarString(playerid, "ReviewName", name, sizeof(name));
- mysql_format(handlesql, query, sizeof(query), "SELECT `Pass` FROM applications WHERE `Name`='%s'", name);
- mysql_tquery(handlesql, query, "OnPlayerRegister", "s", name);
- DeletePVar(playerid, "ReviewName");
- format(string, sizeof(string), "AdmCmd: %s approved player %s.", PlayerName(playerid), name);
- SendAdminAndRegMessage(COLOR_LIGHTRED,string);
- RegLog(string);
- }
- case 1: //Deny app
- {
- new name[25];
- GetPVarString(playerid, "ReviewName", name, sizeof(name));
- mysql_format(handlesql, query, sizeof(query), "DELETE FROM applications WHERE `Name`='%s'",name);
- mysql_tquery(handlesql, query);
- DeletePVar(playerid, "ReviewName");
- format(string, sizeof(string), "AdmCmd: %s denied player %s.", PlayerName(playerid), name);
- SendAdminAndRegMessage(COLOR_LIGHTRED,string);
- RegLog(string);
- new targetid = FindPlayer(name);
- if(targetid != -1) {
- scm(targetid, COLOR_RED, "Your application has been denied, please read the rules posted on www.diverseroleplay.org and try again.");
- Kick(targetid);
- }
- }
- case 2: //View app
- {
- new name[25];
- GetPVarString(playerid, "ReviewName", name, sizeof(name));
- SetPVarInt(playerid, "AppPage", 0);
- mysql_format(handlesql, query, sizeof(query), "SELECT * FROM applications WHERE `Name`='%s'", name);
- mysql_tquery(handlesql, query, "ViewAppInfo", "is", playerid, name);
- }
- }
- SetPVarInt(playerid, "Delay", GetCount()+500);
- }
- case 512: // Currently viewing an app
- {
- if(!response) {
- DeletePVar(playerid, "AppPage");
- return ShowPlayerDialog(playerid, 511, DIALOG_STYLE_LIST, "Options", "Approve Player\nDeny Player\nView Application", "Select", "Exit");
- }
- new name[25];
- GetPVarString(playerid, "ReviewName", name, sizeof(name));
- switch(GetPVarInt(playerid, "AppPage"))
- {
- case 0:
- {
- SetPVarInt(playerid, "AppPage", 1);
- }
- case 1:
- {
- SetPVarInt(playerid, "AppPage", 2);
- }
- case 2:
- {
- SetPVarInt(playerid, "AppPage", 0);
- }
- }
- new query[72];
- mysql_format(handlesql, query, sizeof(query), "SELECT * FROM applications WHERE `Name`='%s'", name);
- mysql_tquery(handlesql, query, "ViewAppInfo", "is", playerid, name);
- }
- case 513: // Your application info
- {
- if(GetPVarInt(playerid, "AccountExist") == 1) return 1;
- if(GetPVarInt(playerid, "Delay") > GetCount()) return ShowPlayerDialog(playerid, 513, DIALOG_STYLE_MSGBOX, "Spam prevention", "You can only 'Refresh' this dialog once every 5 seconds.", "Refresh", "");
- new query[100];
- mysql_format(handlesql, query, sizeof(query), "SELECT `Time` FROM applications WHERE `Name`='%s'", PlayerName(playerid));
- mysql_tquery(handlesql, query, "RefreshAppStatus", "i", playerid);
- SetPVarInt(playerid, "Delay", GetCount()+5000);
- }
- case 514: // Bare switch are you sure check.
- {
- if(!response) return 1;
- CallRemoteFunction("DoBareSwitch","i",playerid);
- }
- case 515:
- {
- if(!response) {
- DeletePVar(playerid, "ABizEdit");
- return 1;
- }
- new keyex = GetPVarInt(playerid, "ABizEdit");
- if(keyex == 0) return 1;
- CallRemoteFunction("SetBizCP", "ii", playerid, keyex);
- DeletePVar(playerid, "ABizEdit");
- }
- case 516: //UCPRelated Change email
- {
- if(!response) {
- if(GetPVarInt(playerid,"UCPMode") == 1) {
- ShowPlayerDialog(playerid, 428, DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 10 and 110.", "Continue", "Cancel");
- SendClientMessage(playerid, COLOR_BLUE, "[TIP] {FFFFFF}For password recovery reasons, please set your email by going to: '/ucp -> Player Options -> Change email'.");
- }
- return 1;
- }
- if(!strlen(inputtext) || strlen(inputtext) > 54)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Email is too long (54 Chars max).");
- ShowPlayerDialog(playerid,516,DIALOG_STYLE_INPUT,"[UCP] Choose a new email","Enter your new email below","Continue", "Cancel");
- return 1;
- }
- new newemail[54],query[256];
- mysql_real_escape_string(inputtext, newemail);
- mysql_format(handlesql, query, sizeof(query), "UPDATE accounts SET `email`='%s' WHERE Name='%s'", newemail, PlayerName(playerid));
- mysql_tquery(handlesql, query);
- format(string, sizeof(string), "Your email has been successfully changed to: %s.", inputtext);
- SendClientMessage(playerid, COLOR_GREEN, string);
- SendClientMessageEx(playerid, COLOR_BLUE, "[TIP] {FFFFFF}Please make sure the email you entered was valid, for password recovery purposes. If it wasn't you can change it by going to: '/ucp -> Player Options -> Change email' at any time.");
- if(GetPVarInt(playerid,"UCPMode") == 1) { ShowPlayerDialog(playerid, 428, DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 10 and 110.", "Continue", "Cancel"); }
- }
- case 517:
- {
- if(!response) {
- DeletePVar(playerid, "MapperRemove");
- return 1;
- }
- new text[24];
- GetPVarString(playerid, "MapperRemove", text, 24);
- RemoveMapObject(text);
- format(string, sizeof(string), "You've removed all of %s's mapping.", text);
- SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
- DeletePVar(playerid, "MapperRemove");
- }
- case 518: // Map Furniture AGREEMENT Dialog
- {
- if(!response) return true;
- BuildMapObject(playerid, PlayerInfo[playerid][pFurnID], PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], PlayerInfo[playerid][pFurnR][0], PlayerInfo[playerid][pFurnR][1], PlayerInfo[playerid][pFurnR][2]);
- }
- case 519:
- {
- if(response)
- {
- new furnid = 0, furnitname[100];
- furnitname="N/A";
- for(new xe;xe<sizeof(FurnObjs);xe++)
- {
- if(MapInfo[GetPVarInt(playerid, "FurnEditH")][mID] == FurnObjs[xe])
- {
- format(furnitname, 100, "%d", FurnObjs[xe]);
- furnid=xe;
- break;
- }
- }
- switch(listitem)
- {
- case 0: // Edit Object
- {
- new obj = 0, h = GetPVarInt(playerid, "FurnEditH");
- obj = CreatePlayerObject(playerid, MapInfo[h][mID], MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ], MapInfo[h][mrX], MapInfo[h][mrY], MapInfo[h][mrZ], 100.0);
- SetPVarInt(playerid, "FurnObject", obj);
- SetPVarInt(playerid, "EditorMode", 7);
- PlayerInfo[playerid][pFurnID]=furnid;
- Streamer_Update(playerid);
- EditPlayerObject(playerid, obj);
- format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", furnitname);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- case 1: // Input Position
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- ShowPlayerDialog(playerid, 533, DIALOG_STYLE_LIST, "What axis do you want to edit?", "X-pos\nY-pos\nZ-pos\nX-rotation\nY-rotation\nZ-rotation", "Continue", "Close");
- }
- case 2: // Select Material
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: Editing an invalid-layer MAY cause parts of the object to turn invisible, resetting the layers material will fix this.");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"When you choose a layer to edit, that layer becomes highlighted in red.");
- ShowPlayerDialog(playerid, 520, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
- }
- case 3: // Reset Material
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- new h = GetPVarInt(playerid, "FurnEditH");
- if(IsValidDynamicObject(MapInfo[h][mObject])) DestroyDynamicObject(MapInfo[h][mObject]);
- MapInfo[h][mObject] = CreateDynamicObject(MapInfo[h][mID], MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ], MapInfo[h][mrX], MapInfo[h][mrY], MapInfo[h][mrZ], MapInfo[h][mVW]);
- Streamer_Update(playerid);
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"You've reset the selected objects material.");
- for(new v=0; v < 13; v++) {
- MapMInfo[h][v] = 0;
- }
- SaveMapObj(h);
- }
- case 4: // Remove Object
- {
- if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- new h = GetPVarInt(playerid, "FurnEditH");
- if(IsValidDynamicObject(MapInfo[h][mObject])) DestroyDynamicObject(MapInfo[h][mObject]);
- MapInfo[h][mObject]=0;
- MapInfo[h][mID]=0;
- MapInfo[h][mX] = 0.0;
- MapInfo[h][mY] = 0.0;
- MapInfo[h][mZ] = 0.0;
- MapInfo[h][mrX] = 0.0;
- MapInfo[h][mrY] = 0.0;
- MapInfo[h][mrZ] = 0.0;
- MapInfo[h][mInt] = 0;
- MapInfo[h][mVW] = 0;
- mysql_format(handlesql, string, sizeof(string), "DELETE FROM `mapfurn` WHERE `ID`=%d", MapInfo[h][mDBID]);
- mysql_tquery(handlesql, string);
- }
- }
- }
- }
- case 520: //What layer do you want to change? Material-editing.
- {
- if(!response) return 1;
- SetPVarInt(playerid, "FurnEditL", listitem);
- new h = GetPVarInt(playerid, "FurnEditH");
- ChangeDynamicObjectMaterial(MapInfo[h][mObject], listitem, 30);
- new list[2048];
- for(new i=0; i < sizeof(MaterialIDs); i++)
- {
- format(list,2048,"%s\n%s",list,MaterialIDs[i][Name]);
- }
- ShowPlayerDialog(playerid, 521, DIALOG_STYLE_LIST, "Material List", list, "Select", "Back");
- }
- case 521: //Object Material List
- {
- new h = GetPVarInt(playerid, "FurnEditH");
- if(!response) {
- if(IsValidDynamicObject(MapInfo[h][mObject])) DestroyDynamicObject(MapInfo[h][mObject]);
- MapInfo[h][mObject] = CreateDynamicObject(MapInfo[h][mID], MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ], MapInfo[h][mrX], MapInfo[h][mrY], MapInfo[h][mrZ], MapInfo[h][mVW]);
- for( new v=0; v < 13; v++) {
- if(MapMInfo[h][v] != 0) {
- ChangeDynamicObjectMaterial(MapInfo[h][mObject], v, MapMInfo[h][v]);
- }
- }
- Streamer_Update(playerid);
- DeletePVar(playerid,"FurnEditL");
- return ShowPlayerDialog(playerid, 520, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
- }
- if(listitem == 0) {
- MapMInfo[h][GetPVarInt(playerid,"FurnEditL")] = 0;
- if(IsValidDynamicObject(MapInfo[h][mObject])) DestroyDynamicObject(MapInfo[h][mObject]);
- MapInfo[h][mObject] = CreateDynamicObject(MapInfo[h][mID], MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ], MapInfo[h][mrX], MapInfo[h][mrY], MapInfo[h][mrZ], MapInfo[h][mVW]);
- for( new v=0; v < 13; v++) {
- if(MapMInfo[h][v] != 0) {
- ChangeDynamicObjectMaterial(MapInfo[h][mObject], v, MapMInfo[h][v]);
- }
- }
- Streamer_Update(playerid);
- SaveMapObj(h);
- format(string, sizeof(string), "Object %d's material layer %d reset to default.",MapInfo[h][mObject],GetPVarInt(playerid,"FurnEditL"));
- return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- }
- ChangeDynamicObjectMaterial(MapInfo[h][mObject], GetPVarInt(playerid,"FurnEditL"), listitem);
- MapMInfo[h][GetPVarInt(playerid,"FurnEditL")] = listitem;
- SaveMapObj(h);
- format(string, sizeof(string), "Object %d's material layer %d changed to: '%s'.",MapInfo[h][mObject],GetPVarInt(playerid,"FurnEditL"),MaterialIDs[listitem][Name]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid,"FurnEditL");
- }
- case 522: //Map-Editor selection
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- new oblist[76], idx = 0;
- for(new i = 321; i < 398; i++)
- {
- oblist[idx] = i;
- idx++;
- }
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Weapons (Map Objects)", 13, 16.0, 0.0, -55.0);
- }
- case 1:
- {
- new oblist[25], idx = 0;
- for(new i = 700; i < 726; i++)
- {
- oblist[idx] = i;
- idx++;
- }
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Nature (Map Objects)", 13, 16.0, 0.0, -55.0);
- }
- case 2:
- {
- new oblist[20], idx = 0;
- for(new i = 1000; i < 1021; i++)
- {
- oblist[idx] = i;
- idx++;
- }
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Car Parts (Map Objects)", 13, 16.0, 0.0, -55.0);
- }
- case 3:
- {
- new oblist[25] = {
- 2918, 1433, 1484, 1486, 1518,
- 1655, 1765, 1766, 1211, 1209,
- 1227, 1222, 1225, 1340, 2222,
- 2985, 2964, 3267, 3279, 3761,
- 4563, 8493, 9900, 13592, 13594
- };
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Fun Stuff (Map Objects)", 13, 16.0, 0.0, -55.0);
- }
- case 4:
- {
- new oblist[30], idx = 0;
- for(new i = 5482; i < 5513; i++)
- {
- oblist[idx] = i;
- idx++;
- }
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Roads (Map Objects)", 13, 16.0, 0.0, -55.0);
- }
- case 5:
- {
- new oblist[33], idx = 0;
- for(new i = 966; i < 999; i++)
- {
- oblist[idx] = i;
- idx++;
- }
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Barriers (Map Objects)", 13, 16.0, 0.0, -55.0);
- }
- case 6:
- {
- new oblist[65] = {
- 1206, 1210, 1216, 1219,
- 1223, 1341, 1342, 1378,
- 1384, 1383, 1543, 1562,
- 1572, 1608, 1609, 1612,
- 1622, 1684, 3092, 2803,
- 2589, 2590, 2804, 2805,
- 2806, 16410, 12961, 12986,
- 2896, 2905, 2906, 2907,
- 2908, 2976, 3082, 3007,
- 3008, 3009, 3010, 3011,
- 3012, 3028, 3070, 3071,
- 3072, 2627, 2628, 2629,
- 2630, 3074, 3077, 3086,
- 3085, 3087, 3088, 3108,
- 3113, 3114, 3115, 2114,
- 1318, 1318, 1317, 1316,
- 1559
- };
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Various (Map Objects)", 13, 16.0, 0.0, -55.0);
- }
- case 7:
- {
- new oblist[316], idx = 0;
- for(new i = 1210; i < 1326; i++)
- {
- oblist[idx] = i;
- idx++;
- }
- for(new i = 1420; i < 1621; i++)
- {
- oblist[idx] = i;
- idx++;
- }
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Misc (Map Objects)", 13, 16.0, 0.0, -55.0);
- }
- case 8:
- {
- new oblist[sizeof(FurnObjs)];
- for(new i = 0; i < sizeof(FurnObjs); i++)
- {
- oblist[i] = FurnObjs[i];
- }
- ShowModelSelectionMenuEx(playerid, oblist, sizeof(FurnObjs), "Furniture List", 13, 16.0, 0.0, -55.0);
- }
- }
- }
- case 523: //House-sale dialog
- {
- if(!response) return 1;
- new uid = GetPVarInt(playerid, "HouseKey");
- if(!strmatch(HouseInfo[uid][hOwner], PlayerName(playerid))) return error(playerid, "You only rent this property.");
- GivePlayerMoneyEx(playerid, floatround(HouseInfo[uid][hBuyValue]*0.8));
- SetPVarInt(playerid, "HouseKey", 0);
- HouseInfo[uid][hOwned] = 0;
- format(HouseInfo[uid][hOwner], 25, "None");
- SCM(playerid, -1, "Property sold.");
- SaveHouse(uid);
- OnPlayerDataSave(playerid);
- RemoveHouseObject(uid);
- }
- case 524: // RLS station list
- {
- if(!response) return 1;
- SetPVarInt(playerid, "RLSStation", listitem);
- ShowPlayerDialog(playerid, 525, DIALOG_STYLE_LIST, RLSInfo[listitem][Name], "Edit Name\nEdit URL\nPlay Song", "Select", "Back");
- }
- case 525: // RLS station options
- {
- if(!response) {
- DeletePVar(playerid, "RLSStation");
- PopulateRLS(playerid);
- return 1;
- }
- switch(listitem)
- {
- case 0: //Edit name
- {
- ShowPlayerDialog(playerid, 526, DIALOG_STYLE_INPUT, "Song Name", "What should this songs name be displayed as?", "Enter", "Cancel");
- }
- case 1: //Edit URL
- {
- ShowPlayerDialog(playerid, 527, DIALOG_STYLE_INPUT, "Song URL", "What is the URL that plays this song? (direct-link)", "Enter", "Cancel");
- }
- case 2: //Play Song
- {
- if(strlen(RLSInfo[GetPVarInt(playerid, "RLSStation")][URL]) < 3) {
- DeletePVar(playerid, "RLSStation");
- PopulateRLS(playerid);
- return 1;
- }
- CallRemoteFunction("PlayRLSSong", "s", RLSInfo[GetPVarInt(playerid, "RLSStation")][URL]);
- format(string, sizeof(string), "You've changed the Radio Los Santos stream to %s.", RLSInfo[GetPVarInt(playerid, "RLSStation")][Name]);
- scm(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "RLSStation");
- }
- }
- }
- case 526: //RLS Station Name
- {
- if(!response) {
- DeletePVar(playerid, "RLSStation");
- return 1;
- }
- if(strlen(inputtext) < 1 || strlen(inputtext) > 72) {
- error(playerid, "The songs name can only be between 1 and 72 characters long.");
- return ShowPlayerDialog(playerid, 526, DIALOG_STYLE_INPUT, "Song Name", "What should this song's name be displayed as?", "Enter", "Cancel");
- }
- format(RLSInfo[GetPVarInt(playerid, "RLSStation")][Name], 72, "%s", inputtext);
- format(string, sizeof(string), "You've changed the Name of stream %d to %s.", GetPVarInt(playerid, "RLSStation"), inputtext);
- scm(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "RLSStation");
- }
- case 527: //RLS Station URL
- {
- if(!response) {
- DeletePVar(playerid, "RLSStation");
- return 1;
- }
- if(strlen(inputtext) < 1 || strlen(inputtext) > 128) {
- error(playerid, "The songs URL can only be between 1 and 128 characters long.");
- return ShowPlayerDialog(playerid, 527, DIALOG_STYLE_INPUT, "Song URL", "What is the URL that plays this song? (direct-link)", "Enter", "Cancel");
- }
- format(RLSInfo[GetPVarInt(playerid, "RLSStation")][URL], 129, "%s", inputtext);
- format(string, sizeof(string), "You've changed the URL for %s to %s.", RLSInfo[GetPVarInt(playerid, "RLSStation")][Name], inputtext);
- scm(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "RLSStation");
- }
- case 528:
- {
- if(!response) {
- DeletePVar(playerid, "CurEditMdl");
- return 1;
- }
- new count = 0;
- for(new h = 0; h < MAX_MAP_OBJ; h++)
- {
- if(MapInfo[h][mObject] != 0)
- {
- if(MapInfo[h][mID] == GetPVarInt(playerid, "CurEditMdl"))
- {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectMapObj", "ii", playerid, h);
- break;
- }
- count++;
- }
- }
- }
- }
- case 529:
- {
- if(!response) {
- DeletePVar(playerid, "CurEditMdl");
- return 1;
- }
- new keyex = FurnRight(playerid, 1), count = 0;
- for(new h = 0; h < MAX_HOUSE_OBJ; h++)
- {
- if(HouseInfo[keyex][hObject][h] != 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, HouseInfo[keyex][hoX][h], HouseInfo[keyex][hoY][h], HouseInfo[keyex][hoZ][h]))
- {
- if(HouseInfo[keyex][hoID][h] == GetPVarInt(playerid, "CurEditMdl"))
- {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectHouseObj", "iii", playerid, h, keyex);
- break;
- }
- count++;
- }
- }
- }
- }
- }
- case 530:
- {
- if(!response) {
- DeletePVar(playerid, "CurEditMdl");
- return 1;
- }
- new keyex = FurnRight(playerid, 2), count = 0;
- for(new h = 0; h < MAX_HOUSE_OBJ; h++)
- {
- if(BizInfo[keyex][bObject][h] != 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, BizInfo[keyex][boX][h], BizInfo[keyex][boY][h], BizInfo[keyex][boZ][h]))
- {
- if(BizInfo[keyex][boID][h] == GetPVarInt(playerid, "CurEditMdl"))
- {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectBizzObj", "iii", playerid, h, keyex);
- break;
- }
- count++;
- }
- }
- }
- }
- }
- case 531: // select which version of the same model-obj w/ range
- {
- if(!response) {
- DeletePVar(playerid, "CurEditMdl");
- return 1;
- }
- new count = 0;
- for(new h = 0; h < MAX_MAP_OBJ; h++)
- {
- if(MapInfo[h][mObject] != 0)
- {
- if(MapInfo[h][mID] == GetPVarInt(playerid, "CurEditMdl"))
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.5, MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ]))
- {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectMapObj", "ii", playerid, h);
- break;
- }
- count++;
- }
- }
- }
- }
- }
- case 532:
- {
- if(!response) {
- DeletePVar(playerid, "CurEditMdl");
- return 1;
- }
- new count = 0;
- for(new h = 0; h < MAX_MAP_OBJ; h++)
- {
- if(MapInfo[h][mObject] != 0)
- {
- if(MapInfo[h][mID] == GetPVarInt(playerid, "CurEditMdl"))
- {
- if(strmatch(MapInfo[h][mOwner], PlayerName(playerid)))
- {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectMapObj", "ii", playerid, h);
- break;
- }
- count++;
- }
- }
- }
- }
- }
- case 533:
- {
- if(!response) return 1;
- new h = GetPVarInt(playerid, "FurnEditH");
- new Float:fX = MapInfo[h][mX], Float:fY = MapInfo[h][mY], Float:fZ = MapInfo[h][mZ];
- new Float:fRotX = MapInfo[h][mrX], Float:fRotY = MapInfo[h][mrY], Float:fRotZ = MapInfo[h][mrZ];
- SetPVarInt(playerid, "MapOEType", listitem);
- switch(listitem)
- {
- case 0: // X-pos
- {
- format(string, sizeof(string), "Editing X-position: %.3f", fX);
- ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing X-position", string, "Enter", "Cancel");
- }
- case 1: // Y-pos
- {
- format(string, sizeof(string), "Editing Y-position: %.3f", fY);
- ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing Y-position", string, "Enter", "Cancel");
- }
- case 2: // Z-pos
- {
- format(string, sizeof(string), "Editing Z-position: %.3f", fZ);
- ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing Z-position", string, "Enter", "Cancel");
- }
- case 3: // X-rotation
- {
- format(string, sizeof(string), "Editing X-rotation: %.3f", fRotX);
- ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing X-rotation", string, "Enter", "Cancel");
- }
- case 4: // Y-rotation
- {
- format(string, sizeof(string), "Editing Y-rotation: %.3f", fRotY);
- ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing Y-rotation", string, "Enter", "Cancel");
- }
- case 5: // z-rotation
- {
- format(string, sizeof(string), "Editing Z-rotation: %.3f", fRotZ);
- ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing Z-rotation", string, "Enter", "Cancel");
- }
- }
- }
- case 534:
- {
- if(!response) {
- DeletePVar(playerid, "MapOEType");
- return 1;
- }
- new h = GetPVarInt(playerid, "FurnEditH");
- new Float:fX = MapInfo[h][mX], Float:fY = MapInfo[h][mY], Float:fZ = MapInfo[h][mZ];
- new Float:fRotX = MapInfo[h][mrX], Float:fRotY = MapInfo[h][mrY], Float:fRotZ = MapInfo[h][mrZ];
- switch(GetPVarInt(playerid, "MapOEType"))
- {
- case 0: // X-pos
- {
- fX = floatstr(inputtext);
- }
- case 1: // Y-pos
- {
- fY = floatstr(inputtext);
- }
- case 2: // Z-pos
- {
- fZ = floatstr(inputtext);
- }
- case 3: // X-rotation
- {
- fRotX = floatstr(inputtext);
- }
- case 4: // Y-rotation
- {
- fRotY = floatstr(inputtext);
- }
- case 5: // z-rotation
- {
- fRotZ = floatstr(inputtext);
- }
- }
- MoveDynamicObject(MapInfo[h][mObject], fX, fY, fZ, 50.0, fRotX, fRotY, fRotZ);
- MapInfo[h][mX]=fX;
- MapInfo[h][mY]=fY;
- MapInfo[h][mZ]=fZ;
- MapInfo[h][mrX]=fRotX;
- MapInfo[h][mrY]=fRotY;
- MapInfo[h][mrZ]=fRotZ;
- SaveMapObj(h);
- }
- case 535:
- {
- if(!response) return 1;
- new fid = strval(inputtext);
- if(fid < 5 || fid == 8 || fid > MAX_FACTIONS) return error(playerid, "Invalid faction-id.");
- if(FactionInfo[fid][fUsed] == 0) return error(playerid, "Faction slot isn't in use!");
- SetPVarInt(playerid, "FacTD", fid);
- format(string, sizeof(string), "Are you sure you want to delete\n%s?\n----\nWARNING: This is irreversible.", FactionInfo[fid][fName]);
- ShowPlayerDialog(playerid, 536, DIALOG_STYLE_MSGBOX, "Delete a faction", string, "Yes", "No");
- }
- case 536:
- {
- if(!response) {
- DeletePVar(playerid, "FacTD");
- return 1;
- }
- if(GetPVarInt(playerid, "Admin") < 8) {
- DeletePVar(playerid, "FacTD");
- return 1;
- }
- new fid = GetPVarInt(playerid, "FacTD");
- printf("Faction %s(%d) removed by: %s.", FactionInfo[fid][fName], fid, PlayerName(playerid));
- DeleteFaction(fid);
- format(string, sizeof(string), "Faction %d removed!", fid);
- scm(playerid, COLOR_ORANGE, string);
- DeletePVar(playerid, "FacTD");
- }
- case 537:
- {
- if(!response) {
- DeletePVar(playerid, "CurEditMdl");
- return 1;
- }
- new keyex = FurnRight(playerid, 1), count = 0;
- for(new h = 0; h < MAX_HOUSE_OBJ; h++)
- {
- if(HouseInfo[keyex][hObject][h] != 0)
- {
- if(HouseInfo[keyex][hoID][h] == GetPVarInt(playerid, "CurEditMdl"))
- {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectHouseObj", "iii", playerid, h, keyex);
- break;
- }
- count++;
- }
- }
- }
- }
- case 538:
- {
- if(!response) {
- DeletePVar(playerid, "CurEditMdl");
- return 1;
- }
- new keyex = FurnRight(playerid, 2), count = 0;
- for(new h = 0; h < MAX_HOUSE_OBJ; h++)
- {
- if(BizInfo[keyex][bObject][h] != 0)
- {
- if(BizInfo[keyex][boID][h] == GetPVarInt(playerid, "CurEditMdl"))
- {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectBizzObj", "iii", playerid, h, keyex);
- break;
- }
- count++;
- }
- }
- }
- }
- case 539:
- {
- if(!response) return 1;
- new keyex = FurnRight(playerid, 1);
- if(keyex != GetPVarInt(playerid, "HouseEnter")) return 1;
- new h = GetPVarInt(playerid, "FurnEditH");
- new Float:fX = HouseInfo[keyex][hoX][h], Float:fY = HouseInfo[keyex][hoY][h], Float:fZ = HouseInfo[keyex][hoZ][h];
- new Float:fRotX = HouseInfo[keyex][horX][h], Float:fRotY = HouseInfo[keyex][horY][h], Float:fRotZ = HouseInfo[keyex][horZ][h];
- SetPVarInt(playerid, "MapOEType", listitem);
- switch(listitem)
- {
- case 0: // X-pos
- {
- format(string, sizeof(string), "Editing X-position: %.4f", fX);
- ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing X-position", string, "Enter", "Cancel");
- }
- case 1: // Y-pos
- {
- format(string, sizeof(string), "Editing Y-position: %.4f", fY);
- ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing Y-position", string, "Enter", "Cancel");
- }
- case 2: // Z-pos
- {
- format(string, sizeof(string), "Editing Z-position: %.4f", fZ);
- ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing Z-position", string, "Enter", "Cancel");
- }
- case 3: // X-rotation
- {
- format(string, sizeof(string), "Editing X-rotation: %.4f", fRotX);
- ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing X-rotation", string, "Enter", "Cancel");
- }
- case 4: // Y-rotation
- {
- format(string, sizeof(string), "Editing Y-rotation: %.4f", fRotY);
- ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing Y-rotation", string, "Enter", "Cancel");
- }
- case 5: // z-rotation
- {
- format(string, sizeof(string), "Editing Z-rotation: %.4f", fRotZ);
- ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing Z-rotation", string, "Enter", "Cancel");
- }
- }
- }
- case 540:
- {
- if(!response) {
- DeletePVar(playerid, "MapOEType");
- return 1;
- }
- new keyex = FurnRight(playerid, 1);
- if(keyex != GetPVarInt(playerid, "HouseEnter")) return 1;
- new h = GetPVarInt(playerid, "FurnEditH");
- new Float:fX = HouseInfo[keyex][hoX][h], Float:fY = HouseInfo[keyex][hoY][h], Float:fZ = HouseInfo[keyex][hoZ][h];
- new Float:fRotX = HouseInfo[keyex][horX][h], Float:fRotY = HouseInfo[keyex][horY][h], Float:fRotZ = HouseInfo[keyex][horZ][h];
- switch(GetPVarInt(playerid, "MapOEType"))
- {
- case 0: // X-pos
- {
- fX = floatstr(inputtext);
- }
- case 1: // Y-pos
- {
- fY = floatstr(inputtext);
- }
- case 2: // Z-pos
- {
- fZ = floatstr(inputtext);
- }
- case 3: // X-rotation
- {
- fRotX = floatstr(inputtext);
- }
- case 4: // Y-rotation
- {
- fRotY = floatstr(inputtext);
- }
- case 5: // z-rotation
- {
- fRotZ = floatstr(inputtext);
- }
- }
- MoveDynamicObject(HouseInfo[keyex][hObject][h], fX, fY, fZ, 50.0, fRotX, fRotY, fRotZ);
- HouseInfo[keyex][hoX][h]=fX;
- HouseInfo[keyex][hoY][h]=fY;
- HouseInfo[keyex][hoZ][h]=fZ;
- HouseInfo[keyex][horX][h]=fRotX;
- HouseInfo[keyex][horY][h]=fRotY;
- HouseInfo[keyex][horZ][h]=fRotZ;
- SaveFurnObj(keyex, h);
- }
- case 541:
- {
- if(!response) return 1;
- new keyex = FurnRight(playerid, 2);
- if(keyex != GetPVarInt(playerid, "BizzEnter")) return 1;
- new h = GetPVarInt(playerid, "FurnEditH");
- new Float:fX = BizInfo[keyex][boX][h], Float:fY = BizInfo[keyex][boY][h], Float:fZ = BizInfo[keyex][boZ][h];
- new Float:fRotX = BizInfo[keyex][borX][h], Float:fRotY = BizInfo[keyex][borY][h], Float:fRotZ = BizInfo[keyex][borZ][h];
- SetPVarInt(playerid, "MapOEType", listitem);
- switch(listitem)
- {
- case 0: // X-pos
- {
- format(string, sizeof(string), "Editing X-position: %.4f", fX);
- ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing X-position", string, "Enter", "Cancel");
- }
- case 1: // Y-pos
- {
- format(string, sizeof(string), "Editing Y-position: %.4f", fY);
- ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing Y-position", string, "Enter", "Cancel");
- }
- case 2: // Z-pos
- {
- format(string, sizeof(string), "Editing Z-position: %.4f", fZ);
- ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing Z-position", string, "Enter", "Cancel");
- }
- case 3: // X-rotation
- {
- format(string, sizeof(string), "Editing X-rotation: %.4f", fRotX);
- ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing X-rotation", string, "Enter", "Cancel");
- }
- case 4: // Y-rotation
- {
- format(string, sizeof(string), "Editing Y-rotation: %.4f", fRotY);
- ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing Y-rotation", string, "Enter", "Cancel");
- }
- case 5: // z-rotation
- {
- format(string, sizeof(string), "Editing Z-rotation: %.4f", fRotZ);
- ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing Z-rotation", string, "Enter", "Cancel");
- }
- }
- }
- case 542:
- {
- if(!response) {
- DeletePVar(playerid, "MapOEType");
- return 1;
- }
- new keyex = FurnRight(playerid, 2);
- if(keyex != GetPVarInt(playerid, "BizzEnter")) return 1;
- new h = GetPVarInt(playerid, "FurnEditH");
- new Float:fX = BizInfo[keyex][boX][h], Float:fY = BizInfo[keyex][boY][h], Float:fZ = BizInfo[keyex][boZ][h];
- new Float:fRotX = BizInfo[keyex][borX][h], Float:fRotY = BizInfo[keyex][borY][h], Float:fRotZ = BizInfo[keyex][borZ][h];
- switch(GetPVarInt(playerid, "MapOEType"))
- {
- case 0: // X-pos
- {
- fX = floatstr(inputtext);
- }
- case 1: // Y-pos
- {
- fY = floatstr(inputtext);
- }
- case 2: // Z-pos
- {
- fZ = floatstr(inputtext);
- }
- case 3: // X-rotation
- {
- fRotX = floatstr(inputtext);
- }
- case 4: // Y-rotation
- {
- fRotY = floatstr(inputtext);
- }
- case 5: // z-rotation
- {
- fRotZ = floatstr(inputtext);
- }
- }
- MoveDynamicObject(BizInfo[keyex][bObject][h], fX, fY, fZ, 50.0, fRotX, fRotY, fRotZ);
- BizInfo[keyex][boX][h]=fX;
- BizInfo[keyex][boY][h]=fY;
- BizInfo[keyex][boZ][h]=fZ;
- BizInfo[keyex][borX][h]=fRotX;
- BizInfo[keyex][borY][h]=fRotY;
- BizInfo[keyex][borZ][h]=fRotZ;
- SaveBizzObj(keyex, h);
- }
- case 543: // Dealership menu
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0:
- {
- new query[75];
- mysql_format(handlesql, query, sizeof(query), "SELECT NULL FROM `vehicles` WHERE `Owner` = '%e';", PlayerInfo[playerid][pUsername]);
- mysql_tquery(handlesql, query, "OnPlayerEntersDealership", "i", playerid);
- }
- case 1:
- {
- if(CountSpawnedCars(playerid) > 1) return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade vehicles while you have more than 1 spawned.");
- new keyex = IsPlayerVehicleSpawned(playerid);
- if(keyex == -1) return SendClientMessage(playerid, COLOR_GREY, "You do not have a vehicle spawned.");
- if (OwnableVehicle(keyex))
- {
- if(IsNotAEngineCar(keyex)) return true;
- format(string, sizeof(string), "Vehicle Upgrades (%s)", VehicleName[GetVehicleModel(keyex)-400]);
- ShowPlayerDialog(playerid, 544, DIALOG_STYLE_LIST, string, "Insurance\nLock\nAlarm", "Select", "Close");
- }
- }
- }
- }
- case 544: // Vehicle Upgrades
- {
- if(!response) return true;
- new strie[1024];
- switch(listitem)
- {
- case 0: // Insurance
- {
- strcat(strie, "{3366FF}Enter the insurance level you wish to purchase:");
- strcat(strie, "\n\n{3366FF}Insurance will cost {FFFFFF}($150) {3366FF}each payday, failure to pay will result in penalty charges.");
- strcat(strie, "\n\n{3366FF}Level {FFFFFF}1: {3366FF}Insurance will cover the damages when a vehicle is destroyed, ($1500 to purchase).");
- strcat(strie, "\n{3366FF}Level {FFFFFF}2: {3366FF}Insurance will cover any scratches etc on the vehicle when spawned +lvl 1, ($2500 to purchase).");
- strcat(strie, "\n{3366FF}Level {FFFFFF}3: {3366FF}Insurance will spawn your vehicle at full health after despawning with low hp +lvl 1-2, ($5000 to purchase).");
- strcat(strie, "\n\n{FFFFFF}Insert '0' to remove this perk.");
- ShowPlayerDialog(playerid, 545, DIALOG_STYLE_INPUT, "Vehicle Insurance", strie, "Purchase","Close");
- }
- case 1: // Lock
- {
- strcat(strie, "{3366FF}Enter the lock level you wish to purchase:");
- strcat(strie, "\n\n{3366FF}Level {FFFFFF}1: {3366FF}Extended time when attempting to breakin the vehicle, ($875 to purchase).");
- strcat(strie, "\n{3366FF}Level {FFFFFF}2: {3366FF}Extra extended time when attempt to break into vehicle + breakin success more difficult, ($1500 to purchase).");
- strcat(strie, "\n{3366FF}Level {FFFFFF}3: {3366FF}Superior extended time when attempt to break into vehicle {FFFFFF}+lvl 2{3366FF}, ($2000 to purchase).");
- strcat(strie, "\n\n{FFFFFF}Insert '0' to remove this perk.");
- ShowPlayerDialog(playerid, 546, DIALOG_STYLE_INPUT, "Vehicle Lock", strie, "Purchase","Close");
- }
- case 2: // Alarm
- {
- strcat(strie, "{3366FF}Enter the alarm level you wish to purchase:");
- strcat(strie, "\n\n{3366FF}Level {FFFFFF}1: {3366FF}When someone successfully breaks into your vehicle the alarm will ring, ($950 to purchase).");
- strcat(strie, "\n{3366FF}Level {FFFFFF}2: {3366FF}Any attempts to break into your vehicle and the alarm will ring {FFFFFF}+lvl 1{3366FF}, ($1500 to purchase).");
- strcat(strie, "\n{3366FF}Level {FFFFFF}3: {3366FF}Any theft or control attempts to your vehicle and the alarm will ring {FFFFFF}+lvl 1-2{3366FF}, ($3000 to purchase).");
- strcat(strie, "\n\n{FFFFFF}Insert '0' to remove this perk.");
- ShowPlayerDialog(playerid, 547, DIALOG_STYLE_INPUT, "Vehicle Alarm", strie, "Purchase","Close");
- }
- }
- }
- case 545: // Insurance Purchase
- {
- if(!response) return true;
- if(!strlen(inputtext)) return true;
- if(strlen(inputtext) >= 7) return true;
- new amount = strval(inputtext), priceex;
- if(amount < 0) return true;
- if(amount >= 4) return true;
- switch(amount)
- {
- case 1: priceex=1500;
- case 2: priceex=2500;
- case 3: priceex=5000;
- }
- if(CountSpawnedCars(playerid) > 1) return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade vehicles while you have more than 1 spawned.");
- new keyex = IsPlayerVehicleSpawned(playerid);
- if(keyex == -1) return SendClientMessage(playerid, COLOR_GREY, "You do not have a vehicle spawned.");
- if(VehicleInfo[keyex][vInsurance] == amount) return SendClientMessage(playerid, COLOR_WHITE, "You already have this insurance level!");
- if(amount == 0)
- {
- if(GetPVarInt(playerid, "UpgDelay") > 0) {
- format(string, sizeof(string), "You must wait %d minutes before removing a upgrade!", GetPVarInt(playerid, "UpgDelay"));
- scm(playerid, COLOR_LIGHTRED, string);
- } else {
- scm(playerid, -1, "Upgrade removed!");
- VehicleInfo[keyex][vInsurance]=0;
- }
- return 1;
- }
- if(VehicleInfo[keyex][vInsurance] >= 3) return SendClientMessage(playerid, COLOR_WHITE, "You have exceeded the insurance amount!");
- if (OwnableVehicle(keyex))
- {
- if(IsNotAEngineCar(keyex)) return true;
- if(GetPlayerMoneyEx(playerid) >= priceex)
- {
- GivePlayerMoneyEx(playerid, -priceex);
- format(string, sizeof(string),"~r~-$%d", priceex);
- GameTextForPlayer(playerid, string, 5000, 1);
- format(string, sizeof(string),"{3366FF}(%s UPGRADE): {FFFFFF}Congratulations on your level %d insurance for $%d!", VehicleName[GetVehicleModel(keyex)-400], amount, priceex);
- SCM(playerid, -1, string);
- VehicleInfo[keyex][vInsurance]=amount;
- SetPVarInt(playerid, "UpgDelay", 60);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- }
- }
- case 546: // Lock Purchase
- {
- if(!response) return true;
- if(!strlen(inputtext)) return true;
- if(strlen(inputtext) >= 7) return true;
- new amount = strval(inputtext), priceex;
- if(amount < 0) return true;
- if(amount >= 4) return true;
- switch(amount)
- {
- case 1: priceex=875;
- case 2: priceex=1500;
- case 3: priceex=2000;
- }
- if(CountSpawnedCars(playerid) > 1) return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade vehicles while you have more than 1 spawned.");
- new keyex = IsPlayerVehicleSpawned(playerid);
- if(keyex == -1) return SendClientMessage(playerid, COLOR_GREY, "You do not have a vehicle spawned.");
- if(VehicleInfo[keyex][vLockLvl] == amount) return SendClientMessage(playerid, COLOR_WHITE, "You already have this lock level!");
- if(amount == 0)
- {
- if(GetPVarInt(playerid, "UpgDelay") > 0) {
- format(string, sizeof(string), "You must wait %d minutes before removing a upgrade!", GetPVarInt(playerid, "UpgDelay"));
- scm(playerid, COLOR_LIGHTRED, string);
- } else {
- scm(playerid, -1, "Upgrade removed!");
- VehicleInfo[keyex][vLockLvl]=0;
- } return 1;
- }
- if(VehicleInfo[keyex][vLockLvl] >= 3) return SendClientMessage(playerid, COLOR_WHITE, "You have exceeded the lock level amount!");
- if (OwnableVehicle(keyex))
- {
- if(IsNotAEngineCar(keyex)) return true;
- if(GetPlayerMoneyEx(playerid) >= priceex)
- {
- GivePlayerMoneyEx(playerid, -priceex);
- format(string, sizeof(string),"~r~-$%d", priceex);
- GameTextForPlayer(playerid, string, 5000, 1);
- format(string, sizeof(string),"{3366FF}(%s UPGRADE): {FFFFFF}Congratulations on your level %d lock for $%d!", VehicleName[GetVehicleModel(keyex)-400], amount, priceex);
- SCM(playerid, -1, string);
- VehicleInfo[keyex][vLockLvl]=amount;
- SetPVarInt(playerid, "UpgDelay", 60);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- }
- }
- case 547: // Alarm Purchase
- {
- if(!response) return true;
- if(!strlen(inputtext)) return true;
- if(strlen(inputtext) >= 7) return true;
- new amount = strval(inputtext), priceex;
- if(amount < 0) return true;
- if(amount >= 4) return true;
- switch(amount)
- {
- case 1: priceex=950;
- case 2: priceex=1500;
- case 3: priceex=3000;
- }
- if(CountSpawnedCars(playerid) > 1) return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade vehicles while you have more than 1 spawned.");
- new keyex = IsPlayerVehicleSpawned(playerid);
- if(keyex == -1) return SendClientMessage(playerid, COLOR_GREY, "You do not have a vehicle spawned.");
- if(VehicleInfo[keyex][vAlarmLvl] == amount) return SendClientMessage(playerid, COLOR_WHITE, "You already have this alarm level!");
- if(amount == 0)
- {
- if(GetPVarInt(playerid, "UpgDelay") > 0) {
- format(string, sizeof(string), "You must wait %d minutes before removing a upgrade!", GetPVarInt(playerid, "UpgDelay"));
- scm(playerid, COLOR_LIGHTRED, string);
- } else {
- scm(playerid, -1, "Upgrade removed!");
- VehicleInfo[keyex][vAlarmLvl]=amount;
- } return 1;
- }
- if(VehicleInfo[keyex][vAlarmLvl] >= 3) return SendClientMessage(playerid, COLOR_WHITE, "You have exceeded the alarm amount!");
- if (OwnableVehicle(keyex))
- {
- if(IsNotAEngineCar(keyex)) return true;
- if(GetPlayerMoneyEx(playerid) >= priceex)
- {
- GivePlayerMoneyEx(playerid, -priceex);
- format(string, sizeof(string),"~r~-$%d", priceex);
- GameTextForPlayer(playerid, string, 5000, 1);
- format(string, sizeof(string),"{3366FF}(%s UPGRADE): {FFFFFF}Congratulations on your level %d alarm for $%d!", VehicleName[GetVehicleModel(keyex)-400], amount, priceex);
- SCM(playerid, -1, string);
- VehicleInfo[keyex][vAlarmLvl]=amount;
- SetPVarInt(playerid, "UpgDelay", 60);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- }
- }
- case 548: // Drop keys
- {
- if(!response) return 1;
- if(CarKeys[playerid][listitem] != 0) {
- new query[128];
- mysql_format(handlesql, query, 128, "SELECT `Owner`,`Model` FROM `vehicles` WHERE `ID`=%d", CarKeys[playerid][listitem]);
- mysql_tquery(handlesql, query, "OnViewKey", "ii", playerid, listitem);
- } else {
- scm(playerid, COLOR_RED, "You don't have a key in that slot.");
- ShowCarKeys(playerid);
- }
- }
- case 549: // OnViewKey dialog
- {
- if(!response) {
- DeletePVar(playerid, "ViewKeyID");
- return ShowCarKeys(playerid);
- }
- TakeCarKeyEx(playerid, GetPVarInt(playerid, "ViewKeyID"));
- DeletePVar(playerid, "ViewKeyID");
- }
- case 550: // Lend car-key to
- {
- if(!response) {
- DeletePVar(playerid, "LendKeysTo");
- return 1;
- }
- if(!IsPlayerConnected(GetPVarInt(playerid, "LendKeysTo"))) {
- DeletePVar(playerid, "LendKeysTo");
- scm(playerid, COLOR_ORANGE, "The player you're trying to lend your car-key to isn't online.");
- return 1;
- }
- new query[112];
- mysql_format(handlesql, query, sizeof(query), "SELECT `ID`, `Model` FROM `vehicles` WHERE `Owner` = '%e' LIMIT %i, %i;", PlayerInfo[playerid][pUsername], listitem, listitem + 1);
- mysql_tquery(handlesql, query, "LendCarKeys", "ii", playerid, GetPVarInt(playerid, "LendKeysTo"));
- }
- case 551: // Take car-key from
- {
- if(!response) {
- DeletePVar(playerid, "TakeKeysFrom");
- return 1;
- }
- if(!IsPlayerConnected(GetPVarInt(playerid, "TakeKeysFrom"))) {
- DeletePVar(playerid, "TakeKeysFrom");
- scm(playerid, COLOR_ORANGE, "The player you're trying to take your car-key from isn't online.");
- return 1;
- }
- new query[112];
- mysql_format(handlesql, query, sizeof(query), "SELECT `ID`, `Model` FROM `vehicles` WHERE `Owner` = '%e' LIMIT %i, %i;", PlayerInfo[playerid][pUsername], listitem, listitem + 1);
- mysql_tquery(handlesql, query, "TakeCarKeys", "ii", playerid, GetPVarInt(playerid, "TakeKeysFrom"));
- }
- case 552: // Payphone options dialog
- {
- if(!response) {
- cancelPayphone(playerid);
- return 1;
- }
- switch(listitem)
- {
- case 0: //Call number
- {
- ShowPlayerDialog(playerid, 39, DIALOG_STYLE_INPUT, "Calling", "Enter the number you would like to call.", "Call", "Go Back");
- }
- case 1: //Services
- {
- ShowPlayerDialog(playerid, 553, DIALOG_STYLE_LIST, "Services", "Emergecy\nTaxi\nMechanic", "Okay", "Exit");
- }
- }
- }
- case 553: // Payphone services dialog
- {
- if(!response) {
- ShowPlayerDialog(playerid, 552, DIALOG_STYLE_LIST, phoneInfo[GetPVarInt(playerid,"usingPayphone")][phoneName], "Call number\nServices", "Okay", "Exit");
- return 1;
- }
- switch(listitem)
- {
- case 0: //Emergecy
- {
- CallNumber(playerid, "911");
- }
- case 1: //Taxi
- {
- CallNumber(playerid, "411");
- }
- case 2: //Mechanic
- {
- CallNumber(playerid, "311");
- }
- }
- }
- case 554: // Crafting menu
- {
- if(!response) return 1;
- new strung[172];
- format(strung, 172, "Name: {33FF66}%s.\n{FFFFFF}Level: {33FF66}%d/%d.\n{FFFFFF}Cost: {33FF66}%d/%d materials.", CraftWeps[listitem][wName], PlayerInfo[playerid][pCraft], CraftWeps[listitem][wLvl], PlayerInfo[playerid][pMaterials], CraftWeps[listitem][wCost]);
- ShowPlayerDialog(playerid, 555, DIALOG_STYLE_MSGBOX, "Are you sure you want to craft this?", strung, "Craft", "Close");
- SetPVarInt(playerid, "CraftID", listitem);
- }
- case 555: // Crafting confirm
- {
- if(!response) {
- DeletePVar(playerid, "CraftID");
- return 1;
- }
- if(PlayerInfo[playerid][pMaterials] < CraftWeps[GetPVarInt(playerid, "CraftID")][wCost]) return SCM(playerid, COLOR_ORANGE, "You don't have enough materials for this!");
- ProgressBar(playerid, "Crafting item...", 10, 3);
- AddPlayerTag(playerid, "(crafting item)");
- scm(playerid, COLOR_ORANGE, "Don't forget to roleplay your crafting.");
- }
- case 556: //Vehicle glovebox
- {
- if(!IsPlayerInAnyVehicle(playerid)) return 1;
- new kez = GetPlayerVehicleID(playerid);
- if(VehicleInfo[kez][vType] != VEHICLE_PERSONAL) return 1;
- if(IsHelmetCar(kez)) return 1;
- if(kez == -1) return 1;
- new stri2[100];
- if(response)
- {
- if(CheckInv(playerid) == 0) return error(playerid, "Your inventory is full.");
- if(DisabledWeapon(GetPVarInt(playerid, "ConnectTime"), VehicleInfo[kez][vGBID][listitem])) return error(playerid, "You need 8 hours played to use take this.");
- if(VehicleInfo[kez][vGBID][listitem] == 0) return error(playerid, "Slot is empty.");
- if(VehicleInfo[kez][vGBID][listitem] <= 800 || VehicleInfo[kez][vGBID][listitem] >= 1002) {
- GiveInvItem(playerid, VehicleInfo[kez][vGBID][listitem], VehicleInfo[kez][vGBQ][listitem], VehicleInfo[kez][vGBE][listitem], VehicleInfo[kez][vGBS][listitem]); }
- format(stri2, sizeof(stri2), "You took a (%s) from your vehicles glovebox.", PrintIName(VehicleInfo[kez][vGBID][listitem]));
- scm(playerid, -1, stri2);
- format(stri2, sizeof(stri2), "takes a %s from the vehicles glovebox.", PrintIName(VehicleInfo[kez][vGBID][listitem]));
- ForceAME(playerid, stri2);
- VehicleInfo[kez][vGBID][listitem] = 0;
- VehicleInfo[kez][vGBQ][listitem] = 0;
- VehicleInfo[kez][vGBE][listitem] = 0;
- VehicleInfo[kez][vGBS][listitem] = 0;
- mysql_format(handlesql, string, sizeof(string), "UPDATE `vehicles` SET `GBID%d` = %i, `GBQ%d` = %i, `GBE%d` = %i WHERE `ID` = %i;",
- listitem, VehicleInfo[kez][vGBID][listitem], listitem, VehicleInfo[kez][vGBQ][listitem], listitem, VehicleInfo[kez][vGBE][listitem], listitem, VehicleInfo[kez][vID]);
- mysql_tquery(handlesql, string);
- }
- }
- case 557: // Delete vehicle
- {
- if(response) {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You have to be in your vehicle in order to delete it.");
- new vehicleID = GetPlayerVehicleID(playerid);
- if(!PlayerOwnsVehicle(playerid, vehicleID)) return SendClientMessage(playerid, COLOR_GREY, "You don't own this vehicle.");
- if(VehicleInfo[vehicleID][vDonate] == 0) return SendClientMessage(playerid, COLOR_GREY, "You can only delete donor vehicles, use (/v sell) instead.");
- SendClientMessage(playerid, COLOR_WHITE, "Vehicle deleted.");
- mysql_format(handlesql, string, sizeof(string), "DELETE FROM `vehicles` WHERE `ID` = %i;", VehicleInfo[vehicleID][vID]);
- mysql_tquery(handlesql, string);
- mysql_format(handlesql, string, sizeof(string), "DELETE FROM `vehiclefurn` WHERE VID=%i;", VehicleInfo[vehicleID][vID]);
- mysql_tquery(handlesql, string);
- DespawnVehicle(vehicleID);
- }
- }
- case 558:
- {
- if(!response) return 1;
- new houseid = GetPVarInt(playerid, "HouseKey");
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You have to be on foot in order to do this.");
- if(!IsPlayerInRangeOfPoint(playerid, HOUSE_GARAGE_DISTANCE, HouseInfo[houseid][hXo], HouseInfo[houseid][hYo], HouseInfo[houseid][hZo])) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from your house entrance.");
- if(GetPlayerMoneyEx(playerid) < GARAGE_ENTRANCE_COST) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
- // CallRemoteFunction("GivePlayerMoneyEx","ii", playerid, -GARAGE_ENTRANCE_COST);
- GivePlayerMoneyEx(playerid, -GARAGE_ENTRANCE_COST);
- new Float:x, Float:y, Float:z, Float:a;
- new string3[32];
- format(string3, sizeof(string3),"~r~-%s", FormatMoney(GARAGE_ENTRANCE_COST));
- GameTextForPlayer(playerid, string3, 5000, 1);
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- if(HouseInfo[houseid][gIcon] != 0) DestroyDynamicCP(HouseInfo[houseid][gIcon]);
- HouseInfo[houseid][gIcon] = CreateDynamicCP(x, y, z, 3.0, 0, -1, -1, 3.0);
- HouseInfo[houseid][hgXo] = x;
- HouseInfo[houseid][hgYo] = y;
- HouseInfo[houseid][hgZo] = z;
- HouseInfo[houseid][hgAo] = a;
- HouseInfo[houseid][gInterior] = 1;
- if(HouseInfo[houseid][Garage] == 0)
- {
- if(HouseInfo[houseid][hClass] == 2)
- {
- HouseInfo[houseid][hgXi] = 286.7440;
- HouseInfo[houseid][hgYi] = 1080.8870;
- HouseInfo[houseid][hgZi] = 1185.0172;
- HouseInfo[houseid][hgAi] = 177.6385;
- }
- else
- {
- HouseInfo[houseid][hgXi] = 603.3348;
- HouseInfo[houseid][hgYi] = 1829.4977;
- HouseInfo[houseid][hgZi] = 1586.4860;
- HouseInfo[houseid][hgAi] = 88.7960;
- }
- }
- HouseInfo[houseid][Garage] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "Garage entrance has been set!");
- SaveHouse(houseid);
- }
- case 559:
- {
- if(!response) return 1;
- if(GetPlayerMoneyEx(playerid) < GARAGE_EXIT_COST) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
- // CallRemoteFunction("GivePlayerMoneyEx","ii", playerid, -GARAGE_EXIT_COST);
- GivePlayerMoneyEx(playerid, -GARAGE_EXIT_COST);
- new string3[32];
- format(string3, sizeof(string3),"~r~-%s", FormatMoney(GARAGE_EXIT_COST));
- GameTextForPlayer(playerid, string3, 5000, 1);
- new houseid = GetPVarInt(playerid, "HouseKey");
- new Float:x, Float:y, Float:z, Float:a;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- HouseInfo[houseid][gInterior] = GetPlayerInterior(playerid);
- HouseInfo[houseid][hgXi] = x;
- HouseInfo[houseid][hgYi] = y;
- HouseInfo[houseid][hgZi] = z;
- HouseInfo[houseid][hgAi] = a;
- if(IsValidDynamicPickup(HouseInfo[houseid][gExit])) DestroyDynamicPickup(HouseInfo[houseid][gExit]);
- HouseInfo[houseid][gExit] = CreateDynamicPickup(1318, 1, HouseInfo[houseid][hgXi], HouseInfo[houseid][hgYi], HouseInfo[houseid][hgZi], houseid, HouseInfo[houseid][hIntIn]);
- SendClientMessage(playerid, COLOR_WHITE, "Garage exit has been set!");
- SaveHouse(houseid);
- }
- case 560:
- {
- if(!response) return 1;
- if(GetPlayerMoneyEx(playerid) < GARAGE_BARESWITCH_COST) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
- new houseid = GetPVarInt(playerid, "HouseKey");
- if(GetPVarInt(playerid, "GarageEnter") != GetPVarInt(playerid, "HouseKey") && !IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[houseid][hgXo], HouseInfo[houseid][hgYo], HouseInfo[houseid][hgZo])) return SendClientMessage(playerid, COLOR_GREY, "You are not near your garage.");
- // CallRemoteFunction("GivePlayerMoneyEx","ii", playerid, -GARAGE_BARESWITCH_COST);
- GivePlayerMoneyEx(playerid, -GARAGE_BARESWITCH_COST);
- new string3[32];
- format(string3, sizeof(string3),"~r~-%s", FormatMoney(GARAGE_BARESWITCH_COST));
- GameTextForPlayer(playerid, string3, 5000, 1);
- if(GetPVarInt(playerid, "GarageEnter") != 0)
- {
- HouseInfo[houseid][gInterior] = 1;
- HouseInfo[houseid][hgXi] = 1402.7845;
- HouseInfo[houseid][hgYi] = 1.9748;
- HouseInfo[houseid][hgZi] = 1000.9152;
- HouseInfo[houseid][hgAi] = 182.1760;
- SaveHouse(houseid);
- SendClientMessage(playerid, COLOR_WHITE, "Garage has been reset!");
- SetPlayerPosEx(playerid, HouseInfo[houseid][hgXi], HouseInfo[houseid][hgYi], HouseInfo[houseid][hgZi]);
- SetPlayerInterior(playerid, HouseInfo[houseid][gInterior]);
- }
- else
- {
- HouseInfo[houseid][gInterior] = 1;
- HouseInfo[houseid][hgXi] = 1402.7845;
- HouseInfo[houseid][hgYi] = 1.9748;
- HouseInfo[houseid][hgZi] = 1000.9152;
- HouseInfo[houseid][hgAi] = 182.1760;
- SaveHouse(houseid);
- SendClientMessage(playerid, COLOR_WHITE, "Garage has been reset!");
- }
- }
- case 561:
- {
- if(!response) return 1;
- new houseid = GetPVarInt(playerid, "HouseKey");
- if(HouseInfo[houseid][Garage] == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't have a garage to remove.");
- HouseInfo[houseid][Garage] = 0;
- HouseInfo[houseid][gInterior] = 0;
- HouseInfo[houseid][hgXi] = 0;
- HouseInfo[houseid][hgYi] = 0;
- HouseInfo[houseid][hgZi] = 0;
- HouseInfo[houseid][hgAi] = 0;
- HouseInfo[houseid][hgXo] = 0;
- HouseInfo[houseid][hgYo] = 0;
- HouseInfo[houseid][hgZo] = 0;
- HouseInfo[houseid][hgAo] = 0;
- if(HouseInfo[houseid][gIcon] != 0) DestroyDynamicCP(HouseInfo[houseid][gIcon]);
- SaveHouse(houseid);
- SendClientMessage(playerid, COLOR_WHITE, "Garage has been removed!");
- }
- case 562:
- {
- if(response)
- {
- if(CheckInv(playerid) == 0)
- {
- SetPVarInt(playerid, "Dividing", 0);
- SetPVarInt(playerid, "DividingChose", 0);
- return SendClientMessage(playerid, COLOR_GREY, "Your inventory is full.");
- }
- if(!IsNumeric(inputtext))
- {
- SetPVarInt(playerid, "Dividing", 0);
- SetPVarInt(playerid, "DividingChose", 0);
- return SendClientMessage(playerid, COLOR_GREY, "Invalid value.");
- }
- if(strval(inputtext) <= 0 || strval(inputtext) >= PlayerInfo[playerid][pInvQ][GetPVarInt(playerid, "DividingChose")])
- {
- SetPVarInt(playerid, "Dividing", 0);
- SetPVarInt(playerid, "DividingChose", 0);
- return SendClientMessage(playerid, COLOR_GREY, "Invalid value.");
- }
- PlayerInfo[playerid][pInvQ][GetPVarInt(playerid, "DividingChose")] -= strval(inputtext);
- GiveInvItem(playerid, PlayerInfo[playerid][pInvItem][GetPVarInt(playerid, "DividingChose")], strval(inputtext), 0);
- SetPVarInt(playerid, "Dividing", 0);
- SetPVarInt(playerid, "DividingChose", 0);
- SendClientMessage(playerid, COLOR_WHITE, "Item divided!");
- }
- return 1;
- }
- case 563: //Edit color
- {
- if(!response) return 1;
- if(ToyInfo[playerid][listitem][tModel] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, listitem)) {
- SetPVarInt(playerid, "ColorToy", listitem);
- ShowPlayerDialog(playerid, 564, DIALOG_STYLE_LIST, "Choose a layer.", "First\nSecond", "Select", "Close");
- }
- else error(playerid, "You have no equipped item in this slot.");
- return 1;
- }
- case 564: //Edit color #2 (Layer)
- {
- if(!response) {
- DeletePVar(playerid, "ColorToy");
- return 1;
- }
- SetPVarInt(playerid, "ColorToyL", listitem);
- new diatxt[564];
- for (new i=0; i < sizeof(ARGBColors); i++) {
- format(diatxt, 564, "%s%s\n", diatxt, ARGBColors[i][Name]);
- }
- ShowPlayerDialog(playerid, 565, DIALOG_STYLE_LIST, "Choose a color.", diatxt, "Select", "Close");
- return 1;
- }
- case 565: //Edit color #3 (Final)
- {
- if(!response) {
- DeletePVar(playerid, "ColorToy");
- DeletePVar(playerid, "ColorToyL");
- return 1;
- }
- SetToyColor(playerid, GetPVarInt(playerid, "ColorToy"), GetPVarInt(playerid, "ColorToyL"), listitem);
- DeletePVar(playerid, "ColorToy");
- DeletePVar(playerid, "ColorToyL");
- }
- case DIALOG_PAYMENT: {
- if(!response) return 1;
- if(listitem == 0) {
- CallRemoteFunction("PurchaseItem","iiii", playerid, GetPVarInt(playerid, "PDBT"), GetPVarInt(playerid, "PDBTLI"), 1);
- } else CallRemoteFunction("PurchaseItem","iiii", playerid, GetPVarInt(playerid, "PDBT"), GetPVarInt(playerid, "PDBTLI"), 2);
- }
- case DIALOG_HOUSE_REMOVEALL: {
- if(!response) return 1;
- new allow = FurnRight(playerid, 1);
- if(allow > 0) {
- RemoveHouseObjects(allow);
- SendClientMessage(playerid, COLOR_WHITE, "All house furniture objects removed!");
- }
- }
- case DIALOG_BUSINESS_REMOVEALL: {
- if(!response) return 1;
- new allow = FurnRight(playerid, 2);
- if(allow > 0) {
- RemoveBizzObjects(allow);
- SendClientMessage(playerid, COLOR_WHITE, "All business furniture objects removed!");
- }
- }
- case FUEL_DIALOG_FILL_GASCAN: {
- if(!response) {
- DeletePVar(playerid, "GC_ItemSlot");
- return 1;
- }
- new slot = GetPVarInt(playerid, "GC_ItemSlot");
- if(PlayerInfo[playerid][pInvItem][slot] != 1008) {
- DeletePVar(playerid, "GC_ItemSlot");
- return 1;
- }
- SetPVarInt(playerid, "GC_FillType", listitem);
- format(string, sizeof(string), "Max: %dL", (100-PlayerInfo[playerid][pInvQ][slot]));
- ShowPlayerDialog(playerid, FUEL_DIALOG_FILL_GASAMT, DIALOG_STYLE_INPUT, "How many litres?", string, "Fill", "Cancel");
- }
- case FUEL_DIALOG_FILL_GASAMT: {
- if(!response) {
- DeletePVar(playerid, "GC_ItemSlot");
- DeletePVar(playerid, "GC_FillType");
- return 1;
- }
- new amt = strval(inputtext);
- if(amt < 1 || amt > 100) return SendClientMessage(playerid, COLOR_GREY, "You can only fill between 1 and 100 litres of fuel.");
- new slot = GetPVarInt(playerid, "GC_ItemSlot");
- if(PlayerInfo[playerid][pInvItem][slot] != 1008) {
- DeletePVar(playerid, "GC_ItemSlot");
- DeletePVar(playerid, "GC_FillType");
- return 1;
- }
- if(PlayerInfo[playerid][pInvEx][slot] != -1 && (PlayerInfo[playerid][pInvEx][slot] != GetPVarInt(playerid, "GC_FillType"))) {
- DeletePVar(playerid, "GC_ItemSlot");
- DeletePVar(playerid, "GC_FillType");
- return SendClientMessage(playerid, COLOR_GREY, "You can't mix different fuel types in a gas can.");
- }
- if(amt > (100-PlayerInfo[playerid][pInvQ][slot])) {
- SendClientMessage(playerid, COLOR_GREY, "This gas can can't hold that much fuel.");
- format(string, sizeof(string), "Max: %dL", (100-PlayerInfo[playerid][pInvQ][slot]));
- return ShowPlayerDialog(playerid, FUEL_DIALOG_FILL_GASAMT, DIALOG_STYLE_INPUT, "How many litres?", string, "Fill", "Cancel");
- }
- PlayerInfo[playerid][pInvEx][slot] = GetPVarInt(playerid, "GC_FillType");
- PlayerInfo[playerid][pInvQ][slot] = PlayerInfo[playerid][pInvQ][slot] + amt;
- DeletePVar(playerid, "GC_ItemSlot");
- OnPlayerDataSave(playerid);
- format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
- GiveNameSpace(sendername);
- format(string, sizeof(string), "*** %s fills the gas can with some %s {C2A2DA}fuel.", sendername, FuelName(GetPVarInt(playerid, "GC_FillType")));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE);
- DeletePVar(playerid, "GC_FillType");
- }
- case FISHING_DIALOG_SELL: {
- if(!response) {
- ResetFishingCP(playerid);
- return 1;
- }
- if(PlayerInfo[playerid][pInvItem][listitem] < FISHING_LOWEST_ID || PlayerInfo[playerid][pInvItem][listitem] > FISHING_HIGHEST_ID) {
- SellFish(playerid);
- return SendClientMessage(playerid, COLOR_WHITE, "You can only sell fish!");
- }
- new payout = GetFishPrice(PlayerInfo[playerid][pInvItem][listitem], PlayerInfo[playerid][pInvEx][listitem]); //probably unneccesary to store this in memory, may be better to call twice but the more fish we add the more we want to store this in memory.
- GivePlayerMoneyEx(playerid, payout);
- format(string, sizeof(string), "You've sold this %s for $%d.", PrintIName(PlayerInfo[playerid][pInvItem][listitem]), payout);
- RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][listitem], 0, listitem);
- SendClientMessage(playerid, COLOR_WHITE, string);
- SellFish(playerid);
- }
- case DIALOG_VEHICLE_RELEASE: {
- if(!response) return 1;
- new query[124];
- mysql_format(handlesql, query, sizeof(query), "SELECT ID,Model,Impounded FROM vehicles WHERE Owner='%s' AND Impounded > 0 LIMIT %i, %i", PlayerInfo[playerid][pUsername], listitem, listitem+1);
- mysql_tquery(handlesql, query, "OnVehicleReleased", "i", playerid);
- }
- case DIALOG_BOLO: {
- switch(listitem)
- {
- case 0: // View Bolo's
- {
- ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
- new found = 0;
- for(new i=0;i<sizeof(BoloInfo);i++)
- {
- if(BoloInfo[i][bUsed] == 1)
- {
- found++;
- break;
- }
- }
- if(found == 0) return SendClientMessage(playerid,COLOR_BLUE,"BOLO: No bolo's available.");
- SendClientMessage(playerid,COLOR_WHITE,"BOLO List:");
- for(new i = 0; i < sizeof(BoloInfo); i++)
- {
- if(BoloInfo[i][bUsed] == 1)
- {
- format(string, 256, "BOLO %d - %s: %s", i+1, GetNameWithSpace(BoloInfo[i][bOfficer]), BoloInfo[i][bString]);
- SendClientMessage(playerid, COLOR_BLUE, string);
- }
- }
- }
- case 1: // Add Bolo
- {
- new found = 0;
- for(new i=0;i<sizeof(BoloInfo);i++)
- {
- if(BoloInfo[i][bUsed] == 0)
- {
- found++;
- break;
- }
- }
- if(found == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
- return SendClientMessage(playerid,COLOR_BLUE,"There is no bolo slots available.");
- }
- ShowPlayerDialog(playerid,DIALOG_BOLO_ADD,DIALOG_STYLE_INPUT,"Bolo Add","- Enter your text here -","Enter", "Go Back");
- }
- case 2: ShowPlayerDialog(playerid,DIALOG_BOLO_REMOVE,DIALOG_STYLE_LIST,"Bolo Remove","ID - 1\nID - 2\nID - 3\nID - 4\nID - 5\nID - 6\nID - 7\nID - 8\nID - 9\nID - 10","Select", "Go Back");
- }
- }
- case DIALOG_BOLO_ADD: {
- switch(response)
- {
- case 0: ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
- case 1: // Add Bolo
- {
- new foundid = -1;
- for(new i=0;i<sizeof(BoloInfo);i++) {
- if(BoloInfo[i][bUsed] == 0) {
- foundid=i;
- break;
- }
- }
- if(foundid == -1) {
- ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
- return SendClientMessage(playerid,COLOR_BLUE,"There is no bolo slots available.");
- }
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_BOLO_ADD,DIALOG_STYLE_INPUT,"Bolo","- Enter your text here -","Enter", "Go Back");
- if(strlen(inputtext) >= 128) {
- SendClientMessage(playerid, COLOR_WHITE, "Text is too long (max 128 chars).");
- ShowPlayerDialog(playerid,DIALOG_BOLO_ADD,DIALOG_STYLE_INPUT,"Bolo","- Enter your text here -","Enter", "Go Back");
- return 1;
- }
- BoloInfo[foundid][bUsed]=1;
- format(BoloInfo[foundid][bOfficer], MAX_PLAYER_NAME, "%s", PlayerInfo[playerid][pUsername]);
- strmid(BoloInfo[foundid][bString], inputtext, 0, strlen(inputtext), 255);
- format(string, 256, "BOLO: %s set a bolo: (%s).", PlayerInfo[playerid][pUsername], inputtext);
- SendFactionMessage(1,COLOR_BLUE,string);
- ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
- }
- }
- }
- case DIALOG_BOLO_REMOVE: {
- switch(response) {
- case 0: ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
- case 1:
- {
- ShowPlayerDialog(playerid,DIALOG_BOLO_REMOVE,DIALOG_STYLE_LIST,"Bolo Remove","ID - 1\nID - 2\nID - 3\nID - 4\nID - 5\nID - 6\nID - 7\nID - 8\nID - 9\nID - 10","Select", "Go Back");
- if(BoloInfo[listitem][bUsed] == 0)
- {
- format(string, sizeof(string), "Bolo ID: (%d) is not being used.", listitem+1);
- SendClientMessage(playerid,COLOR_WHITE,string);
- return 1;
- }
- format(string, 256, "BOLO: %s removed bolo: (%s).", PlayerInfo[playerid][pUsername], BoloInfo[listitem][bString]);
- SendFactionMessage(1,COLOR_BLUE,string);
- BoloInfo[listitem][bUsed]=0;
- strmid(BoloInfo[listitem][bString], "None", 0, strlen("None"), 255);
- }
- }
- }
- case DIALOG_FURN_DELETE_HOUSE: {
- if(!response) {
- DeletePVar(playerid, "FurnDeleteKey");
- DeletePVar(playerid, "FurnDeleteProperty");
- return 1;
- }
- if(GetPVarInt(playerid, "Admin") < 7) {
- DeletePVar(playerid, "FurnDeleteKey");
- DeletePVar(playerid, "FurnDeleteProperty");
- return 1;
- }
- new i = GetPVarInt(playerid, "FurnDeleteKey"), key2 = GetPVarInt(playerid, "FurnDeleteProperty");
- if(IsValidDynamicObject(HouseInfo[key2][hObject][i])) DestroyDynamicObject(HouseInfo[key2][hObject][i]);
- HouseInfo[key2][hObject][i] = 0;
- HouseInfo[key2][hoID][i] = 0;
- HouseInfo[key2][hoX][i] = 0.0;
- HouseInfo[key2][hoY][i] = 0.0;
- HouseInfo[key2][hoZ][i] = 0.0;
- HouseInfo[key2][horX][i] = 0.0;
- HouseInfo[key2][horY][i] = 0.0;
- HouseInfo[key2][horZ][i] = 0.0;
- HouseInfo[key2][hoInt][i] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Furniture object removed.");
- SaveFurnObj(key2, i);
- DeletePVar(playerid, "FurnDeleteKey");
- DeletePVar(playerid, "FurnDeleteProperty");
- }
- case DIALOG_FURN_DELETE_BUSINESS: {
- if(!response) {
- DeletePVar(playerid, "FurnDeleteKey");
- DeletePVar(playerid, "FurnDeleteProperty");
- return 1;
- }
- if(GetPVarInt(playerid, "Admin") < 7) {
- DeletePVar(playerid, "FurnDeleteKey");
- DeletePVar(playerid, "FurnDeleteProperty");
- return 1;
- }
- new i = GetPVarInt(playerid, "FurnDeleteKey"), key2 = GetPVarInt(playerid, "FurnDeleteProperty");
- if(IsValidDynamicObject(BizInfo[key2][bObject][i])) DestroyDynamicObject(BizInfo[key2][bObject][i]);
- BizInfo[key2][bObject][i] = 0;
- BizInfo[key2][boID][i] = 0;
- BizInfo[key2][boX][i] = 0.0;
- BizInfo[key2][boY][i] = 0.0;
- BizInfo[key2][boZ][i] = 0.0;
- BizInfo[key2][borX][i] = 0.0;
- BizInfo[key2][borY][i] = 0.0;
- BizInfo[key2][borZ][i] = 0.0;
- BizInfo[key2][boInt][i] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Furniture object removed.");
- SaveBizzObj(key2, i);
- DeletePVar(playerid, "FurnDeleteKey");
- DeletePVar(playerid, "FurnDeleteProperty");
- }
- case DIALOG_TAG_DELETE: {
- if(!response) {
- DeletePVar(playerid, "TagDeleteMember");
- DeletePVar(playerid, "TagDeleteIndex");
- return 1;
- }
- if(GetPVarInt(playerid, "Admin") < 1) {
- DeletePVar(playerid, "TagDeleteMember");
- DeletePVar(playerid, "TagDeleteIndex");
- return 1;
- }
- SprayTag_ClearEx(GetPVarInt(playerid, "TagDeleteMember"), GetPVarInt(playerid, "TagDeleteIndex"));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Tag removed!");
- DeletePVar(playerid, "TagDeleteMember");
- DeletePVar(playerid, "TagDeleteIndex");
- }
- case DIALOG_TAG_DELETEALL: {
- if(!response) {
- DeletePVar(playerid, "TagDeleteMember");
- return 1;
- }
- if(GetPVarInt(playerid, "Admin") < 1) {
- DeletePVar(playerid, "TagDeleteMember");
- return 1;
- }
- new member = GetPVarInt(playerid, "TagDeleteMember");
- for(new i = 0; i < MAX_FACTION_TAGS; i++) {
- if(IsValidDynamicObject(SprayTags[member][i][_spObject])) {
- SprayTag_ClearEx(member, i);
- }
- }
- format(string, sizeof(string), "AdmCmd: %s removed all spray-tags belonging to faction %s.", AdminName(playerid), FactionInfo[member][fName]);
- SendAdminMessage(COLOR_ORANGE, string);
- format(string, sizeof(string), "[NOTICE] {FFFFFF}%s removed all spray-tags belonging to your faction.", AdminName(playerid));
- SendFactionMessage(member, COLOR_ORANGE, string);
- DeletePVar(playerid, "TagDeleteMember");
- }
- case DIALOG_VEHICLE_FURN_CREATE: {
- if(!response) {
- DeletePVar(playerid, "FurnVehicleID");
- return 1;
- }
- new vehicleid = GetPVarInt(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleID");
- if(vehicleid == 0) { return 1; } //Just incase.
- if(!CanFurnishVehicle(playerid, vehicleid)) { return 1; }
- new cost = 250;
- if(GetPVarInt(playerid, "MonthDon") > 0) { cost = 0; }
- if(IsNeonObject(PlayerInfo[playerid][pFurnID])) { cost = 2500; }
- if(GetPlayerMoneyEx(playerid) >= cost) {
- new indoor = 1;
- if(PlayerInfo[playerid][pInVehicle] == -1) { //Outside.
- indoor = 0;
- new Float:pos[3];
- GetVehiclePos(vehicleid, pos[0], pos[1], pos[2]);
- new Float:distance = GetDistanceFromPointToPoint(PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], pos[0], pos[1], pos[2]);
- if(distance > VEHICLE_PLANT_DISTANCE) {
- scm(playerid, COLOR_LIGHTRED, "WARNING: Object is too far from the vehicle and could not be planted!");
- return 1;
- } else { SendClientMessage(playerid, COLOR_ORANGE, "[NOTICE] {FFFFFF}Abuse of vehicle-attachments will result in a ban."); }
- }
- if(GetPlayerVirtualWorld(playerid) == 0) { indoor = 0; } //Just in-case since we know no vehicle occupies ID 0.
- format(string, sizeof(string),"~r~-$%d", cost);
- GameTextForPlayer(playerid, string, 5000, 1);
- GivePlayerMoneyEx(playerid, -cost);
- BuildVehicleObject(playerid, vehicleid, PlayerInfo[playerid][pFurnID], PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], PlayerInfo[playerid][pFurnR][0], PlayerInfo[playerid][pFurnR][1], PlayerInfo[playerid][pFurnR][2], indoor);
- } else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
- }
- case DIALOG_VEHICLE_FURN_REMOVE_CONFIRM: {
- if(!response) {
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- return 1;
- }
- if(GetPVarInt(playerid, "Admin") < 4) {
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- return 1;
- }
- DeleteVehicleObject(GetPVarInt(playerid, "FurnVehicleID"), GetPVarInt(playerid, "FurnVehicleKey"));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vehicle object removed!");
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- }
- case DIALOG_VEHICLE_FURN_REMOVEALL_CONFIRM: {
- if(!response) {
- DeletePVar(playerid, "FurnVehicleID");
- return 1;
- }
- if(GetPVarInt(playerid, "Admin") < 4) {
- DeletePVar(playerid, "FurnVehicleID");
- return 1;
- }
- new vehicleid = GetPVarInt(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleID");
- if(vehicleid == 0) { return 1; } //Just incase.
- for(new slot = 0; slot < MAX_VEHICLE_OBJ; slot++) {
- if(VehicleInfo[vehicleid][voID][slot] != 0) {
- DeleteVehicleObject(vehicleid, slot);
- }
- }
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "All vehicle objects removed!");
- }
- case DIALOG_VEHFURN_EDIT: {
- if(!response) {
- DeletePVar(playerid, "CurEditMdl");
- return 1;
- }
- new count = 0, vehicleid = GetPVarInt(playerid, "FurnVehicleID"), editmdl = GetPVarInt(playerid, "CurEditMdl");
- for(new slot = 0; slot < MAX_VEHICLE_OBJ; slot++) {
- if(VehicleInfo[vehicleid][voID][slot] == editmdl) {
- if(PlayerInfo[playerid][pInVehicle] != -1) {
- if(VehicleInfo[vehicleid][voIndoor][slot] == 1) {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectVehObj", "ii", playerid, slot);
- break;
- }
- count++;
- }
- } else {
- if(outdoor_vehicle_furn == 0) { break; }
- if(VehicleInfo[vehicleid][voIndoor][slot] == 0) {
- if(count >= listitem)
- {
- CallRemoteFunction("SelectVehObj", "ii", playerid, slot);
- break;
- }
- count++;
- }
- }
- }
- }
- DeletePVar(playerid, "CurEditMdl");
- }
- case DIALOG_VEHICLE_FURN_SELECT: {
- if(GetPVarInt(playerid, "PlayerLogged") != 1) return true;
- if(!response) {
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- return 1;
- }
- new vehicleid = GetPVarInt(playerid, "FurnVehicleID"), slot = GetPVarInt(playerid, "FurnVehicleKey");
- if(!IsValidDynamicObject(VehicleInfo[vehicleid][vObject][slot]) || !CanFurnishVehicle(playerid, vehicleid)) {
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- return 1;
- }
- new furnid = 0, furnitname[100];
- furnitname="N/A";
- for(new xe; xe<sizeof(FurnObjs) ;xe++) {
- if(VehicleInfo[vehicleid][voID][slot] == FurnObjs[xe]) {
- format(furnitname, 100, "%d", FurnObjs[xe]);
- furnid=xe;
- break;
- }
- }
- switch(listitem) {
- case 0: // Edit Object
- {
- new obj = 0, Float:pos[3];
- if(VehicleInfo[vehicleid][voIndoor][slot] == 1) { //Indoor.
- new Float:rot[3];
- GetDynamicObjectPos(VehicleInfo[vehicleid][vObject][slot], pos[0], pos[1], pos[2]);
- GetDynamicObjectRot(VehicleInfo[vehicleid][vObject][slot], rot[0], rot[1], rot[2]);
- obj = CreatePlayerObject(playerid, VehicleInfo[vehicleid][voID][slot], pos[0], pos[1], pos[2], rot[0], rot[1], rot[2], 100.0);
- } else { //Outdoor.
- GetVehicleRelativePos(vehicleid, pos[0], pos[1], pos[2], VehicleInfo[vehicleid][voX][slot], VehicleInfo[vehicleid][voY][slot], VehicleInfo[vehicleid][voZ][slot]);
- new Float:vRotZ;
- GetVehicleZAngle(vehicleid, vRotZ);
- obj = CreatePlayerObject(playerid, VehicleInfo[vehicleid][voID][slot], pos[0], pos[1], pos[2], VehicleInfo[vehicleid][vorX][slot], VehicleInfo[vehicleid][vorY][slot], VehicleInfo[vehicleid][vorZ][slot]+vRotZ, 100.0);
- }
- DestroyVehicleObject(vehicleid, slot);
- SetPVarInt(playerid, "FurnObject", obj);
- SetPVarInt(playerid, "EditorMode", EDITOR_MODE_VEHICLEFURN_EDIT);
- PlayerInfo[playerid][pFurnID] = furnid;
- EditPlayerObject(playerid, obj);
- format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", furnitname);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- case 1: // Select Material
- {
- SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: Editing an invalid-layer MAY cause parts of the object to turn invisible, resetting the layers material will fix this.");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"When you choose a layer to edit, that layer becomes highlighted in red.");
- ShowPlayerDialog(playerid, DIALOG_VEHICLE_FURN_MLAYER, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
- }
- case 2: // Reset Material
- {
- for(new v=0; v < 13; v++) {
- VehicleMInfo[vehicleid][slot][v] = 0;
- }
- DestroyVehicleObject(vehicleid, slot);
- CreateVehicleObject(vehicleid, slot);
- Streamer_Update(playerid);
- SendClientMessage(playerid ,COLOR_LIGHTBLUE, "You've reset the selected objects material.");
- SaveVehObj(vehicleid, slot);
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- }
- case 3: // Remove Object
- {
- DeleteVehicleObject(vehicleid, slot);
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- }
- }
- }
- case DIALOG_VEHICLE_FURN_MLAYER: { //What layer do you want to change? Material-editing.
- if(!response) {
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- return 1;
- }
- new vehicleid = GetPVarInt(playerid, "FurnVehicleID"), slot = GetPVarInt(playerid, "FurnVehicleKey");
- SetPVarInt(playerid, "FurnEditL", listitem);
- ChangeDynamicObjectMaterial(VehicleInfo[vehicleid][vObject][slot], listitem, 30);
- new list[2048];
- for(new i=0; i < sizeof(MaterialIDs); i++) {
- format(list, 2048, "%s\n%s", list, MaterialIDs[i][Name]);
- }
- ShowPlayerDialog(playerid, DIALOG_VEHICLE_FURN_MATERIAL, DIALOG_STYLE_LIST, "Material List", list, "Select", "Back");
- }
- case DIALOG_VEHICLE_FURN_MATERIAL: { //Object Material List
- new vehicleid = GetPVarInt(playerid, "FurnVehicleID"), slot = GetPVarInt(playerid, "FurnVehicleKey");
- if(!response) {
- DestroyVehicleObject(vehicleid, slot);
- CreateVehicleObject(vehicleid, slot);
- Streamer_Update(playerid);
- DeletePVar(playerid, "FurnEditL");
- return ShowPlayerDialog(playerid, DIALOG_VEHICLE_FURN_MLAYER, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
- }
- new layer = GetPVarInt(playerid,"FurnEditL");
- if(listitem == 0) {
- VehicleMInfo[vehicleid][slot][layer] = 0;
- DestroyVehicleObject(vehicleid, slot);
- CreateVehicleObject(vehicleid, slot);
- Streamer_Update(playerid);
- SaveVehObj(vehicleid, slot);
- DeletePVar(playerid, "FurnEditL");
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- format(string, sizeof(string), "Object %d's material layer %d reset to default.", VehicleInfo[vehicleid][vObject][slot], layer);
- return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- }
- VehicleMInfo[vehicleid][slot][layer] = listitem;
- ChangeDynamicObjectMaterial(VehicleInfo[vehicleid][vObject][slot], layer, listitem);
- SaveVehObj(vehicleid, slot);
- format(string, sizeof(string), "Object %d's material layer %d changed to: '%s'.", VehicleInfo[vehicleid][vObject][slot], layer, MaterialIDs[listitem][Name]);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "FurnEditL");
- DeletePVar(playerid, "FurnVehicleID");
- DeletePVar(playerid, "FurnVehicleKey");
- }
- case DIALOG_VEHFURN_REMOVEALL_CONFIRM: {
- if(!response) {
- DeletePVar(playerid, "FurnVehicleID");
- return 1;
- }
- new vehicleid = GetPVarInt(playerid, "FurnVehicleID");
- if(!CanFurnishVehicle(playerid, vehicleid)) {
- DeletePVar(playerid, "FurnVehicleID");
- return 1;
- }
- for(new slot = 0; slot < MAX_VEHICLE_OBJ; slot++) {
- if(VehicleInfo[vehicleid][voID][slot] != 0) {
- DeleteVehicleObject(vehicleid, slot);
- }
- }
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "All vehicle objects deleted!");
- DeletePVar(playerid, "FurnVehicleID");
- }
- case DIALOG_SIREN_EDITOR: {
- if(response) {
- switch(listitem)
- {
- case 0:
- {
- new count = 0;
- for(new i = 0; i < MAX_VEHICLE_SIREN_OBJECTS; i++)
- {
- if(VehicleInfo[GetPlayerVehicleID(playerid)][vSirenObject][i] != 0)
- {
- count++;
- }
- }
- if(count >= MAX_VEHICLE_SIREN_OBJECTS)
- {
- ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Siren Editor", "Add a siren\nRemove a siren", "Select","Exit");
- SendClientMessage(playerid, COLOR_GREY, "You have reached the maximum ammount of attachable sirens per vehicle.");
- return 1;
- }
- new object_array[sizeof(SirenObjects)];
- for(new i = 0; i < sizeof(SirenObjects); i++)
- {
- object_array[i] = SirenObjects[i][0];
- }
- ShowModelSelectionMenuEx(playerid, object_array, sizeof(object_array), "Siren Editor", 18, 16.0, 0.0, -55.0);
- }
- case 1:
- {
- new count = 0;
- for(new i = 0; i < MAX_VEHICLE_SIREN_OBJECTS; i++)
- {
- if(VehicleInfo[GetPlayerVehicleID(playerid)][vSirenObject][i] != 0)
- {
- count++;
- }
- }
- if(count == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Siren Editor", "Add a siren\nRemove a siren", "Select","Exit");
- SendClientMessage(playerid, COLOR_GREY, "This vehicle has no siren objects to remove.");
- return 1;
- }
- new vehicleid = GetPVarInt(playerid, "SirenEditorVehicleID");
- for(new i = 0; i < MAX_VEHICLE_SIREN_OBJECTS; i++)
- {
- if(VehicleInfo[vehicleid][vSirenObject][i] != 0)
- {
- for(new i2 = 0; i2 < sizeof(SirenObjects); i2++)
- {
- if(VehicleInfo[vehicleid][vSirenObject][i] == SirenObjects[i2][0])
- {
- format(string, sizeof(string), "%s%s\n", string, SirenObjects[i2][1]);
- }
- }
- }
- }
- ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR_REMOVE, DIALOG_STYLE_LIST, "Siren Editor", string, "Select","Back");
- }
- }
- }
- else
- {
- TogglePlayerControllable(playerid, 1);
- }
- return 1;
- }
- case DIALOG_SIREN_EDITOR_REMOVE:
- {
- if(response)
- {
- new vehicleid = GetPVarInt(playerid, "SirenEditorVehicleID");
- DestroyDynamicObject(VehicleInfo[vehicleid][vSirenObjectID][listitem]);
- VehicleInfo[vehicleid][vSirenObjectID][listitem] = 0;
- VehicleInfo[vehicleid][vSirenObject][listitem] = 0;
- ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Siren Editor", "Add a siren\nRemove a siren", "Select","Exit");
- TogglePlayerControllable(playerid, 0);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Siren Editor", "Add a siren\nRemove a siren", "Select","Exit");
- }
- return 1;
- }
- case SPRAYTAG_DIALOG_RETURN: SprayTag_Dialog(playerid, TYPE_LIST_MENU);
- case SPRAYTAG_MENU:
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0: SprayTag_Dialog(playerid, TYPE_LIST_TAGS_CREATE);
- case 1: SprayTag_Dialog(playerid, TYPE_LIST_TAGS);
- case 2: SprayTag_Dialog(playerid, TYPE_LIST_TAGS_DELETE);
- case 3: SprayTag_Dialog(playerid, TYPE_LIST_TAGS_FIND);
- }
- }
- case SPRAYTAG_EDIT_MAIN:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_MENU);
- new member = GetPVarInt(playerid, "Member");
- if(member == 0) return 1;
- if(SprayTags[member][listitem][_spPosX] == 0.0) return ShowPlayerDialog(playerid, SPRAYTAG_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Spray Tag - {BD0000} Oops!!", "Oops! There's nothing in this slot.", "Go back", "");
- spraytag_slot[playerid] = listitem;
- spraytag_bold[playerid] = SprayTags[member][listitem][_spBold];
- spraytag_color[playerid] = SprayTags[member][listitem][_spFontColor];
- format(spraytag_text[playerid], 128, SprayTags[member][listitem][_spText]);
- format(spraytag_font[playerid], 50, SprayTags[member][listitem][_spFont]);
- spraytag_size[playerid] = SprayTags[member][listitem][_spFontSize];
- SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case SPRAYTAG_DELETE:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_MENU);
- if(SprayTags[GetPVarInt(playerid, "Member")][listitem][_spPosX] == 0.0) return ShowPlayerDialog(playerid, SPRAYTAG_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Spray Tag - {BD0000} Oops!!", "Oops! There's nothing in this slot.", "Go back", "");
- new szMessage[60];
- SprayTag_Clear(playerid, listitem);
- format(szMessage, sizeof szMessage, "[Spray Tag] The spray tag #%i has been deleted successfully.", listitem);
- SendClientMessage(playerid, -1, szMessage);
- SprayTag_Dialog(playerid, TYPE_LIST_MENU);
- }
- case SPRAYTAG_FIND:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_MENU);
- new member = GetPVarInt(playerid, "Member");
- if(member == 0) return 1;
- if(SprayTags[member][listitem][_spPosX] == 0.0) return ShowPlayerDialog(playerid, SPRAYTAG_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Spray Tag - {BD0000} Oops!!", "Oops! There's nothing in this slot.", "Go back", "");
- new szMessage[60];
- spraytag_find[playerid] = 1;
- SetPlayerCheckpoint(playerid, SprayTags[member][listitem][_spPosX], SprayTags[member][listitem][_spPosY], SprayTags[member][listitem][_spPosZ], 3.0);
- SetPVarInt(playerid, "TagToFind", listitem);
- format(szMessage, sizeof szMessage, "[Spray Tag] A checkpoint was marked for spraytag #%i.", listitem);
- SendClientMessage(playerid, -1, szMessage);
- }
- case SPRAYTAG_CREATE:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_MENU);
- if(SprayTags[GetPVarInt(playerid, "Member")][listitem][_spPosX] == 0.0)
- {
- spraytag_slot[playerid] = listitem;
- format(spraytag_text[playerid], 128, "Example");
- format(spraytag_font[playerid], 50, "Arial");
- spraytag_color[playerid] = -1;
- spraytag_size[playerid] = 24;
- spraytag_bold[playerid] = 0;
- SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- } else ShowPlayerDialog(playerid, SPRAYTAG_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Spray Tag - {BD0000} Oops!!", "Oops! This slot is already taken.", "Go back", "");
- }
- case SPRAYTAG_EDIT_LIST:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_TAGS);
- new iIndex = spraytag_slot[playerid];
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid, SPRAYTAG_EDIT_TEXT, DIALOG_STYLE_INPUT, "{F7EC6F}Spray Tag - {469BF0}Text", "Enter the text you want to appear on the Spray Tag", "Submit", "Go back");
- case 1: ShowPlayerDialog(playerid, SPRAYTAG_EDIT_FONT, DIALOG_STYLE_LIST, "{F7EC6F}Spray Tag - {469BF0}Font", "Arial\nCourier\nImpact\nPricedown\nDaredevil\nBombing\naaaiight! fat\nFrom Street Art\nGhang\nGraffogie\nGraphers Blog\nNosegrind Demo", "Submit", "Go back");
- case 2: ShowPlayerDialog(playerid, SPRAYTAG_EDIT_SIZE, DIALOG_STYLE_INPUT, "{F7EC6F}Spray Tag - {469BF0}Size", "Enter the size you want this Spray Tag to be", "Submit", "Go back");
- case 3: ShowPlayerDialog(playerid, SPRAYTAG_EDIT_COLOR, DIALOG_STYLE_LIST, "{F7EC6F}Spray Tag - {469BF0}Color", "{FF0000}Red\n{04B404}Green\n{00B5CD}Light Blue\n{FFFF00}Yellow\n{0000FF}Blue\n{848484}Gray\n{FF00FF}Pink\n{FFFFFF}White", "Submit", "Go back");
- case 4:
- {
- switch(spraytag_bold[playerid])
- {
- case 0: spraytag_bold[playerid] = 1;
- case 1: spraytag_bold[playerid] = 0;
- }
- SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case 5:
- {
- Streamer_Update(playerid);
- EditDynamicObject(playerid, SprayTags[GetPVarInt(playerid, "Member")][iIndex][_spObject]);
- SetPVarInt(playerid, "SPRAYTAG_EDIT", 2);
- }
- }
- }
- case SPRAYTAG_EDIT_TEXT:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- format(spraytag_text[playerid], 128, inputtext);
- SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case SPRAYTAG_EDIT_FONT:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- format(spraytag_font[playerid], 32, inputtext);
- SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case SPRAYTAG_EDIT_SIZE:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- spraytag_size[playerid] = strval(inputtext);
- SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case SPRAYTAG_EDIT_COLOR:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- new iColor;
- switch(listitem)
- {
- case 0: iColor = HexToInt("0xFFFF0000");
- case 1: iColor = HexToInt("0xFF04B404");
- case 2: iColor = HexToInt("0xFF00B5CD");
- case 3: iColor = HexToInt("0xFFFFFF00");
- case 4: iColor = HexToInt("0xFF0000FF");
- case 5: iColor = HexToInt("0xFF848484");
- case 6: iColor = HexToInt("0xFFFF00FF");
- case 7: iColor = HexToInt("0xFFFFFFFF");
- }
- spraytag_color[playerid] = iColor;
- SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case SPRAYTAG_CREATE_MAIN:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_TAGS_CREATE);
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid, SPRAYTAG_CREATE_TEXT, DIALOG_STYLE_INPUT, "{F7EC6F}Spray Tag - {469BF0}Text", "Enter the text you want to appear on the Spray Tag", "Submit", "Go back");
- case 1: ShowPlayerDialog(playerid, SPRAYTAG_CREATE_FONT, DIALOG_STYLE_LIST, "{F7EC6F}Spray Tag - {469BF0}Font", "Arial\nCourier\nImpact\nPricedown\nDaredevil\nBombing\naaaiight! fat\nFrom Street Art\nGhang\nGraffogie\nGraphers Blog\nNosegrind Demo", "Submit", "Go back");
- case 2: ShowPlayerDialog(playerid, SPRAYTAG_CREATE_SIZE, DIALOG_STYLE_INPUT, "{F7EC6F}Spray Tag - {469BF0}Size", "Enter the size you want this Spray Tag to be", "Submit", "Go back");
- case 3: ShowPlayerDialog(playerid, SPRAYTAG_CREATE_COLOR, DIALOG_STYLE_LIST, "{F7EC6F}Spray Tag - {469BF0}Color", "{FF0000}Red\n{04B404}Green\n{00B5CD}Light Blue\n{FFFF00}Yellow\n{0000FF}Blue\n{848484}Gray\n{FF00FF}Pink\n{FFFFFF}White", "Submit", "Go back");
- case 4:
- {
- switch(spraytag_bold[playerid])
- {
- case 0: spraytag_bold[playerid] = 1;
- case 1: spraytag_bold[playerid] = 0;
- }
- SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case 5:
- {
- new Float:Position[3];
- GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
- new tagobj = 19353;
- if(strlen(spraytag_text[playerid]) > 25) { tagobj=19445; }
- spraytag_object[playerid] = CreateDynamicObject(tagobj, Position[0]-1.0, Position[1], Position[2], 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, SPRAY_TAG_OBJECT_DISTANCE);
- SetDynamicObjectMaterialText(spraytag_object[playerid], 0, spraytag_text[playerid], OBJECT_MATERIAL_SIZE_512x512, spraytag_font[playerid], spraytag_size[playerid], spraytag_bold[playerid], spraytag_color[playerid], 0, 1);
- Streamer_Update(playerid);
- EditDynamicObject(playerid, spraytag_object[playerid]);
- SetPVarInt(playerid, "SPRAYTAG_EDIT", 1);
- }
- }
- }
- case SPRAYTAG_CREATE_TEXT:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- format(spraytag_text[playerid], 128, inputtext);
- SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case SPRAYTAG_CREATE_FONT:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- format(spraytag_font[playerid], 50, inputtext);
- SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case SPRAYTAG_CREATE_SIZE:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- spraytag_size[playerid] = strval(inputtext);
- SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case SPRAYTAG_CREATE_COLOR:
- {
- if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- new iColor;
- switch(listitem)
- {
- case 0: iColor = HexToInt("0xFFFF0000");
- case 1: iColor = HexToInt("0xFF04B404");
- case 2: iColor = HexToInt("0xFF00B5CD");
- case 3: iColor = HexToInt("0xFFFFFF00");
- case 4: iColor = HexToInt("0xFF0000FF");
- case 5: iColor = HexToInt("0xFF848484");
- case 6: iColor = HexToInt("0xFFFF00FF");
- case 7: iColor = HexToInt("0xFFFFFFFF");
- }
- spraytag_color[playerid] = iColor;
- SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case DIALOG_VEHICLE_SPAWN: {
- if(response) {
- new query[95];
- mysql_format(handlesql, query, sizeof(query), "SELECT `ID` FROM `vehicles` WHERE `Owner` = '%e' LIMIT %i, %i;", PlayerInfo[playerid][pUsername], listitem, listitem + 1);
- mysql_tquery(handlesql, query, "vs_OnPlayerVehicleSpawnSelected", "i", playerid);
- }
- }
- case DIALOG_VEHICLE_SELL: {
- if(response) {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You have to be in your vehicle in order to sell it.");
- new vehicleID = GetPlayerVehicleID(playerid);
- if(!PlayerOwnsVehicle(playerid, vehicleID)) return SendClientMessage(playerid, COLOR_GREY, "You don't own this vehicle.");
- if(VehicleInfo[vehicleID][vDonate] != 0) return SendClientMessage(playerid, COLOR_GREY, "You cannot sell a donor vehicle.");
- new msg[80],
- sellPrice = VehicleInfo[vehicleID][vValue] / 3;
- format(msg, sizeof(msg), "Vehicle sold for $%i.", sellPrice);
- SendClientMessage(playerid, COLOR_WHITE, msg);
- GivePlayerMoneyEx(playerid, sellPrice);
- mysql_format(handlesql, msg, sizeof(msg), "DELETE FROM `vehicles` WHERE `ID` = %i;", VehicleInfo[vehicleID][vID]);
- mysql_tquery(handlesql, msg);
- mysql_format(handlesql, msg, sizeof(msg), "DELETE FROM `vehiclefurn` WHERE VID=%i;", VehicleInfo[vehicleID][vID]);
- mysql_tquery(handlesql, msg);
- DespawnVehicle(vehicleID);
- }
- }
- case DIALOG_RADIO: {
- if(response) {
- switch(listitem) {
- case 0: {
- new dialogMsg[5000];
- for(new i = 0; i < sizeof(CarRadio); i++) {
- if(i == 0) {
- format(dialogMsg, sizeof(dialogMsg), "%s", CarRadio[i][cName]);
- } else {
- format(dialogMsg, sizeof(dialogMsg), "%s\n%s", dialogMsg, CarRadio[i][cName]);
- }
- }
- ShowPlayerDialog(playerid, DIALOG_RADIO_STATION, DIALOG_STYLE_LIST, "Radio Stations", dialogMsg, "Select", "Go Back");
- }
- case 1: {
- ShowPlayerDialog(playerid, DIALOG_RADIO_CUSTOM, DIALOG_STYLE_INPUT, "Direct URL", "Enter the URL you would like to play:", "Enter", "Go Back");
- }
- case 2: {
- new vehicleID = GetPlayerVehicleID(playerid);
- if(vehicleID == 0 && IsValidCar(PlayerInfo[playerid][pInVehicle])) { vehicleID = PlayerInfo[playerid][pInVehicle]; }
- if(vehicleID == -1 || vehicleID == 0) return SendClientMessage(playerid, COLOR_GREY, "You have to be in a vehicle with a radio installed.");
- if(GetPlayerVehicleID(playerid) != vehicleID && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You have to be in the driver seat of your vehicle in order to set the radio station.");
- strmid(VehicleInfo[vehicleID][vRadio], "None", 0, strlen("None"), VEHICLE_RADIO_URL_MAX_LENGTH);
- GameTextForPlayer(playerid, "~w~Radio~n~~r~OFF", 4000, 3);
- foreach(new i : Player) {
- if(GetPlayerVehicleID(i) == vehicleID) {
- StopAudioStreamForPlayerEx(i);
- LoadRadios(i);
- }
- }
- }
- }
- }
- }
- case DIALOG_RADIO_STATION: {
- if(!response) {
- return cmd_v(playerid, "radio");
- } else {
- new vehicleID = GetPlayerVehicleID(playerid);
- if(vehicleID == 0 && IsValidCar(PlayerInfo[playerid][pInVehicle])) { vehicleID = PlayerInfo[playerid][pInVehicle]; }
- if(vehicleID == -1 || vehicleID == 0) return SendClientMessage(playerid, COLOR_GREY, "You have to be in a vehicle with a radio installed.");
- if(IsNotAEngineCar(vehicleID) && IsEnterableVehicle(vehicleID) == -1) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a radio installed.");
- if(GetPlayerVehicleID(playerid) != vehicleID && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You have to be in the driver seat of your vehicle in order to set the radio station.");
- if (listitem == 0) {
- PlayRadioURL(vehicleID, RadioLSStream, 1);
- } else PlayRadioURL(vehicleID, CarRadio[listitem][cURL]);
- }
- }
- case DIALOG_RADIO_CUSTOM: {
- if(!response) {
- return cmd_v(playerid, "radio");
- } else {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_RADIO_CUSTOM, DIALOG_STYLE_INPUT, "Direct URL", "Enter the URL you would like to play:", "Enter", "Go Back");
- if(strlen(inputtext) > VEHICLE_RADIO_URL_MAX_LENGTH) {
- SendClientMessage(playerid, COLOR_GREY, "The URL you entered is too long, please try again.");
- return ShowPlayerDialog(playerid, DIALOG_RADIO_CUSTOM, DIALOG_STYLE_INPUT, "Direct URL", "Enter the URL you would like to play:", "Enter", "Go Back");
- }
- new vehicleID = GetPlayerVehicleID(playerid);
- if(vehicleID == 0 && IsValidCar(PlayerInfo[playerid][pInVehicle])) { vehicleID = PlayerInfo[playerid][pInVehicle]; }
- if(vehicleID == -1 || vehicleID == 0) return SendClientMessage(playerid, COLOR_GREY, "You have to be in a vehicle with a radio installed.");
- if(IsNotAEngineCar(vehicleID) && IsEnterableVehicle(vehicleID) == -1) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a radio installed.");
- if(GetPlayerVehicleID(playerid) != vehicleID && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You have to be in the driver seat of your vehicle in order to set the radio station.");
- PlayRadioURL(vehicleID, inputtext);
- }
- }
- case DIALOG_MDC_SEARCH_CITIZEN: {
- if(response) {
- mdc_SearchCitizen(playerid, inputtext);
- } else {
- SelectTextDraw(playerid, -1);
- }
- }
- case DIALOG_MDC_SEARCH_PHONE_NUMBER: {
- if(response) {
- if(!IsNumeric(inputtext)) {
- SendClientMessage(playerid, COLOR_GREY, "You have to enter a valid numeric phone number.");
- ShowPlayerDialog(playerid, DIALOG_MDC_SEARCH_PHONE_NUMBER, DIALOG_STYLE_INPUT, "{3D62A8}Search Phone Number", "Please enter the phone number below:", "Search", "Cancel");
- } else {
- new query[130];
- mysql_format(handlesql, query, sizeof(query), "SELECT `Name`, `Model`, `Age`, `Sex`, `DriveLic`, `GunLic`, `JobID` FROM `accounts` WHERE `PhoneNum` = %i;", strval(inputtext));
- mysql_tquery(handlesql, query, "mdc_SearchPhoneNumber", "ii", playerid, strval(inputtext));
- }
- } else {
- SelectTextDraw(playerid, -1);
- }
- }
- case DIALOG_MDC_SEARCH_SERIAL: {
- if(response) {
- if(!IsNumeric(inputtext)) {
- SendClientMessage(playerid, COLOR_GREY, "You have to enter a numeric weapon serial number.");
- ShowPlayerDialog(playerid, DIALOG_MDC_SEARCH_SERIAL, DIALOG_STYLE_INPUT, "{3D62A8}Search Weapon Serial", "Please enter the weapons serial number below:", "Search", "Cancel");
- } else {
- new query[140];
- mysql_format(handlesql, query, sizeof(query), "SELECT `Name`, `Model`, `Age`, `Sex`, `DriveLic`, `GunLic`, `JobID`, `PhoneNum` FROM `accounts` WHERE `WepSerial` = %d;", strval(inputtext));
- mysql_tquery(handlesql, query, "mdc_SearchSerial", "i", playerid);
- }
- } else {
- SelectTextDraw(playerid, -1);
- }
- }
- case DIALOG_MDC_SEARCH_PLATE: {
- if(response) {
- new query[140];
- mysql_format(handlesql, query, sizeof(query), "SELECT `Model`, `ColorOne`, `ColorTwo`, `Owner`, `Insurance` FROM `vehicles` WHERE `Plate` = '%e';", inputtext);
- mysql_tquery(handlesql, query, "mdc_SearchLicensePlate", "is", playerid, inputtext);
- } else {
- SelectTextDraw(playerid, -1);
- }
- }
- case DIALOG_CLOSE: {
- return 1;
- }
- //new case
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement