SHOW:
|
|
- or go back to the newest paste.
| 1 | /* | |
| 2 | Credits - Y_Less | |
| 3 | ZeeX | |
| 4 | Danyal | |
| 5 | ||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| | |
| 7 | Weapon Shop By Danyal | |
| 8 | Please keep the credits to me | |
| 9 | Enjoy WEAPON-SHOP System! | |
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| | |
| 11 | ||
| 12 | ||
| 13 | -------------------------------------------------------------------------------- | |
| 14 | I Know You Will Change | |
| 15 | Please Do Not Remove Credits | |
| 16 | -------------------------------------------------------------------------------- | |
| 17 | */ | |
| 18 | ||
| 19 | #include <a_samp> | |
| 20 | #include <YSI\y_ini> | |
| 21 | #include <zcmd> | |
| 22 | #include <lreps> | |
| 23 | ||
| 24 | //Defines | |
| 25 | #define PATH "WeaponShop/%s.ini" | |
| 26 | #define WEAPONSHOP 789 | |
| 27 | #define COLOR_RED 0xAA3333AA | |
| 28 | #define COLOR_GREEN 0x33AA33FF | |
| 29 | ||
| 30 | //Player Weapon Info | |
| 31 | enum wInfo {
| |
| 32 | ||
| 33 | // Weapons | |
| 34 | Weapon1, | |
| 35 | Weapon2, | |
| 36 | Weapon3, | |
| 37 | Weapon4, | |
| 38 | Weapon5, | |
| 39 | Weapon6, | |
| 40 | Weapon7, | |
| 41 | Weapon8, | |
| 42 | Weapon9, | |
| 43 | Weapon10, | |
| 44 | Weapon11, | |
| 45 | Weapon12, | |
| 46 | ||
| 47 | //Ammo | |
| 48 | Ammo1, | |
| 49 | Ammo2, | |
| 50 | Ammo3, | |
| 51 | Ammo4, | |
| 52 | Ammo5, | |
| 53 | Ammo6, | |
| 54 | Ammo7, | |
| 55 | Ammo8, | |
| 56 | Ammo9, | |
| 57 | Ammo10, | |
| 58 | Ammo11, | |
| 59 | Ammo12, | |
| 60 | ||
| 61 | //Skills | |
| 62 | SKILL_PISTOL, | |
| 63 | SKILL_PISTOL_SILENCED, | |
| 64 | SKILL_DESERT_EAGLE, | |
| 65 | SKILL_SHOTGUN, | |
| 66 | SKILL_SAWNOFF_SHOTGUN, | |
| 67 | SKILL_SPAS12_SHOTGUN, | |
| 68 | SKILL_MICRO_UZI, | |
| 69 | SKILL_MP5, | |
| 70 | SKILL_AK47, | |
| 71 | SKILL_M4, | |
| 72 | SKILL_SNIPERRIFLE | |
| 73 | } | |
| 74 | new WeaponInfo[MAX_PLAYERS][wInfo]; | |
| 75 | ||
| 76 | public OnFilterScriptInit() | |
| 77 | {
| |
| 78 | print("\n--------------------------------------");
| |
| 79 | print(" WEAPONS-SHOP v3.0 Loaded by Danyal");
| |
| 80 | print("--------------------------------------\n");
| |
| 81 | return 1; | |
| 82 | } | |
| 83 | ||
| 84 | public OnFilterScriptExit() | |
| 85 | {
| |
| 86 | print("\n--------------------------------------");
| |
| 87 | print(" WEAPONS-SHOP v3.0 UnLoaded by Danyal");
| |
| 88 | print("--------------------------------------\n");
| |
| 89 | return 1; | |
| 90 | } | |
| 91 | public OnPlayerConnect(playerid) | |
| 92 | {
| |
| 93 | ||
| 94 | if(!fexist(pWeaponSave(playerid))) | |
| 95 | {
| |
| 96 | new INI:file = INI_Open(pWeaponSave(playerid)); | |
| 97 | // Weapon Create | |
| 98 | INI_WriteInt(file, "Weapon1", 0); | |
| 99 | INI_WriteInt(file, "Weapon2", 0); | |
| 100 | INI_WriteInt(file, "Weapon3", 0); | |
| 101 | INI_WriteInt(file, "Weapon4", 0); | |
| 102 | INI_WriteInt(file, "Weapon5", 0); | |
| 103 | INI_WriteInt(file, "Weapon6", 0); | |
| 104 | INI_WriteInt(file, "Weapon7", 0); | |
| 105 | INI_WriteInt(file, "Weapon8", 0); | |
| 106 | INI_WriteInt(file, "Weapon9", 0); | |
| 107 | INI_WriteInt(file, "Weapon10", 0); | |
| 108 | INI_WriteInt(file, "Weapon11", 0); | |
| 109 | INI_WriteInt(file, "Weapon12", 0); | |
| 110 | // Ammo Create | |
| 111 | INI_WriteInt(file, "Ammo1", 0); | |
| 112 | INI_WriteInt(file, "Ammo2", 0); | |
| 113 | INI_WriteInt(file, "Ammo3", 0); | |
| 114 | INI_WriteInt(file, "Ammo4", 0); | |
| 115 | INI_WriteInt(file, "Ammo5", 0); | |
| 116 | INI_WriteInt(file, "Ammo6", 0); | |
| 117 | INI_WriteInt(file, "Ammo7", 0); | |
| 118 | INI_WriteInt(file, "Ammo8", 0); | |
| 119 | INI_WriteInt(file, "Ammo9", 0); | |
| 120 | INI_WriteInt(file, "Ammo10", 0); | |
| 121 | INI_WriteInt(file, "Ammo11", 0); | |
| 122 | INI_WriteInt(file, "Ammo12", 0); | |
| 123 | //Weapon Skill | |
| 124 | INI_WriteInt(file, "SKILL_PISTOL", 1); | |
| 125 | INI_WriteInt(file, "SKILL_PISTOL_SILENCED", 1); | |
| 126 | INI_WriteInt(file, "SKILL_DESERT_EAGLE", 1); | |
| 127 | INI_WriteInt(file, "SKILL_SHOTGUN", 1); | |
| 128 | INI_WriteInt(file, "SKILL_SAWNOFF_SHOTGUN", 1); | |
| 129 | INI_WriteInt(file, "SKILL_SPAS12_SHOTGUN", 1); | |
| 130 | INI_WriteInt(file, "SKILL_MICRO_UZI", 1); | |
| 131 | INI_WriteInt(file, "SKILL_MP5", 1); | |
| 132 | INI_WriteInt(file, "SKILL_AK47", 1); | |
| 133 | INI_WriteInt(file, "SKILL_M4", 1); | |
| 134 | INI_WriteInt(file, "SKILL_SNIPERRIFLE", 1); | |
| 135 | INI_Close(file); | |
| 136 | INI_ParseFile(pWeaponSave(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); | |
| 137 | } | |
| 138 | else if(fexist(pWeaponSave(playerid))) | |
| 139 | {
| |
| 140 | INI_ParseFile(pWeaponSave(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); | |
| 141 | } | |
| 142 | return 1; | |
| 143 | } | |
| 144 | ||
| 145 | public OnPlayerSpawn(playerid) | |
| 146 | {
| |
| 147 | - | SetPlayerSkillLevel(playerid, SKILL_PISTOL, WeaponInfo[playerid][SKILL_PISTOL]); |
| 147 | + | |
| 148 | - | SetPlayerSkillLevel(playerid, SKILL_PISTOL_SILENCED, WeaponInfo[playerid][SKILL_PISTOL_SILENCED]); |
| 148 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, WeaponInfo[playerid][SKILL_PISTOL]); |
| 149 | - | SetPlayerSkillLevel(playerid, SKILL_DESERT_EAGLE, WeaponInfo[playerid][SKILL_DESERT_EAGLE]); |
| 149 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, WeaponInfo[playerid][SKILL_PISTOL_SILENCED]); |
| 150 | - | SetPlayerSkillLevel(playerid, SKILL_SHOTGUN, WeaponInfo[playerid][SKILL_SHOTGUN]); |
| 150 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, WeaponInfo[playerid][SKILL_DESERT_EAGLE]); |
| 151 | - | SetPlayerSkillLevel(playerid, SKILL_SAWNOFF_SHOTGUN, WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]); |
| 151 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, WeaponInfo[playerid][SKILL_SHOTGUN]); |
| 152 | - | SetPlayerSkillLevel(playerid, SKILL_SPAS12_SHOTGUN, WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]); |
| 152 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]); |
| 153 | - | SetPlayerSkillLevel(playerid, SKILL_MICRO_UZI, WeaponInfo[playerid][SKILL_MICRO_UZI]); |
| 153 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]); |
| 154 | - | SetPlayerSkillLevel(playerid, SKILL_MP5, WeaponInfo[playerid][SKILL_MP5]); |
| 154 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, WeaponInfo[playerid][SKILL_MICRO_UZI]); |
| 155 | - | SetPlayerSkillLevel(playerid, SKILL_AK47, WeaponInfo[playerid][SKILL_AK47]); |
| 155 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, WeaponInfo[playerid][SKILL_MP5]); |
| 156 | - | SetPlayerSkillLevel(playerid, SKILL_M4, WeaponInfo[playerid][SKILL_M4]); |
| 156 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, WeaponInfo[playerid][SKILL_AK47]); |
| 157 | - | SetPlayerSkillLevel(playerid, SKILL_SNIPERRIFLE, WeaponInfo[playerid][SKILL_SNIPERRIFLE]); |
| 157 | + | SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, WeaponInfo[playerid][SKILL_M4]); |
| 158 | SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, WeaponInfo[playerid][SKILL_SNIPERRIFLE]); | |
| 159 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Ammo1]); | |
| 160 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Ammo2]); | |
| 161 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Ammo3]); | |
| 162 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Ammo4]); | |
| 163 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Ammo5]); | |
| 164 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Ammo6]); | |
| 165 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Ammo7]); | |
| 166 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Ammo8]); | |
| 167 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Ammo9]); | |
| 168 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Ammo10]); | |
| 169 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Ammo11]); | |
| 170 | GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Ammo12]); | |
| 171 | return 1; | |
| 172 | } | |
| 173 | ||
| 174 | public OnPlayerDeath(playerid, killerid, reason) | |
| 175 | {
| |
| 176 | new Weapon = GetPlayerWeapon(killerid); | |
| 177 | switch(Weapon) | |
| 178 | {
| |
| 179 | case 22: WeaponInfo[killerid][SKILL_PISTOL]++; | |
| 180 | case 23: WeaponInfo[killerid][SKILL_PISTOL_SILENCED]++; | |
| 181 | case 24: WeaponInfo[killerid][SKILL_DESERT_EAGLE]++; | |
| 182 | case 25: WeaponInfo[killerid][SKILL_SHOTGUN]++; | |
| 183 | case 26: WeaponInfo[killerid][SKILL_SAWNOFF_SHOTGUN]++; | |
| 184 | case 27: WeaponInfo[killerid][SKILL_SPAS12_SHOTGUN]++; | |
| 185 | case 28: WeaponInfo[killerid][SKILL_MICRO_UZI]++; | |
| 186 | case 29: WeaponInfo[killerid][SKILL_MP5]++; | |
| 187 | case 30: WeaponInfo[killerid][SKILL_AK47]++; | |
| 188 | case 31: WeaponInfo[killerid][SKILL_M4]++; | |
| 189 | case 34: WeaponInfo[killerid][SKILL_SNIPERRIFLE]++; | |
| 190 | } | |
| 191 | return 1; | |
| 192 | } | |
| 193 | ||
| 194 | public OnPlayerDisconnect(playerid, reason) | |
| 195 | {
| |
| 196 | GetPlayerWeaponData(playerid, 1, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Ammo1]); | |
| 197 | GetPlayerWeaponData(playerid, 2, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Ammo2]); | |
| 198 | GetPlayerWeaponData(playerid, 3, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Ammo3]); | |
| 199 | GetPlayerWeaponData(playerid, 4, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Ammo4]); | |
| 200 | GetPlayerWeaponData(playerid, 5, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Ammo5]); | |
| 201 | GetPlayerWeaponData(playerid, 6, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Ammo6]); | |
| 202 | GetPlayerWeaponData(playerid, 7, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Ammo7]); | |
| 203 | GetPlayerWeaponData(playerid, 8, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Ammo8]); | |
| 204 | GetPlayerWeaponData(playerid, 9, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Ammo9]); | |
| 205 | GetPlayerWeaponData(playerid, 10, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Ammo10]); | |
| 206 | GetPlayerWeaponData(playerid, 11, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Ammo11]); | |
| 207 | GetPlayerWeaponData(playerid, 12, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Ammo12]); | |
| 208 | ||
| 209 | if(fexist(pWeaponSave(playerid))) | |
| 210 | {
| |
| 211 | new INI:file = INI_Open(pWeaponSave(playerid)); | |
| 212 | // Weapon Save | |
| 213 | INI_WriteInt(file, "Weapon1", WeaponInfo[playerid][Weapon1]); | |
| 214 | INI_WriteInt(file, "Weapon2", WeaponInfo[playerid][Weapon2]); | |
| 215 | INI_WriteInt(file, "Weapon3", WeaponInfo[playerid][Weapon3]); | |
| 216 | INI_WriteInt(file, "Weapon4", WeaponInfo[playerid][Weapon4]); | |
| 217 | INI_WriteInt(file, "Weapon5", WeaponInfo[playerid][Weapon5]); | |
| 218 | INI_WriteInt(file, "Weapon6", WeaponInfo[playerid][Weapon6]); | |
| 219 | INI_WriteInt(file, "Weapon7", WeaponInfo[playerid][Weapon7]); | |
| 220 | INI_WriteInt(file, "Weapon8", WeaponInfo[playerid][Weapon8]); | |
| 221 | INI_WriteInt(file, "Weapon9", WeaponInfo[playerid][Weapon9]); | |
| 222 | INI_WriteInt(file, "Weapon10", WeaponInfo[playerid][Weapon10]); | |
| 223 | INI_WriteInt(file, "Weapon11", WeaponInfo[playerid][Weapon11]); | |
| 224 | INI_WriteInt(file, "Weapon12", WeaponInfo[playerid][Weapon12]); | |
| 225 | // Ammo Save | |
| 226 | INI_WriteInt(file, "Ammo1", WeaponInfo[playerid][Ammo1]); | |
| 227 | INI_WriteInt(file, "Ammo2", WeaponInfo[playerid][Ammo2]); | |
| 228 | INI_WriteInt(file, "Ammo3", WeaponInfo[playerid][Ammo3]); | |
| 229 | INI_WriteInt(file, "Ammo4", WeaponInfo[playerid][Ammo4]); | |
| 230 | INI_WriteInt(file, "Ammo5", WeaponInfo[playerid][Ammo5]); | |
| 231 | INI_WriteInt(file, "Ammo6", WeaponInfo[playerid][Ammo6]); | |
| 232 | INI_WriteInt(file, "Ammo7", WeaponInfo[playerid][Ammo7]); | |
| 233 | INI_WriteInt(file, "Ammo8", WeaponInfo[playerid][Ammo8]); | |
| 234 | INI_WriteInt(file, "Ammo9", WeaponInfo[playerid][Ammo9]); | |
| 235 | INI_WriteInt(file, "Ammo10", WeaponInfo[playerid][Ammo10]); | |
| 236 | INI_WriteInt(file, "Ammo11", WeaponInfo[playerid][Ammo11]); | |
| 237 | INI_WriteInt(file, "Ammo12", WeaponInfo[playerid][Ammo12]); | |
| 238 | // Skill Save | |
| 239 | INI_WriteInt(file, "SKILL_PISTOL", WeaponInfo[playerid][SKILL_PISTOL]); | |
| 240 | INI_WriteInt(file, "SKILL_PISTOL_SILENCED", WeaponInfo[playerid][SKILL_PISTOL_SILENCED]); | |
| 241 | INI_WriteInt(file, "SKILL_DESERT_EAGLE", WeaponInfo[playerid][SKILL_DESERT_EAGLE]); | |
| 242 | INI_WriteInt(file, "SKILL_SHOTGUN", WeaponInfo[playerid][SKILL_SHOTGUN]); | |
| 243 | INI_WriteInt(file, "SKILL_SAWNOFF_SHOTGUN", WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]); | |
| 244 | INI_WriteInt(file, "SKILL_SPAS12_SHOTGUN", WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]); | |
| 245 | INI_WriteInt(file, "SKILL_MICRO_UZI", WeaponInfo[playerid][SKILL_MICRO_UZI]); | |
| 246 | INI_WriteInt(file, "SKILL_MP5", WeaponInfo[playerid][SKILL_MP5]); | |
| 247 | INI_WriteInt(file, "SKILL_AK47", WeaponInfo[playerid][SKILL_AK47]); | |
| 248 | INI_WriteInt(file, "SKILL_M4", WeaponInfo[playerid][SKILL_M4]); | |
| 249 | INI_WriteInt(file, "SKILL_SNIPERRIFLE", WeaponInfo[playerid][SKILL_SNIPERRIFLE]); | |
| 250 | ||
| 251 | INI_Close(file); | |
| 252 | } | |
| 253 | return 1; | |
| 254 | } | |
| 255 | ||
| 256 | CMD:shopweaps(playerid, params[]) | |
| 257 | {
| |
| 258 | if(IsPlayerConnected(playerid)) | |
| 259 | {
| |
| 260 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{9FE4AA}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 261 | } | |
| 262 | return 1; | |
| 263 | } | |
| 264 | ||
| 265 | CMD:showskills(playerid, params[]) | |
| 266 | {
| |
| 267 | if(IsPlayerConnected(playerid)) | |
| 268 | {
| |
| 269 | new showskillz[476]; | |
| 270 | new pName[MAX_PLAYER_NAME]; | |
| 271 | GetPlayerName(playerid, pName, sizeof(pName)); | |
| 272 | format (showskillz, sizeof(showskillz), "{FFFFFF}Player {FF0000}%s{FFFFFF} Stats \n",pName );
| |
| 273 | format (showskillz, sizeof(showskillz), "{FFFFFF}Pistol:{FF0000}%i , {FFFFFF}Silenced Pistol:{FF0000}%i , {FFFFFF}Desert:{FF0000}%i \n", WeaponInfo[playerid][SKILL_PISTOL] , WeaponInfo[playerid][SKILL_PISTOL_SILENCED], WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
| |
| 274 | format (showskillz, sizeof(showskillz), "{FFFFFF}Shotgun:{FF0000}%i , {FFFFFF}SawnOff ShotGun:{FF0000}%i , {FFFFFF}Spas12 Shotgun:{FF0000}%i \n", WeaponInfo[playerid][SKILL_SHOTGUN], WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN], WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
| |
| 275 | format (showskillz, sizeof(showskillz), "{FFFFFF}Uzi:{FF0000}%i , {FFFFFF}MP5:{FF0000}%i , {FFFFFF}AK47:{FF0000}%i \n", WeaponInfo[playerid][SKILL_MICRO_UZI], WeaponInfo[playerid][SKILL_MP5], WeaponInfo[playerid][SKILL_AK47]);
| |
| 276 | format (showskillz, sizeof(showskillz), "{FFFFFF}M4:{FF0000}%i , {FFFFFF}Sniper Rifle:{FF0000}%i.",WeaponInfo[playerid][SKILL_M4], WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
| |
| 277 | SendClientMessage(playerid, -1, showskillz); | |
| 278 | } | |
| 279 | return 1; | |
| 280 | } | |
| 281 | ||
| 282 | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
| 283 | {
| |
| 284 | switch(dialogid) | |
| 285 | {
| |
| 286 | case WEAPONSHOP: | |
| 287 | {
| |
| 288 | if(response) | |
| 289 | {
| |
| 290 | switch(listitem) | |
| 291 | {
| |
| 292 | case 0: ShowPlayerDialog(playerid, WEAPONSHOP+1, DIALOG_STYLE_LIST, "Pistols", "9mm\t\t\t$200\nSilenced 9mm\t\t$600\nDesert Eagle\t\t$1200", "Select", "Cancel"); | |
| 293 | case 1: ShowPlayerDialog(playerid, WEAPONSHOP+2, DIALOG_STYLE_LIST, "Sub-Machine Gun", "Tec9\t\t\t$300\nMicro SMG\t\t$500", "Select", "Cancel"); | |
| 294 | case 2: ShowPlayerDialog(playerid, WEAPONSHOP+3, DIALOG_STYLE_LIST, "Shotguns", "Shotgun\t\t\t$600\nSawnoff Shotgun\t\t$800\nCombat Shotgun\t\t$1000", "Select", "Cancel"); | |
| 295 | case 3: ShowPlayerDialog(playerid, WEAPONSHOP+4, DIALOG_STYLE_LIST, "Armours", "Armour\t\t\t$200", "Select", "Cancel"); | |
| 296 | case 4: ShowPlayerDialog(playerid, WEAPONSHOP+5, DIALOG_STYLE_LIST, "SMG", "MP5\t\t\t$2000", "Select", "Cancel"); | |
| 297 | case 5: ShowPlayerDialog(playerid, WEAPONSHOP+6, DIALOG_STYLE_LIST, "Assault", "AK47\t\t$3500\nM4\t\t$4500", "Select", "Cancel"); | |
| 298 | } | |
| 299 | return 1; | |
| 300 | } | |
| 301 | return 1; | |
| 302 | } | |
| 303 | ||
| 304 | case WEAPONSHOP+1: | |
| 305 | {
| |
| 306 | if(response) | |
| 307 | {
| |
| 308 | switch(listitem) | |
| 309 | {
| |
| 310 | case 0: | |
| 311 | {
| |
| 312 | if(GetPlayerMoney(playerid) <200) | |
| 313 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 314 | GivePlayerMoney(playerid, -200); | |
| 315 | GivePlayerWeapon(playerid,22,30); | |
| 316 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a 9mm! ($200)"); | |
| 317 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 318 | } | |
| 319 | ||
| 320 | case 1: | |
| 321 | {
| |
| 322 | if(GetPlayerMoney(playerid) <600) | |
| 323 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 324 | GivePlayerMoney(playerid, -600); | |
| 325 | GivePlayerWeapon(playerid,23,30); | |
| 326 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Silenced 9mm! ($600)"); | |
| 327 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 328 | } | |
| 329 | ||
| 330 | case 2: | |
| 331 | {
| |
| 332 | if(GetPlayerMoney(playerid) <1200) | |
| 333 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 334 | GivePlayerMoney(playerid, -1200); | |
| 335 | GivePlayerWeapon(playerid,24,30); | |
| 336 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Desert Eagle! ($1200)"); | |
| 337 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 338 | } | |
| 339 | } | |
| 340 | return 1; | |
| 341 | } | |
| 342 | return 1; | |
| 343 | } | |
| 344 | ||
| 345 | case WEAPONSHOP+2: | |
| 346 | {
| |
| 347 | if(response) | |
| 348 | {
| |
| 349 | switch(listitem) | |
| 350 | {
| |
| 351 | case 0: | |
| 352 | {
| |
| 353 | if(GetPlayerMoney(playerid) <300) | |
| 354 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 355 | GivePlayerMoney(playerid, -300); | |
| 356 | GivePlayerWeapon(playerid,32,30); | |
| 357 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Tec9! ($300)"); | |
| 358 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 359 | } | |
| 360 | ||
| 361 | case 1: | |
| 362 | {
| |
| 363 | if(GetPlayerMoney(playerid) <500) | |
| 364 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 365 | GivePlayerMoney(playerid, -500); | |
| 366 | GivePlayerWeapon(playerid,28,30); | |
| 367 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Micro SMG! ($500)"); | |
| 368 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 369 | } | |
| 370 | } | |
| 371 | return 1; | |
| 372 | } | |
| 373 | return 1; | |
| 374 | } | |
| 375 | ||
| 376 | case WEAPONSHOP+3: | |
| 377 | {
| |
| 378 | if(response) | |
| 379 | {
| |
| 380 | switch(listitem) | |
| 381 | {
| |
| 382 | case 0: | |
| 383 | {
| |
| 384 | if(GetPlayerMoney(playerid) <600) | |
| 385 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 386 | GivePlayerMoney(playerid, -600); | |
| 387 | GivePlayerWeapon(playerid,25,15); | |
| 388 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Shotgun! ($600)"); | |
| 389 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 390 | } | |
| 391 | ||
| 392 | case 1: | |
| 393 | {
| |
| 394 | if(GetPlayerMoney(playerid) <800) | |
| 395 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 396 | GivePlayerMoney(playerid, -800); | |
| 397 | GivePlayerWeapon(playerid,26,15); | |
| 398 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Sawnoff Shotgun (800$)"); | |
| 399 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 400 | } | |
| 401 | ||
| 402 | case 2: | |
| 403 | {
| |
| 404 | if(GetPlayerMoney(playerid) <1000) | |
| 405 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 406 | GivePlayerMoney(playerid, -1000); | |
| 407 | GivePlayerWeapon(playerid,27,15); | |
| 408 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Combat Shotgun (1000$)"); | |
| 409 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 410 | } | |
| 411 | } | |
| 412 | return 1; | |
| 413 | } | |
| 414 | return 1; | |
| 415 | } | |
| 416 | ||
| 417 | case WEAPONSHOP+4: | |
| 418 | {
| |
| 419 | if(response) | |
| 420 | {
| |
| 421 | switch(listitem) | |
| 422 | {
| |
| 423 | case 0: | |
| 424 | {
| |
| 425 | if(GetPlayerMoney(playerid) <200) | |
| 426 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 427 | GivePlayerMoney(playerid, -200); | |
| 428 | SetPlayerArmour(playerid, 100); | |
| 429 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Armour! ($200)"); | |
| 430 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 431 | } | |
| 432 | } | |
| 433 | return 1; | |
| 434 | } | |
| 435 | return 1; | |
| 436 | } | |
| 437 | ||
| 438 | case WEAPONSHOP+5: | |
| 439 | {
| |
| 440 | if(response) | |
| 441 | {
| |
| 442 | switch(listitem) | |
| 443 | {
| |
| 444 | case 0: | |
| 445 | {
| |
| 446 | if(GetPlayerMoney(playerid) <2000) | |
| 447 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 448 | GivePlayerMoney(playerid, -2000); | |
| 449 | GivePlayerWeapon(playerid,29,30); | |
| 450 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a MP5 (2000$)"); | |
| 451 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 452 | } | |
| 453 | } | |
| 454 | return 1; | |
| 455 | } | |
| 456 | return 1; | |
| 457 | } | |
| 458 | ||
| 459 | case WEAPONSHOP+6: | |
| 460 | {
| |
| 461 | if(response) | |
| 462 | {
| |
| 463 | switch(listitem) | |
| 464 | {
| |
| 465 | case 0: | |
| 466 | {
| |
| 467 | if(GetPlayerMoney(playerid) <3500) | |
| 468 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 469 | GivePlayerMoney(playerid, -3500); | |
| 470 | GivePlayerWeapon(playerid,30,120); | |
| 471 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a AK47 (3500$)"); | |
| 472 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 473 | } | |
| 474 | ||
| 475 | case 1: | |
| 476 | {
| |
| 477 | if(GetPlayerMoney(playerid) <4500) | |
| 478 | return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!"); | |
| 479 | GivePlayerMoney(playerid, -4500); | |
| 480 | GivePlayerWeapon(playerid,31,120); | |
| 481 | SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a M4 (4500$)"); | |
| 482 | ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
| |
| 483 | } | |
| 484 | } | |
| 485 | return 1; | |
| 486 | } | |
| 487 | return 1; | |
| 488 | } | |
| 489 | } | |
| 490 | return 1; | |
| 491 | } | |
| 492 | ||
| 493 | //Loaduser Public | |
| 494 | forward LoadUser_data(playerid, name[], value[]); | |
| 495 | public LoadUser_data(playerid, name[], value[]) | |
| 496 | {
| |
| 497 | // Load Weapons | |
| 498 | INI_Int("Weapon1", WeaponInfo[playerid][Weapon1]);
| |
| 499 | INI_Int("Weapon2", WeaponInfo[playerid][Weapon2]);
| |
| 500 | INI_Int("Weapon3", WeaponInfo[playerid][Weapon3]);
| |
| 501 | INI_Int("Weapon4", WeaponInfo[playerid][Weapon4]);
| |
| 502 | INI_Int("Weapon5", WeaponInfo[playerid][Weapon5]);
| |
| 503 | INI_Int("Weapon6", WeaponInfo[playerid][Weapon6]);
| |
| 504 | INI_Int("Weapon7", WeaponInfo[playerid][Weapon7]);
| |
| 505 | INI_Int("Weapon8", WeaponInfo[playerid][Weapon8]);
| |
| 506 | INI_Int("Weapon9", WeaponInfo[playerid][Weapon9]);
| |
| 507 | INI_Int("Weapon10", WeaponInfo[playerid][Weapon10]);
| |
| 508 | INI_Int("Weapon11", WeaponInfo[playerid][Weapon11]);
| |
| 509 | INI_Int("Weapon12", WeaponInfo[playerid][Weapon12]);
| |
| 510 | ||
| 511 | // Load Ammo | |
| 512 | INI_Int("Ammo1", WeaponInfo[playerid][Ammo1]);
| |
| 513 | INI_Int("Ammo2", WeaponInfo[playerid][Ammo2]);
| |
| 514 | INI_Int("Ammo3", WeaponInfo[playerid][Ammo3]);
| |
| 515 | INI_Int("Ammo4", WeaponInfo[playerid][Ammo4]);
| |
| 516 | INI_Int("Ammo5", WeaponInfo[playerid][Ammo5]);
| |
| 517 | INI_Int("Ammo6", WeaponInfo[playerid][Ammo6]);
| |
| 518 | INI_Int("Ammo7", WeaponInfo[playerid][Ammo7]);
| |
| 519 | INI_Int("Ammo8", WeaponInfo[playerid][Ammo8]);
| |
| 520 | INI_Int("Ammo9", WeaponInfo[playerid][Ammo9]);
| |
| 521 | INI_Int("Ammo10", WeaponInfo[playerid][Ammo10]);
| |
| 522 | INI_Int("Ammo11", WeaponInfo[playerid][Ammo11]);
| |
| 523 | INI_Int("Ammo12", WeaponInfo[playerid][Ammo12]);
| |
| 524 | ||
| 525 | // Load Skills | |
| 526 | INI_Int("SKILL_PISTOL", WeaponInfo[playerid][SKILL_PISTOL]);
| |
| 527 | INI_Int("SKILL_PISTOL_SILENCED", WeaponInfo[playerid][SKILL_PISTOL_SILENCED]);
| |
| 528 | INI_Int("SKILL_DESERT_EAGLE", WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
| |
| 529 | INI_Int("SKILL_SHOTGUN", WeaponInfo[playerid][SKILL_SHOTGUN]);
| |
| 530 | INI_Int("SKILL_SAWNOFF_SHOTGUN", WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
| |
| 531 | INI_Int("SKILL_SPAS12_SHOTGUN", WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
| |
| 532 | INI_Int("SKILL_MICRO_UZI", WeaponInfo[playerid][SKILL_MICRO_UZI]);
| |
| 533 | INI_Int("SKILL_MP5", WeaponInfo[playerid][SKILL_MP5]);
| |
| 534 | INI_Int("SKILL_AK47", WeaponInfo[playerid][SKILL_AK47]);
| |
| 535 | INI_Int("SKILL_M4", WeaponInfo[playerid][SKILL_M4]);
| |
| 536 | INI_Int("SKILL_SNIPERRIFLE", WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
| |
| 537 | ||
| 538 | // | |
| 539 | return 1; | |
| 540 | } | |
| 541 | ||
| 542 | //Stocks | |
| 543 | stock pWeaponSave(playerid) | |
| 544 | {
| |
| 545 | new string[50]; | |
| 546 | format(string, sizeof(string), PATH, GetName(playerid)); | |
| 547 | return string; | |
| 548 | } | |
| 549 | ||
| 550 | stock GetName(playerid) | |
| 551 | {
| |
| 552 | new name[24]; | |
| 553 | GetPlayerName(playerid, name, sizeof(name)); | |
| 554 | return name; | |
| 555 | } | |
| 556 | ||
| 557 | //------------------------------------------------------------------------------ | |
| 558 | //============================I Know You Will Change============================ | |
| 559 | //=========================Please Do Not Remove Credits========================= | |
| 560 | //------------------------------------------------------------------------------ |