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> //[CREDITS: WHOLE SANANDREAS MULTIPLAYER TEAM]
- #include <YSI\y_ini> //[CREDITS: Y_LESS]
- #include <zcmd> //[CREDITS: ZEEX]
- //Defines
- #define PATH "WeaponShop/%s.ini"
- #define WEAPONSHOP 789
- #define COLOR_RED 0xAA3333AA
- #define COLOR_GREEN 0x33AA33FF
- #define COLOUR_WHITE 0xFFFFFFFF
- #define COLOUR_BLACK 0x000000FF
- #define COLOUR_YELLOW 0xFFFF00AA
- #define COLOUR_LIGHTBLUE 0x33CCFFAA
- #define COLOUR_ORANGE 0xFF9900AA
- #define COLOUR_PINK 0xE100E1FF
- #define COLOUR_GREY 0xAFAFAFAA
- #define COLOUR_BLUE 0x0088FFAA
- #define COLOUR_LIGHTGREEN 0x9ACD32AA
- //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];
- new Killing_Spree[MAX_PLAYERS], Float:New_Health, Float:New_Armour;
- new Float:Health_Calculate, Float:Armour_Calulate;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" WEAPONS-SHOP v4.0 Loaded by Danyal");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" WEAPONS-SHOP v4.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 V4.0 By Danyal");
- //______________________________________________________________________________
- //*-*-*-*-*-*-*-*-*-*-*-*-* [PLAYER SKILL SETTING] *-*-*-*-*-*-*-*-*-*-*-*-*
- //------------------------------------------------------------------------------
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, WeaponInfo[playerid][SKILL_PISTOL]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, WeaponInfo[playerid][SKILL_PISTOL_SILENCED]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, WeaponInfo[playerid][SKILL_SHOTGUN]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, WeaponInfo[playerid][SKILL_MICRO_UZI]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, WeaponInfo[playerid][SKILL_MP5]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, WeaponInfo[playerid][SKILL_AK47]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, WeaponInfo[playerid][SKILL_M4]);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
- //______________________________________________________________________________
- //*-*-*-*-*-*-*-*-*- [GIVING OUT PLAYER ITS SAVED WEAPON] *-*-*-*-*-*-*-*-*-
- //------------------------------------------------------------------------------
- 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)
- {
- //______________________________________________________________________________
- //*-*-*-*-*-*-*-*-*-*- [KILLLER WEAPON SKILL INCREASING] *-*-*-*-*-*-*-*-*-*
- //*-*-*-*-*-*-*-*-*-*-* [PLAYER WEAPON SKILL DECREASING] *-*-*-*-*-*-*-*-*-*-
- //------------------------------------------------------------------------------
- new Weapon = GetPlayerWeapon(killerid);
- switch(Weapon)
- {
- case 22:
- {
- WeaponInfo[killerid][SKILL_PISTOL]+=2;
- WeaponInfo[playerid][SKILL_PISTOL]--;
- }
- case 23:
- {
- WeaponInfo[killerid][SKILL_PISTOL_SILENCED]+=2;
- WeaponInfo[playerid][SKILL_PISTOL_SILENCED]--;
- }
- case 24:
- {
- WeaponInfo[killerid][SKILL_DESERT_EAGLE]+=2;
- WeaponInfo[playerid][SKILL_DESERT_EAGLE]--;
- }
- case 25:
- {
- WeaponInfo[killerid][SKILL_SHOTGUN]+=2;
- WeaponInfo[playerid][SKILL_SHOTGUN]--;
- }
- case 26:
- {
- WeaponInfo[killerid][SKILL_SAWNOFF_SHOTGUN]+=2;
- WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]--;
- }
- case 27:
- {
- WeaponInfo[killerid][SKILL_SPAS12_SHOTGUN]+=2;
- WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]--;
- }
- case 28:
- {
- WeaponInfo[killerid][SKILL_MICRO_UZI]+=2;
- WeaponInfo[playerid][SKILL_MICRO_UZI]--;
- }
- case 29:
- {
- WeaponInfo[killerid][SKILL_MP5]+=2;
- WeaponInfo[playerid][SKILL_MP5]--;
- }
- case 30:
- {
- WeaponInfo[killerid][SKILL_AK47]+=2;
- WeaponInfo[playerid][SKILL_AK47]--;
- }
- case 31:
- {
- WeaponInfo[killerid][SKILL_M4]+=2;
- WeaponInfo[playerid][SKILL_M4]--;
- }
- case 34:
- {
- WeaponInfo[killerid][SKILL_SNIPERRIFLE]+=2;
- WeaponInfo[playerid][SKILL_SNIPERRIFLE]--;
- }
- }
- //______________________________________________________________________________
- //*-*-*-*-*-*-*-*-*-*-*-*-*- [REWARDS FOR KILLER] *-*-*-*-*-*-*-*-*-*-*-*-**
- //------------------------------------------------------------------------------
- new Player_Name[24], string[128];
- GetPlayerName(killerid, Player_Name, sizeof(Player_Name));
- Killing_Spree[playerid] = 0;
- Killing_Spree[killerid]++;
- switch(Killing_Spree[killerid])
- {
- case 1:
- {
- format(string,sizeof(string), "~r~%s ~w~First Kill", Player_Name);
- GameTextForAll(string, 3000,6);
- GetPlayerHealth(killerid, New_Health);
- if(New_Health < 80)
- {
- SetPlayerHealth(killerid, New_Health + 20);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned +20 Health. As A Reward!");
- }
- else
- {
- Health_Calculate = 100 - New_Health;
- SetPlayerHealth(killerid, New_Health + Health_Calculate);
- format(string, sizeof(string), "You Have Earned +%d Health. As A Reward!", Health_Calculate);
- SendClientMessage(killerid,COLOUR_BLUE, string);
- }
- Health_Calculate = 0; New_Health = 0.0;
- }
- case 2:
- {
- format(string,sizeof(string), "~r~%s ~w~Double Kill", Player_Name);
- GameTextForAll(string, 3000,6);
- GivePlayerWeapon(killerid,24,100);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Deagle With 100 Bullets. As A Reward!");
- }
- case 3:
- {
- format(string,sizeof(string), "~r~%s ~w~Tripple Kill", Player_Name);
- GameTextForAll(string, 3000,6);
- GetPlayerArmour(killerid, New_Armour);
- if(New_Armour < 80)
- {
- SetPlayerArmour(killerid, New_Armour + 20);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned +20 Armour. As A Reward!");
- }
- else
- {
- Armour_Calulate = 100 - New_Armour;
- SetPlayerArmour(killerid, New_Armour + Armour_Calulate);
- format(string, sizeof(string), "You Have Earned +%d Armour. As A Reward!", Health_Calculate);
- SendClientMessage(killerid,COLOUR_BLUE, string);
- }
- Armour_Calulate = 0; New_Armour = 0.0;
- }
- case 4:
- {
- format(string,sizeof(string), "~r~%s ~w~Over Kill", Player_Name);
- GameTextForAll(string, 3000,6);
- GivePlayerWeapon(killerid,28,500);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Micro SMG With 500 Bullets. As A Reward!");
- }
- case 5:
- {
- format(string,sizeof(string), "~r~%s ~w~Rampage", Player_Name);
- GameTextForAll(string, 3000,6);
- GivePlayerMoney(killerid, 25000);
- GivePlayerWeapon(killerid,30,50);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A AK47 With 50 Bullets and 25k Money. As A Reward!");
- }
- case 6:
- {
- format(string,sizeof(string), "~r~%s ~w~Killtacular", Player_Name);
- GameTextForAll(string, 3000,6);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Been Given Random Gift. As A Reward!");
- new chooseone = random(6);
- switch(chooseone)
- {
- case 0:
- {
- GetPlayerHealth(killerid, New_Health);
- Health_Calculate = 100 - New_Health;
- SetPlayerHealth(killerid, New_Health + Health_Calculate);
- format(string, sizeof(string), "You Have Earned +%d Health. As A Reward!", Health_Calculate);
- SendClientMessage(killerid,COLOUR_BLUE, string);
- Health_Calculate = 0; New_Health = 0.0;
- }
- case 1:
- {
- GivePlayerWeapon(killerid,24,250);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Deagle With 250 Bullets. As A Reward!");
- }
- case 2:
- {
- GetPlayerArmour(killerid, New_Armour);
- Armour_Calulate = 100 - New_Armour;
- SetPlayerArmour(killerid, New_Armour + Armour_Calulate);
- format(string, sizeof(string), "You Have Earned +%d Armour. As A Reward!", Health_Calculate);
- SendClientMessage(killerid,COLOUR_BLUE, string);
- Armour_Calulate = 0; New_Armour = 0.0;
- }
- case 3:
- {
- GivePlayerWeapon(killerid,28,800);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Micro SMG With 800 Bullets. As A Reward!");
- }
- case 4:
- {
- GivePlayerMoney(killerid, 30000);
- GivePlayerWeapon(killerid,30,150);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A AK47 With 150 Bullets and 30k Money. As A Reward!");
- }
- case 5:
- {
- SendClientMessage(killerid,COLOR_RED,"Ooops, Bad Luck!!! You Haven't Got Anything.");
- }
- }
- }
- case 7:
- {
- format(string,sizeof(string), "~r~%s ~w~Monster Kill", Player_Name);
- GameTextForAll(string, 3000,6);
- GetPlayerHealth(killerid, New_Health);
- if(New_Health < 50)
- {
- SetPlayerHealth(killerid, New_Health + 20);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned +50 Health. As A Reward!");
- }
- else
- {
- Health_Calculate = 100 - New_Health;
- SetPlayerHealth(killerid, New_Health + Health_Calculate);
- format(string, sizeof(string), "You Have Earned +%d Health. As A Reward!", Health_Calculate);
- SendClientMessage(killerid,COLOUR_BLUE, string);
- }
- Health_Calculate = 0; New_Health = 0.0;
- }
- case 8:
- {
- format(string,sizeof(string), "~r~%s ~w~Killimanjaro", Player_Name);
- GameTextForAll(string, 3000,6);
- GivePlayerWeapon(killerid,24,200);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Deagle With 200 Bullets. As A Reward!");
- }
- case 9:
- {
- format(string,sizeof(string), "~r~%s ~w~Ludicrous Kill", Player_Name);
- GameTextForAll(string, 3000,6);
- GetPlayerArmour(killerid, New_Armour);
- if(New_Armour < 50)
- {
- SetPlayerArmour(killerid, New_Armour + 20);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned +50 Armour. As A Reward!");
- }
- else
- {
- Armour_Calulate = 100 - New_Armour;
- SetPlayerArmour(killerid, New_Armour + Armour_Calulate);
- format(string, sizeof(string), "You Have Earned +%d Armour. As A Reward!", Health_Calculate);
- SendClientMessage(killerid,COLOUR_BLUE, string);
- }
- Armour_Calulate = 0; New_Armour = 0.0;
- }
- case 10:
- {
- format(string,sizeof(string), "~r~%s ~w~Killionaire", Player_Name);
- GameTextForAll(string, 3000,6);
- GivePlayerWeapon(killerid,28,1000);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Micro SMG With 1000 Bullets. As A Reward!");
- }
- case 11:
- {
- format(string,sizeof(string), "~r~%s ~w~Unstoppable", Player_Name);
- GameTextForAll(string, 3000,6);
- SetPlayerSpecialAction(killerid, SPECIAL_ACTION_USEJETPACK);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Jetpack. As A Reward!");
- }
- case 12:
- {
- format(string,sizeof(string), "~r~%s ~w~Invincible", Player_Name);
- GameTextForAll(string, 3000,6);
- GivePlayerMoney(killerid, 50000);
- GivePlayerWeapon(killerid,31,100);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A M4 With 100 Bullets and 50k Money. As A Reward!");
- }
- case 13:
- {
- format(string,sizeof(string), "~r~%s ~w~Inconceivable", Player_Name);
- GameTextForAll(string, 3000,6);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Been Given Random Gift. As A Reward!");
- new chooseone = random(6);
- switch(chooseone)
- {
- case 0:
- {
- GetPlayerHealth(killerid, New_Health);
- Health_Calculate = 100 - New_Health;
- SetPlayerHealth(killerid, New_Health + Health_Calculate);
- format(string, sizeof(string), "You Have Earned +%d Health. As A Reward!", Health_Calculate);
- SendClientMessage(killerid,COLOUR_BLUE, string);
- Health_Calculate = 0; New_Health = 0.0;
- }
- case 1:
- {
- GivePlayerWeapon(killerid,35,10);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A RPG With 10 Missiles. As A Reward!");
- }
- case 2:
- {
- GetPlayerArmour(killerid, New_Armour);
- Armour_Calulate = 100 - New_Armour;
- SetPlayerArmour(killerid, New_Armour + Armour_Calulate);
- format(string, sizeof(string), "You Have Earned +%d Armour. As A Reward!", Health_Calculate);
- SendClientMessage(killerid,COLOUR_BLUE, string);
- Armour_Calulate = 0; New_Armour = 0.0;
- }
- case 3:
- {
- GivePlayerWeapon(killerid,38,100);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Minigun With 100 Bullets. As A Reward!");
- }
- case 4:
- {
- GivePlayerMoney(killerid, 60000);
- GivePlayerWeapon(killerid,34,25);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned A Sniper With 25 Bullets and 60k Money. As A Reward!");
- }
- case 5:
- {
- SendClientMessage(killerid,COLOR_RED,"Ooops, Bad Luck!!! You Haven't Got Anything.");
- }
- }
- }
- case 14:
- {
- format(string,sizeof(string), "~r~%s ~w~Unfrigginbelievable", Player_Name);
- GameTextForAll(string, 3000,6);
- GivePlayerWeapon(killerid,37,150);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned Flamethrower. As A Reward!");
- }
- case 15:
- {
- format(string,sizeof(string), "~r~%s ~w~Extermination", Player_Name);
- GameTextForAll(string, 3000,6);
- GivePlayerWeapon(killerid,38,1000);
- SendClientMessage(killerid,COLOUR_BLUE,"You Have Earned Minigun. As A Reward!");
- }
- }
- 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