09.04.2017, 23:03
PHP код:
new PickupArma;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
if((newkeys == KEY_SECONDARY_ATTACK)) //F/enter
{
if(IsPlayerInRangeOfPoint(3, playerid,-379.3475,1585.4386,77.1554, -1))
{
ShowPlayerDialog(playerid, PickupArma, DIALOG_STYLE_LIST, "Armas", "M4\nDeagle", "Comprar", "Cancelar");//
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
}
if (dialogid == PickupArma)
{
if(response)
{
if(listitem == 0) // M4
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFFFFFF, "Voce nao tem dinheiro suficiente"); // se ele nao tiver 500 , retorna essa mensagem!
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid, 31, 500);
SendClientMessage(playerid, -1, "Vocк comprou M4 com Sucesso!");
PlayerPlaySound(playerid,1149,0.0,0.0,0.0);
}
}
}
if (dialogid == PickupArma)
{
if(response)
{
if(listitem == 1) // DEAGLE
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFFFFFF, "Voce nao tem dinheiro suficiente"); // se ele nao tiver 500 , retorna essa mensagem!
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 24, 500);
SendClientMessage(playerid, -1, "Vocк comprou DEAGLE com Sucesso!");
PlayerPlaySound(playerid,1149,0.0,0.0,0.0);
}
}
}