SA-MP Forums Archive
Failed Compiling pickup - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Failed Compiling pickup (/showthread.php?tid=166854)



Failed Compiling pickup - bobintom - 10.08.2010

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


Re: Failed Compiling pickup - DiddyBop - 10.08.2010

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

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


Re: Failed Compiling pickup - Mike Garber - 10.08.2010

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
}



Re: Failed Compiling pickup - bobintom - 10.08.2010

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


Re: Failed Compiling pickup - bobintom - 10.08.2010

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 :/


Re: Failed Compiling pickup - DiddyBop - 10.08.2010

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..


Re: Failed Compiling pickup - Mike Garber - 10.08.2010

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



Re: Failed Compiling pickup - bobintom - 10.08.2010

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?


Re: Failed Compiling pickup - DiddyBop - 10.08.2010

under any other callback.

or under another curly brace "}"

sheesh.


Re: Failed Compiling pickup - Mike Garber - 10.08.2010

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 ;