public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:mymenu;
mymenu=GetPlayerMenu(playerid);
if(mymenu==Upgrades)
{
switch(row)
{
case 0:ShowMenuForPlayer(WeaponUpgrades,playerid);
//case 1:ShowMenuForPlayer(AmmoUpgrades,playerid);
case 1:ShowMenuForPlayer(ExtraUpgrades,playerid);
//case 2:ShowMenuForPlayer(HouseUpgrades,playerid);
}
}
if(mymenu==WeaponUpgrades)
{
if(row==0){ShowMenuForPlayer(PistolUpgrades,playerid);}
if(row==1){ShowMenuForPlayer(ShotgunUpgrades,playerid);}
if(row==2){ShowMenuForPlayer(SubMachineUpgrades,playerid);}
if(row==3){ShowMenuForPlayer(AssaultUpgrades,playerid);}
if(row==4){ShowMenuForPlayer(RifleUpgrades,playerid);}
if(row==5){ShowMenuForPlayer(HeavyUpgrades,playerid);}
if(row==6){ShowMenuForPlayer(ThrownUpgrades,playerid);}
}
if(mymenu==PistolUpgrades)
{
if(PlayerInfo[playerid][gPupgrade]>=1)
{
if(row==0){if(PlayerInfo[playerid][pLevel]>=1){PlayerInfo[playerid][pGun1] = 23;TellSpawnWeapon(playerid,"Silenced Pistol",Upgrades);}}
if(row==1){if(PlayerInfo[playerid][pLevel]>=2){PlayerInfo[playerid][pGun1] = 22;TellSpawnWeapon(playerid,"Colt 45",Upgrades);}}
if(row==2){if(PlayerInfo[playerid][pLevel]>=6){PlayerInfo[playerid][pGun1] = 24;TellSpawnWeapon(playerid,"Desert Eagle",Upgrades);}}
if(row==3){if(PlayerInfo[playerid][pLevel]>=1){PlayerInfo[playerid][pAmmo1] = PlayerInfo[playerid][pAmmo1]+50;TellSpawnWeapon(playerid,"Pistol Ammo",PistolUpgrades);}}//ammo
}
else{SendClientMessage(playerid,COLOR_GRAD6," У вас нет очков апгрейда. ");TogglePlayerControllable(playerid,1);}
}
if(mymenu==ShotgunUpgrades)
{
if(PlayerInfo[playerid][gPupgrade]>=1)
{//if(row==){if(PlayerInfo[playerid][pLevel]>=){}} //EXAMPLE TO COPY
if(row==0){if(PlayerInfo[playerid][pLevel]>=4){PlayerInfo[playerid][pGun2] = 25;TellSpawnWeapon(playerid,"Shotgun",Upgrades);}}//shotgun
if(row==1){if(PlayerInfo[playerid][pLevel]>=8){PlayerInfo[playerid][pGun2] = 26;TellSpawnWeapon(playerid,"Sawnoff Shotgun",Upgrades);}}
if(row==2){if(PlayerInfo[playerid][pLevel]>=5){PlayerInfo[playerid][pGun2] = 27;TellSpawnWeapon(playerid,"SPAZ 12",Upgrades);}}
if(row==3){if(PlayerInfo[playerid][pLevel]>=1){PlayerInfo[playerid][pAmmo2] = PlayerInfo[playerid][pAmmo2]+50;TellSpawnWeapon(playerid,"Shotgun Ammo",ShotgunUpgrades);}}//ammo
}
else{SendClientMessage(playerid,COLOR_GRAD6," У вас нет очков апгрейда. ");TogglePlayerControllable(playerid,1);}
}
if(mymenu==SubMachineUpgrades)
{
if(PlayerInfo[playerid][gPupgrade]>=1)
{
if(row==0){if(PlayerInfo[playerid][pLevel]>=9){PlayerInfo[playerid][pGun3] = 32;TellSpawnWeapon(playerid,"Tec 9",Upgrades);}}
if(row==1){if(PlayerInfo[playerid][pLevel]>=7){PlayerInfo[playerid][pGun3] = 28;TellSpawnWeapon(playerid,"Mac 10",Upgrades);}}
if(row==2){if(PlayerInfo[playerid][pLevel]>=3){PlayerInfo[playerid][pGun3] = 29;TellSpawnWeapon(playerid,"MP5",Upgrades);}}
if(row==3){if(PlayerInfo[playerid][pLevel]>=1){PlayerInfo[playerid][pAmmo3] = PlayerInfo[playerid][pAmmo3]+100;TellSpawnWeapon(playerid,"Sub Machine Gun Ammo",SubMachineUpgrades);}}//ammo
}
else{SendClientMessage(playerid,COLOR_GRAD6," У вас нет очков апгрейда. ");TogglePlayerControllable(playerid,1);}
}
if(mymenu==AssaultUpgrades)
{
if(PlayerInfo[playerid][gPupgrade]>=1)
{
if(row==0){if(PlayerInfo[playerid][pLevel]>=9){PlayerInfo[playerid][pGun4] = 30;TellSpawnWeapon(playerid,"AK 47",Upgrades);}}
if(row==1){if(PlayerInfo[playerid][pLevel]>=10){PlayerInfo[playerid][pGun4] = 31;TellSpawnWeapon(playerid,"M4",Upgrades);}}
if(row==2){if(PlayerInfo[playerid][pLevel]>=1){PlayerInfo[playerid][pAmmo4] = PlayerInfo[playerid][pAmmo4]+50;TellSpawnWeapon(playerid,"Assault Rifle Ammo",AssaultUpgrades);}}//ammo
}
else{SendClientMessage(playerid,COLOR_GRAD6," У вас нет очков апгрейда. ");TogglePlayerControllable(playerid,1);}
}
if(mymenu==RifleUpgrades)
{
if(PlayerInfo[playerid][gPupgrade]>=1)
{
if(row==0){if(PlayerInfo[playerid][pLevel]>=11){PlayerInfo[playerid][pGun5] = 33;TellSpawnWeapon(playerid,"Cuntgun",Upgrades);}}
if(row==1){if(PlayerInfo[playerid][pLevel]>=13){PlayerInfo[playerid][pGun5] = 34;TellSpawnWeapon(playerid,"Sniper Rifle",Upgrades);}}
if(row==2){if(PlayerInfo[playerid][pLevel]>=1){PlayerInfo[playerid][pAmmo5] = PlayerInfo[playerid][pAmmo5]+10;TellSpawnWeapon(playerid,"Rifle Ammo",RifleUpgrades);}}//ammo
}
else{SendClientMessage(playerid,COLOR_GRAD6," У вас нет очков апгрейда. ");TogglePlayerControllable(playerid,1);}
}
if(mymenu==ThrownUpgrades)
{
if(PlayerInfo[playerid][gPupgrade]>=1)
{
if(row==0){if(PlayerInfo[playerid][pLevel]>=7){PlayerInfo[playerid][pGun7]=WEAPON_GRENADE;TellSpawnWeapon(playerid,"Grenade",ThrownUpgrades);}}
if(row==1){if(PlayerInfo[playerid][pLevel]>=10){PlayerInfo[playerid][pGun7]=WEAPON_SATCHEL;TellSpawnWeapon(playerid,"Satchel",ThrownUpgrades);}}
if(row==2){if(PlayerInfo[playerid][pLevel]>=4){PlayerInfo[playerid][pGun7]=WEAPON_MOLTOV;TellSpawnWeapon(playerid,"Molotov",ThrownUpgrades);}}
if(row==3){if(PlayerInfo[playerid][pLevel]>=1){PlayerInfo[playerid][pAmmo7]= PlayerInfo[playerid][pAmmo7]+5;TellSpawnWeapon(playerid,"Thrown Ammo",ThrownUpgrades);}}//ammo
}
else{SendClientMessage(playerid,COLOR_GRAD6," У вас нет очков апгрейда. ");TogglePlayerControllable(playerid,1);}
}
if(mymenu==HeavyUpgrades)
{
if(PlayerInfo[playerid][gPupgrade]>=1)
{
if(row==0){if(PlayerInfo[playerid][pLevel]>=10){PlayerInfo[playerid][pGun6] = WEAPON_FLAMETHROWER;TellSpawnWeapon(playerid,"Flame Thrower",HeavyUpgrades);}}
if(row==1){if(PlayerInfo[playerid][pLevel]>=15){PlayerInfo[playerid][pGun6] = WEAPON_HEATSEEKER;TellSpawnWeapon(playerid,"Heat Seaker",HeavyUpgrades);}}
if(row==2){if(PlayerInfo[playerid][pLevel]>=12){PlayerInfo[playerid][pGun6] = WEAPON_ROCKETLAUNCHER;TellSpawnWeapon(playerid,"Rocket Launcher",HeavyUpgrades);}}
if(row==3){if(PlayerInfo[playerid][pLevel]>=20){PlayerInfo[playerid][pGun6] = WEAPON_MINIGUN;TellSpawnWeapon(playerid,"Minigun",HeavyUpgrades);}}
if(row==4){if(PlayerInfo[playerid][pLevel]>=1){PlayerInfo[playerid][pAmmo6] = PlayerInfo[playerid][pAmmo6]+10;TellSpawnWeapon(playerid,"Heavy Ammo",HeavyUpgrades);}}//Ammo
}
else{SendClientMessage(playerid,COLOR_GRAD6," У вас нет очков апгрейда. ");TogglePlayerControllable(playerid,1);}
}
/* if(mymenu==AmmoUpgrades)
{
if(row==0){}
}*/
if(mymenu==ExtraUpgrades)
{
if(PlayerInfo[playerid][gPupgrade]>=1){
//PlayerInfo[playerid][gPupgrade]--; //This is taken care of with TellSpawnWeapon
if(row==0){if(PlayerInfo[playerid][pLevel]>=1){if(PlayerInfo[playerid][pSHealth]<100){PlayerInfo[playerid][pSHealth]=PlayerInfo[playerid][pSHealth]+5.0;TellSpawnWeapon(playerid,"Health",Upgrades);}else{SendClientMessage(playerid,COLOR_YELLOW,"You have reached the maximum health upgrade.");TogglePlayerControllable(playerid,1);}}}
if(row==1){if(PlayerInfo[playerid][pLevel]>=5){if(PlayerInfo[playerid][pSArmour]<150){PlayerInfo[playerid][pSArmour]=PlayerInfo[playerid][pSArmour]+5.0;TellSpawnWeapon(playerid,"Armour",Upgrades);}else{SendClientMessage(playerid,COLOR_YELLOW,"You have reached the maximum armour upgrade.");TogglePlayerControllable(playerid,1);}}}
}
else{SendClientMessage(playerid,COLOR_GRAD6," У вас нет очков апгрейда. ");TogglePlayerControllable(playerid,1);}
}
if(mymenu == elemenu) {
switch(row) {
case 0: {MoveObject(Elevator,-2080.1521,886.0850,1006.2477,2);}
case 1: {MoveObject(Elevator,-2080.1521,886.0850,1100,2);}
case 2: {MoveObject(Elevator,-2080.1521,886.0850,1200,2);}
}
}
if(mymenu == nielemenu) {
switch(row) {
case 0: {MoveObject(NiElevator,-2239.9553,818.0469,49.4453,2);}
case 1: {MoveObject(NiElevator,-2239.9553,818.0469,1007,2);}
}
}
return 1;
}
TellSpawnWeapon(playerid,weapon[],Menu:menu){
new string[256];
PlayerInfo[playerid][gPupgrade]--;
ShowMenuForPlayer(menu,playerid);
format(string,sizeof(string)," Апгрейдов потрачено: %s %d апгрейдов осталось ",weapon,PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid,COLOR_GRAD6,string);
SetPlayerWeapons(playerid);
}
public OnPlayerExitedMenu(playerid)
{
TogglePlayerControllable(playerid,1);
return 1;
}