Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.22 KB | None | 0 0
  1. CMD:storegun(playerid, params[])
  2. {
  3. if(Homes[playerid] > 0)
  4. {
  5. if(GetPVarInt(playerid, "IsInArena") >= 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in a arena!");
  6. if(GetPVarInt( playerid, "EventToken") != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
  7. new string[128], weaponchoice[32], slot;
  8. if(sscanf(params, "s[32]d", weaponchoice, slot)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /storegun [weapon] [slot]");
  9.  
  10. for(new i; i < MAX_HOUSES; i++)
  11. {
  12. if(GetPlayerSQLId(playerid) == HouseInfo[i][hOwnerID] && IsPlayerInRangeOfPoint(playerid, 50, HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hIntVW] && GetPlayerInterior(playerid) == HouseInfo[i][hIntIW])
  13. {
  14. if (GetPVarInt(playerid, "GiveWeaponTimer") > 0)
  15. {
  16. format(string, sizeof(string), " You must wait %d seconds before depositing another weapon.", GetPVarInt(playerid, "GiveWeaponTimer"));
  17. SendClientMessageEx(playerid,COLOR_GREY,string);
  18. return 1;
  19. }
  20.  
  21. new maxslots = HouseInfo[i][hGLUpgrade];
  22. if(slot > maxslots)
  23. {
  24. SendClientMessageEx(playerid, COLOR_GREY, "Invalid slot.");
  25. return 1;
  26. }
  27.  
  28. if( HouseInfo[i][hWeapons][slot-1] != 0)
  29. {
  30. SendClientMessageEx(playerid, COLOR_GREY, "You have a weapon stored in that slot already.");
  31. return 1;
  32. }
  33.  
  34. new weapon, ammo;
  35. if(strcmp(weaponchoice, "sdpistol", true, strlen(weaponchoice)) == 0)
  36. {
  37. if( PlayerInfo[playerid][pGuns][2] == 23 && PlayerInfo[playerid][pAGuns][2] == 0 )
  38. {
  39. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a silenced pistol into your gun locker.");
  40. weapon = PlayerInfo[playerid][pGuns][2];
  41. ammo = PlayerInfo[playerid][pGunsAmmo][2];
  42. format(string,sizeof(string), "* %s deposited their silenced pistol in their house safe.", CheckMask(playerid));
  43. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  44. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  45. }
  46. }
  47. else if(strcmp(weaponchoice, "deagle", true, strlen(weaponchoice)) == 0)
  48. {
  49. if( PlayerInfo[playerid][pGuns][2] == 24 && PlayerInfo[playerid][pAGuns][2] == 0 )
  50. {
  51. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a Desert Eagle in your gun locker.");
  52. weapon = PlayerInfo[playerid][pGuns][2];
  53. ammo = PlayerInfo[playerid][pGunsAmmo][2];
  54. format(string,sizeof(string), "* %s deposited their Desert Eagle in their house safe.", CheckMask(playerid));
  55. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  56. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  57. }
  58. }
  59. else if(strcmp(weaponchoice, "shotgun", true, strlen(weaponchoice)) == 0)
  60. {
  61. if( PlayerInfo[playerid][pGuns][3] == 25 && PlayerInfo[playerid][pAGuns][3] == 0 )
  62. {
  63. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a shotgun in your gun locker.");
  64. weapon = PlayerInfo[playerid][pGuns][3];
  65. ammo = PlayerInfo[playerid][pGunsAmmo][3];
  66. format(string,sizeof(string), "* %s deposited their Shotgun in their house safe.", CheckMask(playerid));
  67. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  68. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  69. }
  70. }
  71. else if(strcmp(weaponchoice, "spas12", true, strlen(weaponchoice)) == 0)
  72. {
  73. if( PlayerInfo[playerid][pGuns][3] == 27 && PlayerInfo[playerid][pAGuns][3] == 0 )
  74. {
  75. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a combat shotgun in your gun locker.");
  76. weapon = PlayerInfo[playerid][pGuns][3];
  77. ammo = PlayerInfo[playerid][pGunsAmmo][3];
  78. format(string,sizeof(string), "* %s deposited their Combat Shotgun in their house safe.", CheckMask(playerid));
  79. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  80. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  81. }
  82. }
  83. else if(strcmp(weaponchoice, "mp5", true, strlen(weaponchoice)) == 0)
  84. {
  85. if( PlayerInfo[playerid][pGuns][4] == 29 && PlayerInfo[playerid][pAGuns][4] == 0 )
  86. {
  87. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an MP5 in your gun locker.");
  88. weapon = PlayerInfo[playerid][pGuns][4];
  89. ammo = PlayerInfo[playerid][pGunsAmmo][4];
  90. format(string,sizeof(string), "* %s deposited their MP5 in their house safe.", CheckMask(playerid));
  91. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  92. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  93. }
  94. }
  95. else if(strcmp(weaponchoice, "ak47", true, strlen(weaponchoice)) == 0)
  96. {
  97. if( PlayerInfo[playerid][pGuns][5] == 30 && PlayerInfo[playerid][pAGuns][5] == 0 )
  98. {
  99. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an AK-47 in your gun locker.");
  100. weapon = PlayerInfo[playerid][pGuns][5];
  101. ammo = PlayerInfo[playerid][pGunsAmmo][5];
  102. format(string,sizeof(string), "* %s deposited their AK-47 in their house safe.", CheckMask(playerid));
  103. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  104. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  105. }
  106. }
  107. else if(strcmp(weaponchoice, "m4", true, strlen(weaponchoice)) == 0)
  108. {
  109. if( PlayerInfo[playerid][pGuns][5] == 31 && PlayerInfo[playerid][pAGuns][5] == 0 )
  110. {
  111. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an M4 in your gun locker.");
  112. weapon = PlayerInfo[playerid][pGuns][5];
  113. ammo = PlayerInfo[playerid][pGunsAmmo][5];
  114. format(string,sizeof(string), "* %s deposited their M4 in their house safe.", CheckMask(playerid));
  115. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  116. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  117. }
  118. }
  119. else if(strcmp(weaponchoice, "rifle", true, strlen(weaponchoice)) == 0)
  120. {
  121. if( PlayerInfo[playerid][pGuns][6] == 33 && PlayerInfo[playerid][pAGuns][6] == 0 )
  122. {
  123. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a rifle in your gun locker.");
  124. weapon = PlayerInfo[playerid][pGuns][6];
  125. ammo = PlayerInfo[playerid][pGunsAmmo][6];
  126. format(string,sizeof(string), "* %s deposited their rifle in their house safe.", CheckMask(playerid));
  127. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  128. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  129. }
  130. }
  131. else if(strcmp(weaponchoice, "sniper", true, strlen(weaponchoice)) == 0)
  132. {
  133. if( PlayerInfo[playerid][pGuns][6] == 34 && PlayerInfo[playerid][pAGuns][6] == 0 )
  134. {
  135. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a sniper rifle in your gun locker.");
  136. weapon = PlayerInfo[playerid][pGuns][6];
  137. ammo = PlayerInfo[playerid][pGunsAmmo][6];
  138. format(string,sizeof(string), "* %s deposited their sniper rifle in their house safe.", CheckMask(playerid));
  139. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  140. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  141. }
  142. }
  143. else if(strcmp(weaponchoice, "uzi", true, strlen(weaponchoice)) == 0)
  144. {
  145. if( PlayerInfo[playerid][pGuns][4] == 28 && PlayerInfo[playerid][pAGuns][4] == 0 )
  146. {
  147. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited an uzi in your gun locker.");
  148. weapon = PlayerInfo[playerid][pGuns][4];
  149. ammo = PlayerInfo[playerid][pGunsAmmo][4];
  150. format(string,sizeof(string), "* %s deposited their uzi in their house safe.", CheckMask(playerid));
  151. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  152. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  153. }
  154. }
  155. else if(strcmp(weaponchoice, "tec9", true, strlen(weaponchoice)) == 0)
  156. {
  157. if( PlayerInfo[playerid][pGuns][4] == 32 && PlayerInfo[playerid][pAGuns][4] == 0 )
  158. {
  159. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have deposited a tec9 in your gun locker.");
  160. weapon = PlayerInfo[playerid][pGuns][4];
  161. ammo = PlayerInfo[playerid][pGunsAmmo][4];
  162. format(string,sizeof(string), "* %s deposited their tec9 in their house safe.", CheckMask(playerid));
  163. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  164. SetPVarInt(playerid, "GiveWeaponTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GIVEWEAPONTIMER);
  165. }
  166. }
  167. if(weapon == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have that weapon.");
  168. if(HouseInfo[i][hWeapons][slot-1] == 0)
  169. {
  170. HouseInfo[i][hWeapons][slot-1] = weapon;
  171. HouseInfo[i][hAmmo][slot-1] = ammo;
  172. RemovePlayerWeapon(playerid, weapon);
  173. SaveHouse(i);
  174. return 1;
  175. }
  176. else { SendClientMessageEx(playerid,COLOR_GREY," Invalid weapon name!"); return 1; }
  177. }
  178. }
  179. SendClientMessageEx(playerid, COLOR_GREY, "You're not in a house that you own.");
  180. }
  181. else return SendClientMessageEx(playerid, COLOR_GREY, "You don't own a house.");
  182. return 1;
  183. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement