02.01.2012, 19:44
Hi peoples. I want to ask how to make 5 money pickups,and they all give me money?
new Money1 new Money2 new Money3 new Money4 new Money5 Money1 = CreatePickup( ... ) ...
new MoneyPickup[5];
public OnFilterScriptInit()
{
MoneyPickup[0] = CreatePickup//blah blah
MoneyPickup[1] = CreatePickup//blah blah
MoneyPickup[2] = CreatePickup//blah blah
MoneyPickup[3] = CreatePickup//blah blah
MoneyPickup[4] = CreatePickup//blah blah
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i = 0; i < sizeof(MoneyPickup); i++)
{
if(pickupid == MoneyPickup[i])
{
new cash = random(2000);
GivePlayerMoney(playerid, cash);
return 1;
}
}
return 1;
}