Failed Compiling pickup
#1

here is my pickup script
-------------------------------------------------------------------------------------
}

//pickups
help = CreatePickup(1318, 2, 2510.3901,2720.0701,10.8203, -1);


if(pickupid == help) //
{
SendClientMessage(playerid, 0xFFFFFFFF, "You received $100!"); //
return 1;
}

---------------------------------------------------------------------------------------
I have added "new help" to the top of my script but it says when i compile

(103) : error 017: undefined symbol "mypickup"
(607) : error 017: undefined symbol "pickupid"

?

What do i do to sove it?

All i want is a pickup, but when a player picks it up it brings up a message on screen

Thanks
Reply
#2

post the auctual script.. its confusing looking at this.

why is help = createpickup under a closing bracket.. it should be inside, to begin with.
Reply
#3

The correct way to create a pickup is;

pawn Код:
// TOP
new pickup;

// OnGameModeInit
pickup = CreatePickup(id,type,x,y,z,vw);

// OnPlayerPickupPickup

if(pickupid == pickup)
{
// Something
}
Reply
#4

Quote:
Originally Posted by LilGunna
Посмотреть сообщение
post the auctual script.. its confusing looking at this.

why is help = createpickup under a closing bracket.. it should be inside, to begin with.
Hmm Is it possible that you could script an example of a pickup that when the player picks it up it puts a message on screen?

because that would really help me
Reply
#5

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
The correct way to create a pickup is;

pawn Код:
// TOP
new pickup;

// OnGameModeInit
pickup = CreatePickup(id,type,x,y,z,vw);

// OnPlayerPickupPickup

if(pickupid == pickup)
{
// Something
}
When i compile with the if(pickupid == pickup) it says the pickupid is an undefined symbol :/
Reply
#6

pawn Код:
//Top of script
new example;
//Under OnGameModeInit();
example = CreatePickup(1239, 23, 380.4,2535.0,15.9, -1);
//....
public OnPlayerPickUpPickup(playerid, pickupid)
{
        if(pickupid == example)
        {
            return SendClientMessage(playerid, /*Color ID*/, "I got a message on da screen! FUK YES");
        }
    return 0;
}
If pickupid isnt compiling, then you onplayerpickup is fked up. make sure you have latest server files, and #include <a_samp> Is at top..
Reply
#7

Are you sure that you do It inside, the public function
pawn Код:
public OnPlayerPickupPickup(playerid, pickupid)
{
// INSIDE HERE
}
Reply
#8

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
Are you sure that you do It inside, the public function
pawn Код:
public OnPlayerPickupPickup(playerid, pickupid)
{
// INSIDE HERE
}
I just realized i dont have the onPlayerPickup(playerid, Pickupid);

which part of the script do i put it in?
Reply
#9

under any other callback.

or under another curly brace "}"

sheesh.
Reply
#10

Lets say you have;

pawn Код:
public OnGameModeInit()
{
// ur code
}
Post it here;

pawn Код:
public OnGameModeInit()
{
// ur code
}

public OnPlayerPickupPickup(playerid, pickupid) // Like this
{

}
And NOT
pawn Код:
public OnPlayerPickupPickup(playerid, pickup); // !!! NOT THE ;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)