Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case DIALOG_FACLOCKER:
- {
- new iFaction = PlayerData[playerid][p_Faction], szGender[4], szGun[32];
- switch(PlayerData[playerid][p_Gender])
- {
- case 0: szGender = "his";
- case 1: szGender = "her";
- case 2: szGender = "his";
- }
- GetWeaponName(FactionInfo[iFaction][fI_Weapons][listitem-5], szGun, 32);
- if(response) {
- if(FactionInfo[iFaction][fI_wStock] < 1) {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}There is nothing in the lockers as their is no stock, order some more!");
- return 1;
- }
- if(listitem == 0) {
- if(GetPVarInt(playerid, "_badgeOn") == 0) {
- format(szOutput, sizeof(szOutput), "* %s takes out %s badge from the locker, clipping it on.", GetPlayerNameEx(playerid), szGender);
- SetPlayerColor(playerid, FactionInfo[iFaction][fI_bColour]);
- SetPVarInt(playerid, "_badgeOn", 1);
- }
- else {
- format(szOutput, sizeof(szOutput), "* %s unclips %s badge, placing it inside the locker.", GetPlayerNameEx(playerid), szGender);
- SetPlayerColor(playerid, COLOR_WHITE);
- SetPVarInt(playerid, "_badgeOn", 0);
- }
- }
- else if(listitem == 1) {
- format(szOutput, sizeof(szOutput), "* %s takes out a new kevlar vest from the locker.", GetPlayerNameEx(playerid));
- SetPlayerArmour(playerid, 100);
- FactionInfo[iFaction][fI_wStock] -= 1;
- FactionInfo[iFaction][fI_vBalance] -= 250;
- format(szQuery, sizeof(szQuery), "INSERT INTO `faction_expenses` (faction_id, username, cost, expense) VALUES (%d, '%s', 250, 'Kevlar Vest')", PlayerData[playerid][p_Faction], GetPlayerNameEx(playerid));
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- format(szQuery, sizeof(szQuery), "UPDATE `factions` SET `lock_stock` = %d, `balance` = %d WHERE `faction_id` = %d", FactionInfo[iFaction][fI_wStock], FactionInfo[iFaction][fI_vBalance], iFaction);
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- }
- else if(listitem == 2) {
- format(szOutput, sizeof(szOutput), "* %s takes out a new uniform from the locker.", GetPlayerNameEx(playerid));
- SetPlayerHealth(playerid, 100);
- FactionInfo[iFaction][fI_wStock] -= 1;
- FactionInfo[iFaction][fI_vBalance] -= 100;
- format(szQuery, sizeof(szQuery), "INSERT INTO `faction_expenses` (faction_id, username, cost, expense) VALUES (%d, '%s', 100, 'New Uniform')", PlayerData[playerid][p_Faction], GetPlayerNameEx(playerid));
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- format(szQuery, sizeof(szQuery), "UPDATE `factions` SET `lock_stock` = %d, `balance` = %d WHERE `faction_id` = %d", FactionInfo[iFaction][fI_wStock], FactionInfo[iFaction][fI_vBalance], iFaction);
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- }
- else if(listitem == 3) {
- if(FactionInfo[PlayerData[playerid][p_Faction]][fI_iType] == 3 || FactionInfo[PlayerData[playerid][p_Faction]][fI_iType] == 4) {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You are not allowed to carry a tazer.");
- return 1;
- }
- if(GetPVarInt(playerid, "_GotTazer") != 0) {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You are already carrying a tazer.");
- return 1;
- }
- format(szOutput, sizeof(szOutput), "* %s takes out a X26 Tazer from the locker.", GetPlayerNameEx(playerid));
- FactionInfo[iFaction][fI_wStock] -= 1;
- FactionInfo[iFaction][fI_vBalance] -= 70;
- SetPVarInt(playerid, "_GotTazer", 1);
- format(szQuery, sizeof(szQuery), "INSERT INTO `faction_expenses` (faction_id, username, cost, expense) VALUES (%d, '%s', 70, 'X26 Tazer')", PlayerData[playerid][p_Faction], GetPlayerNameEx(playerid));
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- format(szQuery, sizeof(szQuery), "UPDATE `factions` SET `lock_stock` = %d, `balance` = %d WHERE `faction_id` = %d", FactionInfo[iFaction][fI_wStock], FactionInfo[iFaction][fI_vBalance], iFaction);
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- }
- else if(listitem == 4) {
- if(FactionInfo[PlayerData[playerid][p_Faction]][fI_iType] == 3 || FactionInfo[PlayerData[playerid][p_Faction]][fI_iType] == 4) {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You are not allowed to carry handcuffs.");
- return 1;
- }
- if(GetPVarInt(playerid, "_HasCuffs") >= 2) {
- SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You already have x2 pairs of cuffs on you.");
- return 1;
- }
- format(szOutput, sizeof(szOutput), "* %s takes out two pairs of handcuffs from the locker.", GetPlayerNameEx(playerid));
- FactionInfo[iFaction][fI_wStock] -= 1;
- FactionInfo[iFaction][fI_vBalance] -= 25;
- SetPVarInt(playerid, "_HasCuffs", 2);
- format(szQuery, sizeof(szQuery), "INSERT INTO `faction_expenses` (faction_id, username, cost, expense) VALUES (%d, '%s', 25, 'x2 Handcuffs')", PlayerData[playerid][p_Faction], GetPlayerNameEx(playerid));
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- format(szQuery, sizeof(szQuery), "UPDATE `factions` SET `lock_stock` = %d, `balance` = %d WHERE `faction_id` = %d", FactionInfo[iFaction][fI_wStock], FactionInfo[iFaction][fI_vBalance], iFaction);
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- }
- else if(listitem > 4) {
- GivePlayerGun(playerid, FactionInfo[iFaction][fI_Weapons][listitem-5], 99999);
- FactionInfo[iFaction][fI_wStock] -= 1;
- format(szOutput, sizeof(szOutput), "* %s takes out a %s from the locker.", GetPlayerNameEx(playerid), szGun);
- format(szQuery, sizeof(szQuery), "UPDATE `factions` SET `lock_stock` = %d, `balance` = %d WHERE `faction_id` = %d", FactionInfo[iFaction][fI_wStock], FactionInfo[iFaction][fI_vBalance], iFaction);
- mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
- }
- SendNearbyMessage(20, playerid, szOutput, COLOR_PURPLE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement