Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Credits - Y_Less
- ZeeX
- Danyal
- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Weapon Shop By Danyal
- Please keep the credits to me
- Enjoy WEAPON-SHOP System!
- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- --------------------------------------------------------------------------------
- I Know You Will Change
- Please Do Not Remove Credits
- --------------------------------------------------------------------------------
- */
- #include <a_samp>
- #include <YSI\y_ini>
- #include <zcmd>
- //Defines
- #define PATH "WeaponShop/%s.ini"
- #define WEAPONSHOP 789
- #define COLOR_RED 0xAA3333AA
- #define COLOR_GREEN 0x33AA33FF
- //Player Weapon Info
- enum wInfo {
- // Weapons
- Weapon1,
- Weapon2,
- Weapon3,
- Weapon4,
- Weapon5,
- Weapon6,
- Weapon7,
- Weapon8,
- Weapon9,
- Weapon10,
- Weapon11,
- Weapon12,
- //Ammo
- Ammo1,
- Ammo2,
- Ammo3,
- Ammo4,
- Ammo5,
- Ammo6,
- Ammo7,
- Ammo8,
- Ammo9,
- Ammo10,
- Ammo11,
- Ammo12,
- //Skills
- SKILL_PISTOL,
- SKILL_PISTOL_SILENCED,
- SKILL_DESERT_EAGLE,
- SKILL_SHOTGUN,
- SKILL_SAWNOFF_SHOTGUN,
- SKILL_SPAS12_SHOTGUN,
- SKILL_MICRO_UZI,
- SKILL_MP5,
- SKILL_AK47,
- SKILL_M4,
- SKILL_SNIPERRIFLE
- }
- new WeaponInfo[MAX_PLAYERS][wInfo];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" WEAPONS-SHOP v3.0 Loaded by Danyal");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" WEAPONS-SHOP v3.0 UnLoaded by Danyal");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(!fexist(pWeaponSave(playerid)))
- {
- new INI:file = INI_Open(pWeaponSave(playerid));
- // Weapon Create
- INI_WriteInt(file, "Weapon1", 0);
- INI_WriteInt(file, "Weapon2", 0);
- INI_WriteInt(file, "Weapon3", 0);
- INI_WriteInt(file, "Weapon4", 0);
- INI_WriteInt(file, "Weapon5", 0);
- INI_WriteInt(file, "Weapon6", 0);
- INI_WriteInt(file, "Weapon7", 0);
- INI_WriteInt(file, "Weapon8", 0);
- INI_WriteInt(file, "Weapon9", 0);
- INI_WriteInt(file, "Weapon10", 0);
- INI_WriteInt(file, "Weapon11", 0);
- INI_WriteInt(file, "Weapon12", 0);
- // Ammo Create
- INI_WriteInt(file, "Ammo1", 0);
- INI_WriteInt(file, "Ammo2", 0);
- INI_WriteInt(file, "Ammo3", 0);
- INI_WriteInt(file, "Ammo4", 0);
- INI_WriteInt(file, "Ammo5", 0);
- INI_WriteInt(file, "Ammo6", 0);
- INI_WriteInt(file, "Ammo7", 0);
- INI_WriteInt(file, "Ammo8", 0);
- INI_WriteInt(file, "Ammo9", 0);
- INI_WriteInt(file, "Ammo10", 0);
- INI_WriteInt(file, "Ammo11", 0);
- INI_WriteInt(file, "Ammo12", 0);
- //Weapon Skill
- INI_WriteInt(file, "SKILL_PISTOL", 1);
- INI_WriteInt(file, "SKILL_PISTOL_SILENCED", 1);
- INI_WriteInt(file, "SKILL_DESERT_EAGLE", 1);
- INI_WriteInt(file, "SKILL_SHOTGUN", 1);
- INI_WriteInt(file, "SKILL_SAWNOFF_SHOTGUN", 1);
- INI_WriteInt(file, "SKILL_SPAS12_SHOTGUN", 1);
- INI_WriteInt(file, "SKILL_MICRO_UZI", 1);
- INI_WriteInt(file, "SKILL_MP5", 1);
- INI_WriteInt(file, "SKILL_AK47", 1);
- INI_WriteInt(file, "SKILL_M4", 1);
- INI_WriteInt(file, "SKILL_SNIPERRIFLE", 1);
- INI_Close(file);
- INI_ParseFile(pWeaponSave(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- }
- else if(fexist(pWeaponSave(playerid)))
- {
- INI_ParseFile(pWeaponSave(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SendClientMessage(playerid, -1, "This Server Uses Weapon Shop V3.0 By Danyal");
- SetPlayerSkillLevel(playerid, SKILL_PISTOL, WeaponInfo[playerid][SKILL_PISTOL]);
- SetPlayerSkillLevel(playerid, SKILL_PISTOL_SILENCED, WeaponInfo[playerid][SKILL_PISTOL_SILENCED]);
- SetPlayerSkillLevel(playerid, SKILL_DESERT_EAGLE, WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
- SetPlayerSkillLevel(playerid, SKILL_SHOTGUN, WeaponInfo[playerid][SKILL_SHOTGUN]);
- SetPlayerSkillLevel(playerid, SKILL_SAWNOFF_SHOTGUN, WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
- SetPlayerSkillLevel(playerid, SKILL_SPAS12_SHOTGUN, WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
- SetPlayerSkillLevel(playerid, SKILL_MICRO_UZI, WeaponInfo[playerid][SKILL_MICRO_UZI]);
- SetPlayerSkillLevel(playerid, SKILL_MP5, WeaponInfo[playerid][SKILL_MP5]);
- SetPlayerSkillLevel(playerid, SKILL_AK47, WeaponInfo[playerid][SKILL_AK47]);
- SetPlayerSkillLevel(playerid, SKILL_M4, WeaponInfo[playerid][SKILL_M4]);
- SetPlayerSkillLevel(playerid, SKILL_SNIPERRIFLE, WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Ammo1]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Ammo2]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Ammo3]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Ammo4]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Ammo5]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Ammo6]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Ammo7]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Ammo8]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Ammo9]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Ammo10]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Ammo11]);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Ammo12]);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new Weapon = GetPlayerWeapon(killerid);
- switch(Weapon)
- {
- case 22: WeaponInfo[killerid][SKILL_PISTOL]++;
- case 23: WeaponInfo[killerid][SKILL_PISTOL_SILENCED]++;
- case 24: WeaponInfo[killerid][SKILL_DESERT_EAGLE]++;
- case 25: WeaponInfo[killerid][SKILL_SHOTGUN]++;
- case 26: WeaponInfo[killerid][SKILL_SAWNOFF_SHOTGUN]++;
- case 27: WeaponInfo[killerid][SKILL_SPAS12_SHOTGUN]++;
- case 28: WeaponInfo[killerid][SKILL_MICRO_UZI]++;
- case 29: WeaponInfo[killerid][SKILL_MP5]++;
- case 30: WeaponInfo[killerid][SKILL_AK47]++;
- case 31: WeaponInfo[killerid][SKILL_M4]++;
- case 34: WeaponInfo[killerid][SKILL_SNIPERRIFLE]++;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- GetPlayerWeaponData(playerid, 1, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Ammo1]);
- GetPlayerWeaponData(playerid, 2, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Ammo2]);
- GetPlayerWeaponData(playerid, 3, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Ammo3]);
- GetPlayerWeaponData(playerid, 4, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Ammo4]);
- GetPlayerWeaponData(playerid, 5, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Ammo5]);
- GetPlayerWeaponData(playerid, 6, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Ammo6]);
- GetPlayerWeaponData(playerid, 7, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Ammo7]);
- GetPlayerWeaponData(playerid, 8, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Ammo8]);
- GetPlayerWeaponData(playerid, 9, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Ammo9]);
- GetPlayerWeaponData(playerid, 10, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Ammo10]);
- GetPlayerWeaponData(playerid, 11, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Ammo11]);
- GetPlayerWeaponData(playerid, 12, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Ammo12]);
- if(fexist(pWeaponSave(playerid)))
- {
- new INI:file = INI_Open(pWeaponSave(playerid));
- // Weapon Save
- INI_WriteInt(file, "Weapon1", WeaponInfo[playerid][Weapon1]);
- INI_WriteInt(file, "Weapon2", WeaponInfo[playerid][Weapon2]);
- INI_WriteInt(file, "Weapon3", WeaponInfo[playerid][Weapon3]);
- INI_WriteInt(file, "Weapon4", WeaponInfo[playerid][Weapon4]);
- INI_WriteInt(file, "Weapon5", WeaponInfo[playerid][Weapon5]);
- INI_WriteInt(file, "Weapon6", WeaponInfo[playerid][Weapon6]);
- INI_WriteInt(file, "Weapon7", WeaponInfo[playerid][Weapon7]);
- INI_WriteInt(file, "Weapon8", WeaponInfo[playerid][Weapon8]);
- INI_WriteInt(file, "Weapon9", WeaponInfo[playerid][Weapon9]);
- INI_WriteInt(file, "Weapon10", WeaponInfo[playerid][Weapon10]);
- INI_WriteInt(file, "Weapon11", WeaponInfo[playerid][Weapon11]);
- INI_WriteInt(file, "Weapon12", WeaponInfo[playerid][Weapon12]);
- // Ammo Save
- INI_WriteInt(file, "Ammo1", WeaponInfo[playerid][Ammo1]);
- INI_WriteInt(file, "Ammo2", WeaponInfo[playerid][Ammo2]);
- INI_WriteInt(file, "Ammo3", WeaponInfo[playerid][Ammo3]);
- INI_WriteInt(file, "Ammo4", WeaponInfo[playerid][Ammo4]);
- INI_WriteInt(file, "Ammo5", WeaponInfo[playerid][Ammo5]);
- INI_WriteInt(file, "Ammo6", WeaponInfo[playerid][Ammo6]);
- INI_WriteInt(file, "Ammo7", WeaponInfo[playerid][Ammo7]);
- INI_WriteInt(file, "Ammo8", WeaponInfo[playerid][Ammo8]);
- INI_WriteInt(file, "Ammo9", WeaponInfo[playerid][Ammo9]);
- INI_WriteInt(file, "Ammo10", WeaponInfo[playerid][Ammo10]);
- INI_WriteInt(file, "Ammo11", WeaponInfo[playerid][Ammo11]);
- INI_WriteInt(file, "Ammo12", WeaponInfo[playerid][Ammo12]);
- // Skill Save
- INI_WriteInt(file, "SKILL_PISTOL", WeaponInfo[playerid][SKILL_PISTOL]);
- INI_WriteInt(file, "SKILL_PISTOL_SILENCED", WeaponInfo[playerid][SKILL_PISTOL_SILENCED]);
- INI_WriteInt(file, "SKILL_DESERT_EAGLE", WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
- INI_WriteInt(file, "SKILL_SHOTGUN", WeaponInfo[playerid][SKILL_SHOTGUN]);
- INI_WriteInt(file, "SKILL_SAWNOFF_SHOTGUN", WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
- INI_WriteInt(file, "SKILL_SPAS12_SHOTGUN", WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
- INI_WriteInt(file, "SKILL_MICRO_UZI", WeaponInfo[playerid][SKILL_MICRO_UZI]);
- INI_WriteInt(file, "SKILL_MP5", WeaponInfo[playerid][SKILL_MP5]);
- INI_WriteInt(file, "SKILL_AK47", WeaponInfo[playerid][SKILL_AK47]);
- INI_WriteInt(file, "SKILL_M4", WeaponInfo[playerid][SKILL_M4]);
- INI_WriteInt(file, "SKILL_SNIPERRIFLE", WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
- INI_Close(file);
- }
- return 1;
- }
- CMD:shopweaps(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- 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");
- }
- return 1;
- }
- CMD:showskills(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- new showskillz[476];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- format (showskillz, sizeof(showskillz), "{FFFFFF}Player {FF0000}%s{FFFFFF} Stats \n",pName );
- 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]);
- 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]);
- 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]);
- format (showskillz, sizeof(showskillz), "{FFFFFF}M4:{FF0000}%i , {FFFFFF}Sniper Rifle:{FF0000}%i.",WeaponInfo[playerid][SKILL_M4], WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
- SendClientMessage(playerid, -1, showskillz);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case WEAPONSHOP:
- {
- if(response)
- {
- switch(listitem)
- {
- 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");
- case 1: ShowPlayerDialog(playerid, WEAPONSHOP+2, DIALOG_STYLE_LIST, "Sub-Machine Gun", "Tec9\t\t\t$300\nMicro SMG\t\t$500", "Select", "Cancel");
- 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");
- case 3: ShowPlayerDialog(playerid, WEAPONSHOP+4, DIALOG_STYLE_LIST, "Armours", "Armour\t\t\t$200", "Select", "Cancel");
- case 4: ShowPlayerDialog(playerid, WEAPONSHOP+5, DIALOG_STYLE_LIST, "SMG", "MP5\t\t\t$2000", "Select", "Cancel");
- case 5: ShowPlayerDialog(playerid, WEAPONSHOP+6, DIALOG_STYLE_LIST, "Assault", "AK47\t\t$3500\nM4\t\t$4500", "Select", "Cancel");
- }
- return 1;
- }
- return 1;
- }
- case WEAPONSHOP+1:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(GetPlayerMoney(playerid) <200)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -200);
- GivePlayerWeapon(playerid,22,30);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a 9mm! ($200)");
- 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");
- }
- case 1:
- {
- if(GetPlayerMoney(playerid) <600)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -600);
- GivePlayerWeapon(playerid,23,30);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Silenced 9mm! ($600)");
- 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");
- }
- case 2:
- {
- if(GetPlayerMoney(playerid) <1200)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -1200);
- GivePlayerWeapon(playerid,24,30);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Desert Eagle! ($1200)");
- 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");
- }
- }
- return 1;
- }
- return 1;
- }
- case WEAPONSHOP+2:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(GetPlayerMoney(playerid) <300)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -300);
- GivePlayerWeapon(playerid,32,30);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Tec9! ($300)");
- 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");
- }
- case 1:
- {
- if(GetPlayerMoney(playerid) <500)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -500);
- GivePlayerWeapon(playerid,28,30);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Micro SMG! ($500)");
- 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");
- }
- }
- return 1;
- }
- return 1;
- }
- case WEAPONSHOP+3:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(GetPlayerMoney(playerid) <600)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -600);
- GivePlayerWeapon(playerid,25,15);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Shotgun! ($600)");
- 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");
- }
- case 1:
- {
- if(GetPlayerMoney(playerid) <800)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -800);
- GivePlayerWeapon(playerid,26,15);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Sawnoff Shotgun (800$)");
- 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");
- }
- case 2:
- {
- if(GetPlayerMoney(playerid) <1000)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -1000);
- GivePlayerWeapon(playerid,27,15);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Combat Shotgun (1000$)");
- 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");
- }
- }
- return 1;
- }
- return 1;
- }
- case WEAPONSHOP+4:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(GetPlayerMoney(playerid) <200)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -200);
- SetPlayerArmour(playerid, 100);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Armour! ($200)");
- 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");
- }
- }
- return 1;
- }
- return 1;
- }
- case WEAPONSHOP+5:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(GetPlayerMoney(playerid) <2000)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -2000);
- GivePlayerWeapon(playerid,29,30);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a MP5 (2000$)");
- 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");
- }
- }
- return 1;
- }
- return 1;
- }
- case WEAPONSHOP+6:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(GetPlayerMoney(playerid) <3500)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -3500);
- GivePlayerWeapon(playerid,30,120);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a AK47 (3500$)");
- 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");
- }
- case 1:
- {
- if(GetPlayerMoney(playerid) <4500)
- return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
- GivePlayerMoney(playerid, -4500);
- GivePlayerWeapon(playerid,31,120);
- SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a M4 (4500$)");
- 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");
- }
- }
- return 1;
- }
- return 1;
- }
- }
- return 1;
- }
- //Loaduser Public
- forward LoadUser_data(playerid, name[], value[]);
- public LoadUser_data(playerid, name[], value[])
- {
- // Load Weapons
- INI_Int("Weapon1", WeaponInfo[playerid][Weapon1]);
- INI_Int("Weapon2", WeaponInfo[playerid][Weapon2]);
- INI_Int("Weapon3", WeaponInfo[playerid][Weapon3]);
- INI_Int("Weapon4", WeaponInfo[playerid][Weapon4]);
- INI_Int("Weapon5", WeaponInfo[playerid][Weapon5]);
- INI_Int("Weapon6", WeaponInfo[playerid][Weapon6]);
- INI_Int("Weapon7", WeaponInfo[playerid][Weapon7]);
- INI_Int("Weapon8", WeaponInfo[playerid][Weapon8]);
- INI_Int("Weapon9", WeaponInfo[playerid][Weapon9]);
- INI_Int("Weapon10", WeaponInfo[playerid][Weapon10]);
- INI_Int("Weapon11", WeaponInfo[playerid][Weapon11]);
- INI_Int("Weapon12", WeaponInfo[playerid][Weapon12]);
- // Load Ammo
- INI_Int("Ammo1", WeaponInfo[playerid][Ammo1]);
- INI_Int("Ammo2", WeaponInfo[playerid][Ammo2]);
- INI_Int("Ammo3", WeaponInfo[playerid][Ammo3]);
- INI_Int("Ammo4", WeaponInfo[playerid][Ammo4]);
- INI_Int("Ammo5", WeaponInfo[playerid][Ammo5]);
- INI_Int("Ammo6", WeaponInfo[playerid][Ammo6]);
- INI_Int("Ammo7", WeaponInfo[playerid][Ammo7]);
- INI_Int("Ammo8", WeaponInfo[playerid][Ammo8]);
- INI_Int("Ammo9", WeaponInfo[playerid][Ammo9]);
- INI_Int("Ammo10", WeaponInfo[playerid][Ammo10]);
- INI_Int("Ammo11", WeaponInfo[playerid][Ammo11]);
- INI_Int("Ammo12", WeaponInfo[playerid][Ammo12]);
- // Load Skills
- INI_Int("SKILL_PISTOL", WeaponInfo[playerid][SKILL_PISTOL]);
- INI_Int("SKILL_PISTOL_SILENCED", WeaponInfo[playerid][SKILL_PISTOL_SILENCED]);
- INI_Int("SKILL_DESERT_EAGLE", WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
- INI_Int("SKILL_SHOTGUN", WeaponInfo[playerid][SKILL_SHOTGUN]);
- INI_Int("SKILL_SAWNOFF_SHOTGUN", WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
- INI_Int("SKILL_SPAS12_SHOTGUN", WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
- INI_Int("SKILL_MICRO_UZI", WeaponInfo[playerid][SKILL_MICRO_UZI]);
- INI_Int("SKILL_MP5", WeaponInfo[playerid][SKILL_MP5]);
- INI_Int("SKILL_AK47", WeaponInfo[playerid][SKILL_AK47]);
- INI_Int("SKILL_M4", WeaponInfo[playerid][SKILL_M4]);
- INI_Int("SKILL_SNIPERRIFLE", WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
- return 1;
- }
- //Stocks
- stock pWeaponSave(playerid)
- {
- new string[50];
- format(string, sizeof(string), PATH, GetName(playerid));
- return string;
- }
- stock GetName(playerid)
- {
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- //------------------------------------------------------------------------------
- //============================I Know You Will Change============================
- //=========================Please Do Not Remove Credits=========================
- //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement