[Pedido] COMPRARARMAS
#6

Код:
//<CREDITOS>

#include <a_samp>

new PickupArma;

public OnGameModeInit()
{
    CreatePickup(IdPickup, 1, X,Y,Z);//toque XYZ pela sua coordenada. deixe esse 1.
    return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((newkeys == KEY_SECONDARY_ATTACK ))//=(F)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3, X,Y,Z)) //3 = distancia QUE A PICKUP PODE SER ABERTA. toque XYZ pela sua coordenada dA PICKUP
        {
       		ShowPlayerDialog(playerid, PickupArma,  DIALOG_STYLE_LIST, "Armas", "M4\nDeagle", "Comprar", "Cancelar");// 
        }
    }
	return 1;
}
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);
		}

    	}
    }
	return 1;
}
Reply


Messages In This Thread
COMPRARARMAS - by Dimbalada - 07.04.2017, 01:59
Re: COMPRARARMAS - by DarkBr - 07.04.2017, 02:15
Re: COMPRARARMAS - by DarkBr - 07.04.2017, 02:46
Re: COMPRARARMAS - by Dimbalada - 07.04.2017, 04:43
Re: COMPRARARMAS - by Relaxed - 07.04.2017, 09:15
Re: COMPRARARMAS - by DarkBr - 07.04.2017, 17:11
Re: COMPRARARMAS - by Dimbalada - 07.04.2017, 18:06
Re: COMPRARARMAS - by DarkBr - 07.04.2017, 18:18
Re: COMPRARARMAS - by Dimbalada - 07.04.2017, 18:57
Re: COMPRARARMAS - by Relaxed - 07.04.2017, 18:59

Forum Jump:


Users browsing this thread: 2 Guest(s)