Originally Posted by Alex_Obando
pawn Код:
//CommandText if(strcmp(cmdtext, "/buyguns", true) == 0) { ShowMenuForPlayer(weaponmenu, playerid); return 1; }
pawn Код:
//FSInit weaponmenu = CreateMenu("Weapon Menu", 1, 220.0, 100.0, 150.0, 150.0); AddMenuItem(weaponmenu, 0, "9mm Weapon"); AddMenuItem(weaponmenu, 0, "Silenced 9mm Weapon"); AddMenuItem(weaponmenu, 0, "Desert Eagle Weapon"); AddMenuItem(weaponmenu, 0, "Shotgun Weapon"); AddMenuItem(weaponmenu, 0, "Sawnoff Shotgun Weapon"); AddMenuItem(weaponmenu, 0, "Combat Shotgun Weapon"); AddMenuItem(weaponmenu, 0, "Micro SMG (Uzi)Weapon"); AddMenuItem(weaponmenu, 0, "SMG (MP5) Weapon"); AddMenuItem(weaponmenu, 0, "AK47 (Kalashnikov)Weapon"); AddMenuItem(weaponmenu, 0, "M4 Weapon"); AddMenuItem(weaponmenu, 0, "Tec9 Weapon");
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row) { new Menu:CurrentMenu = GetPlayerMenu(playerid); if(CurrentMenu == weaponmenu) { switch(row) { case 0: //9mm { GivePlayerWeapon(playerid, 22 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your 9mm!"); } case 1: //Silenced 9mm { GivePlayerWeapon(playerid, 23 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Silenced 9mm!"); } case 2: //Desert Eagle { GivePlayerWeapon(playerid, 24 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Desert Eagle!"); } case 3: //Shotgun { GivePlayerWeapon(playerid, 25 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Shotgun!!"); } case 4: //Sawnoff Shotgun { GivePlayerWeapon(playerid, 26 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Sawnoff Shotgun!"); } case 5: //Combat Shotgun { GivePlayerWeapon(playerid, 27 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Combat Shotgun!"); } case 6: //Micro SMG (Uzi) { GivePlayerWeapon(playerid, 28 , 500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Micro SMG (Uzi)!"); } case 7: //SMG (MP5) { GivePlayerWeapon(playerid, 29 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your SMG (MP5)!"); } case 8: //AK47 (Kalashnikov) { GivePlayerWeapon(playerid, 30 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your AK47 !"); } case 9: //M4 { GivePlayerWeapon(playerid, 31 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your M4!"); } case 10: //Tec9 { GivePlayerWeapon(playerid, 32 , 500); GivePlayerMoney(playerid, -500); SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Tec9!"); } } } return 1; }
You can change weapons price by changing the number below:
GivePlayerMoney(playerid, -500);
Make sure to use the - (It'll remove the cash)
|