12.03.2014, 20:19
Dear I think there is a problem with the other pickup "RandomPickup" is messing this weapon shop arrow pickup.. here's the whole code.
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.
Код:
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; }
Can you help me fix this. It's been 1 and a half hours doing this.