Ко всем define:
Code: Select all
#define wepbuy 1
#define COLOR_ORANGE 0xFF9900AA // Если у вас уже в моде то не ставьте
В OnPlayerCommandText:
Code: Select all
if(strcmp(cmdtext, "/wepbuy", true, 10) == 0)
{
ShowPlayerDialog(playerid, wepbuy, DIALOG_STYLE_LIST,"Выберите оружие","Deagle\nShotGun\nAK47","Купить","Нет");
return 1;
}
В OnDialogResponse:
Code: Select all
if(dialogid == wepbuy)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 1000)
return SendClientMessage(playerid, 0xFFFFFF, " У вас не достаточно денег!");
GivePlayerWeapon(playerid, WEAPON_DEAGLE, 500);
GivePlayerMoney(playerid, -1000);
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 1000)
return SendClientMessage(playerid, 0xFFFFFF, " У вас не достаточно денег!");
GivePlayerWeapon(playerid, WEAPON_SHOTGUN, 500);
GivePlayerMoney(playerid, -1000);
}
if(listitem == 2)
{
if(GetPlayerMoney(playerid) < 1000)
return SendClientMessage(playerid, 0xFFFFFF, " У вас не достаточно денег!");
GivePlayerWeapon(playerid, WEAPON_AK47, 500);
GivePlayerMoney(playerid, -1000);
}
}
}
}