Pickup problem
#1

I have 1 static pickup at my gm

It's under OnGameModeInIt
Код:
AddStaticPickup(1239, 2, 2176.3914,-2258.8840,14.7734, 0);
And i have 1 createpickup (its mini-mission it appears with a timer)

It's under OnPlayerPickUpPickup

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == MINIMISSIONPICKUP)
The Problem is i enter the normal pickup "addstaticpickup" it gives me minimissinpickup...
Reply
#2

Are you sure you defined the two pickups above OnGameModeInit
then under GameModeInit have you put
Код:
 CreatePickup(......);
Try that, then it should work.
Also, are you getting any error lines when you compile?
Reply
#3

make sure you have

pawn Код:
MINIMISSIONPICKUP = CreatePickup(...);
this is the only way MINIMISSIONPICKUP will know the pickup id.
Reply
#4

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
make sure you have

pawn Код:
MINIMISSIONPICKUP = CreatePickup(...);
this is the only way MINIMISSIONPICKUP will know the pickup id.
yea i did that...
Reply
#5

It's CreatePickup, not AddStaticPickup....
Reply
#6

Quote:
Originally Posted by Jimbo01
Посмотреть сообщение
yea i did that...
pawn Код:
AddStaticPickup(1239, 2, 2176.3914,-2258.8840,14.7734, 0);
This doesn't really return any kind of pickupid so you must use CreatePickup like the following:-

pawn Код:
new YOUR_VAR; // on top

YOUR_VAR = CreatePickup( 1239, 2, 2176.3914,-2258.8840,14.7734, 0 ); // on gamemode init

public OnPlayerPickUpPickup( playerid, pickupid )
{
    if( pickupid == YOUR_VAR )
    {
        // your function
    }
    return 1;
}
CreatePickup works same as AddStaticPickup but it does return a pickup id.

Hope this helps
-FalconX
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)