Pickup!!
#1

Guys I need some help.Here is what i m thinking to create pickup with array.

pawn Код:
new pickup[20];
pawn Код:
OnGameModeInit()
{
pickup[0]= CreatePcikup...
...pickup[19]...
return 1;
}
So what i use in OnPlayerPickUpPickedUp so that i wont have to make like this

pawn Код:
if(pickupid == pickup[0])
{
}
then
if(pickupid == pickup[1])
What should i use??Something like that?

pawn Код:
public OnPlayerPickupPickedUp(playerid, pickupid)
{
for(new i=0;i<=19;i++)
{
if(pickupid == a[i])
{
//Stuffs here because i am using same function for every pickup
}
return 1;
}
Reply
#2

Did you try the loop to see if it works?
Reply
#3

nah still not but guesing if it works.Now i need to check .Wait lemme check.
Reply
#4

The way you wrote is correct, should work.
Reply
#5

Yo, it worked.

-DELETE-
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)