Advertisement
Guest User

Untitled

a guest
Oct 13th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.60 KB | None | 0 0
  1. case DIALOG_FACLOCKER:
  2. {
  3. new iFaction = PlayerData[playerid][p_Faction], szGender[4], szGun[32];
  4. switch(PlayerData[playerid][p_Gender])
  5. {
  6. case 0: szGender = "his";
  7. case 1: szGender = "her";
  8. case 2: szGender = "his";
  9. }
  10.  
  11. GetWeaponName(FactionInfo[iFaction][fI_Weapons][listitem-5], szGun, 32);
  12.  
  13. if(response) {
  14. if(FactionInfo[iFaction][fI_wStock] < 1) {
  15. SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}There is nothing in the lockers as their is no stock, order some more!");
  16. return 1;
  17. }
  18.  
  19. if(listitem == 0) {
  20. if(GetPVarInt(playerid, "_badgeOn") == 0) {
  21. format(szOutput, sizeof(szOutput), "* %s takes out %s badge from the locker, clipping it on.", GetPlayerNameEx(playerid), szGender);
  22. SetPlayerColor(playerid, FactionInfo[iFaction][fI_bColour]);
  23. SetPVarInt(playerid, "_badgeOn", 1);
  24. }
  25. else {
  26. format(szOutput, sizeof(szOutput), "* %s unclips %s badge, placing it inside the locker.", GetPlayerNameEx(playerid), szGender);
  27. SetPlayerColor(playerid, COLOR_WHITE);
  28. SetPVarInt(playerid, "_badgeOn", 0);
  29. }
  30. }
  31. else if(listitem == 1) {
  32. format(szOutput, sizeof(szOutput), "* %s takes out a new kevlar vest from the locker.", GetPlayerNameEx(playerid));
  33. SetPlayerArmour(playerid, 100);
  34. FactionInfo[iFaction][fI_wStock] -= 1;
  35. FactionInfo[iFaction][fI_vBalance] -= 250;
  36.  
  37. 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));
  38. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  39.  
  40. 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);
  41. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  42.  
  43. }
  44. else if(listitem == 2) {
  45. format(szOutput, sizeof(szOutput), "* %s takes out a new uniform from the locker.", GetPlayerNameEx(playerid));
  46. SetPlayerHealth(playerid, 100);
  47. FactionInfo[iFaction][fI_wStock] -= 1;
  48. FactionInfo[iFaction][fI_vBalance] -= 100;
  49.  
  50. 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));
  51. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  52.  
  53. 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);
  54. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  55. }
  56. else if(listitem == 3) {
  57. if(FactionInfo[PlayerData[playerid][p_Faction]][fI_iType] == 3 || FactionInfo[PlayerData[playerid][p_Faction]][fI_iType] == 4) {
  58. SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You are not allowed to carry a tazer.");
  59. return 1;
  60. }
  61.  
  62. if(GetPVarInt(playerid, "_GotTazer") != 0) {
  63. SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You are already carrying a tazer.");
  64. return 1;
  65. }
  66.  
  67. format(szOutput, sizeof(szOutput), "* %s takes out a X26 Tazer from the locker.", GetPlayerNameEx(playerid));
  68. FactionInfo[iFaction][fI_wStock] -= 1;
  69. FactionInfo[iFaction][fI_vBalance] -= 70;
  70. SetPVarInt(playerid, "_GotTazer", 1);
  71.  
  72. 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));
  73. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  74.  
  75. 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);
  76. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  77. }
  78. else if(listitem == 4) {
  79. if(FactionInfo[PlayerData[playerid][p_Faction]][fI_iType] == 3 || FactionInfo[PlayerData[playerid][p_Faction]][fI_iType] == 4) {
  80. SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You are not allowed to carry handcuffs.");
  81. return 1;
  82. }
  83.  
  84. if(GetPVarInt(playerid, "_HasCuffs") >= 2) {
  85. SendClientMessage(playerid, COLOR_WHITE, "{D10D0D}[ERROR]: {FFFFFF}You already have x2 pairs of cuffs on you.");
  86. return 1;
  87. }
  88.  
  89. format(szOutput, sizeof(szOutput), "* %s takes out two pairs of handcuffs from the locker.", GetPlayerNameEx(playerid));
  90. FactionInfo[iFaction][fI_wStock] -= 1;
  91. FactionInfo[iFaction][fI_vBalance] -= 25;
  92.  
  93. SetPVarInt(playerid, "_HasCuffs", 2);
  94.  
  95. 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));
  96. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  97.  
  98. 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);
  99. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  100. }
  101. else if(listitem > 4) {
  102. GivePlayerGun(playerid, FactionInfo[iFaction][fI_Weapons][listitem-5], 99999);
  103. FactionInfo[iFaction][fI_wStock] -= 1;
  104. format(szOutput, sizeof(szOutput), "* %s takes out a %s from the locker.", GetPlayerNameEx(playerid), szGun);
  105.  
  106. 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);
  107. mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
  108. }
  109. SendNearbyMessage(20, playerid, szOutput, COLOR_PURPLE);
  110. }
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement