[Include] drop-money.inc (Make player drop cash on death)
#2

Code:
new dropMoney[MAX_DROP_MONEY];
You need to define these things if the user has not defined them! Also your system is not fully contained it requires function calls from the user when it shouldn't do that. There should be standalone include function if possible with user interaction primarily from callbacks in which returning 0 disallows picking up a pickup. Don't rely on the user to make the determination of WHEN to check always give the user choice of WHAT to do WHEN something happens.

Code:
new index = Ran(0, MAX_DROP_MONEY);
That isn't the right way to select an index. Use an iterator then store the index of a free iterator index in the extraid of the pickup create an enum and variable. Then when you pick up a pickup check the extraid use that to reference the data stored from the iterator index. Now check that the pickup id is the same from your stored data if they are then the pickup belongs to this system. If not then the pickup might be used in another system. You have now eliminated most of the looping you will need to use.


Code:
dropMoney[index] = CreateDynamicPickup(1212, 1, x + Ran(-i/2, i/2), y + Ran(-i/2, i/2), z - 0.5);
Add ColAndreas support to check if there is a wall that way money will never spawn outside of the map and you can also find the z-height as well for even better control.
Reply


Messages In This Thread
drop-money.inc (Make player drop cash on death) - by AmirSavand - 10.09.2018, 00:07
Re: drop-money.inc (Make player drop cash on death) - by Pottus - 10.09.2018, 00:32
Re: drop-money.inc (Make player drop cash on death) - by AmirSavand - 10.09.2018, 00:50
Re: drop-money.inc (Make player drop cash on death) - by Pottus - 10.09.2018, 13:54

Forum Jump:


Users browsing this thread: 1 Guest(s)