Arrow object = shop?
#6

Dear I think there is a problem with the other pickup "RandomPickup" is messing this weapon shop arrow pickup.. here's the whole code.

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
 	if(pickupid == pickup1)
    {
        ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Weapon Shop", "Melee\nPistols\nShotguns\nSub-Machine Guns\nRifle\nAssault", "Select", "Close");
	}
	if( pickupid == RandomPickup )
	{
		new
		    Float: amount,
		    r_amount = RandomEx( 5, 30 ),
		    szStr[ 20 ]
		;
		if( !RandomPickup_HealthArmour{playerid}) // health pickupid
		{
		    GetPlayerHealth(playerid, amount);
		    SetPlayerHealth(playerid, amount + r_amount);
		    format(szStr, sizeof(szStr), "Health Bonus +%d", r_amount);
		}
		else
		{
		    GetPlayerArmour(playerid, amount);
		    SetPlayerArmour(playerid, amount + r_amount);
		    format(szStr, sizeof(szStr ), "Armour Bonus +%d", r_amount);
		}
		DestroyPickup(RandomPickup);
		GameTextForPlayer( playerid, szStr, 3000, 3);
	}
	return 1;
}
Here the problem (without return in weapon shop dialog). When I walk to the arrow object I made, it shows the dialog then suddenly the object disappears and I get a random bonus health/armour. (It became a staticpickup lol)

Can you help me fix this. It's been 1 and a half hours doing this.
Reply


Messages In This Thread
Arrow object = shop? - by gotwarzone - 12.03.2014, 19:37
Re: Arrow object = shop? - by Matess - 12.03.2014, 19:43
Re: Arrow object = shop? - by gotwarzone - 12.03.2014, 20:03
Re: Arrow object = shop? - by Matess - 12.03.2014, 20:11
Re: Arrow object = shop? - by Matess - 12.03.2014, 20:13
Re: Arrow object = shop? - by gotwarzone - 12.03.2014, 20:19

Forum Jump:


Users browsing this thread: 3 Guest(s)