Код:
if(dialogid == 15)// Разгрузка
{
if(response)
{
if(listitem == 0) // Дигл
{
if(pInfo[playerid][pRdeagle] >= 7)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,24,7); // дигл
pInfo[playerid][pRdeagle] -= 7;
ApplyAnimation(playerid, "COLT45", "COLT45_RELOAD", 4.1, 0, 1, 1, 0, 3000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 1) // Кольт
{
if(pInfo[playerid][pRcolt] >= 17)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,22,17);
pInfo[playerid][pRcolt] -= 17;
ApplyAnimation(playerid, "COLT45", "COLT45_RELOAD", 4.1, 0, 1, 1, 0, 3000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 2) // Дробовик
{
if(pInfo[playerid][pRshot] >= 7)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,25,7);
pInfo[playerid][pRshot] -= 7;
ApplyAnimation(playerid, "COLT45", "SAWNOFF_RELOAD", 4.1, 0, 1, 1, 0, 5000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 3) // спас 12
{
if(pInfo[playerid][pRspas] >= 7)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,27,7);
pInfo[playerid][pRspas] -= 7;
ApplyAnimation(playerid, "COLT45", "SAWNOFF_RELOAD", 4.1, 0, 1, 1, 0, 5000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 4) // МП5
{
if(pInfo[playerid][pRmp5] >= 30)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,29,30);
pInfo[playerid][pRmp5] -= 30;
ApplyAnimation(playerid, "UZI", "UZI_RELOAD", 4.1, 0, 1, 1, 0, 2000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 5) // АК
{
if(pInfo[playerid][pRak] >= 30)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,30,30);
pInfo[playerid][pRak] -= 30;
ApplyAnimation(playerid, "UZI", "UZI_RELOAD", 4.1, 0, 1, 1, 0, 5000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 6) // M4
{
if(pInfo[playerid][pRm4] >= 50)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,31,50);
pInfo[playerid][pRm4] -= 50;
ApplyAnimation(playerid, "UZI", "UZI_RELOAD", 4.1, 0, 1, 1, 0, 5000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 7) // Ружьё
{
if(pInfo[playerid][pRrifle] >= 10)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,33,10);
pInfo[playerid][pRrifle] -= 10;
ApplyAnimation(playerid, "UZI", "UZI_RELOAD", 4.1, 0, 1, 1, 0, 7000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 8) // СВД
{
if(pInfo[playerid][pRsniper] >= 10)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,34,10);
pInfo[playerid][pRsniper] -= 10;
ApplyAnimation(playerid, "UZI", "UZI_RELOAD", 4.1, 0, 1, 1, 0, 7000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
if(listitem == 9) // РПГ
{
if(pInfo[playerid][pRrpg] >= 1)
{
SetPlayerReload(playerid);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,35,1);
pInfo[playerid][pRrpg] -= 1;
ApplyAnimation(playerid, "UZI", "UZI_RELOAD", 4.1, 0, 1, 1, 0, 15000, 1);
}
else
{
SendClientMessage(playerid,0x88AA88AA,"Патроны закончились");
}
}
else
{
return 1;
}
}
}