Dialog help :D
#1

Код:
	if (newkeys & KEY_WALK)
	{
	new M4A1[32], AssaultAmmoEquiped[32],total[64];

	if(PlayerInfo[playerid][pM4A1] > 0)
	{
	format(M4A1, sizeof(M4A1), "M4A1: %d", PlayerInfo[playerid][pM4A1]);
	}
	if(PlayerInfo[playerid][pAssaultAmmoEquiped] > 0)
	{
	format(AssaultAmmoEquiped, sizeof(AssaultAmmoEquiped), "(%d)", PlayerInfo[playerid][pAssaultAmmoEquiped]);
	}
	format(total, sizeof(total), "%s %s", M4A1,  AssaultAmmoEquiped);
	ShowPlayerDialog(playerid, DIALOG_INVENTORY, DIALOG_STYLE_LIST, "Inventory", total, "Select", "Cancel");
        return 1;
	}
	if (newkeys & KEY_CROUCH)
	{
		if(IsValidObject(LootObjects[0]) && IsPlayerInRangeOfPoint(playerid,2.0,2384.59448,-1674.36279,13.74557))
		{
	       	PlayerInfo[playerid][pM4A1] ++;
        	SendClientMessage(playerid, COLOR_GREEN, "* 1 M4A1 has been added to your inventory");
        	DestroyObject(LootObjects[0]);
        }
 	}
My script.This is my invetory script,there are ofcourse more items than M4A1.When I have,for example,Medkit,M4A1,blood bag.And M4A1 is on the 2rd slot of the dialog.How do I detect if the player cliked on M4A1 and not Medkit.Because M4A1 can be on any place(like 3rd or 1rst) and I can't just pre-set it.
Reply


Messages In This Thread
Dialog help :D - by Kruno88 - 18.06.2015, 12:56
Re: Dialog help :D - by Lajko1 - 18.06.2015, 13:23
Re: Dialog help :D - by AndySedeyn - 18.06.2015, 13:25
Re: Dialog help :D - by nezo2001 - 18.06.2015, 14:00
Re: Dialog help :D - by Kruno88 - 18.06.2015, 14:07
Re: Dialog help :D - by Lajko1 - 18.06.2015, 15:04
Re: Dialog help :D - by Ritzy2K - 18.06.2015, 15:20
Re: Dialog help :D - by AndySedeyn - 18.06.2015, 15:47
Re: Dialog help :D - by Kruno88 - 19.06.2015, 12:48

Forum Jump:


Users browsing this thread: 2 Guest(s)