[SOLVED] Problem with OnPlayerPickUpPickup.
#1

I'm trying to make some teleports.

4 hours searching and reading tutorials and I could not resolve alone, so I have to ask for help from you.

I'm using Double-O-Stream.
Quote:

new hospitalenter;
new hospitalexit;
new barenter;
new barexit;

Quote:

hospitalenter = CreatePickup(1318, 23, -1218.987100, 2397.302700, 134.264100);
hospitalexit = CreatePickup(1318, 23, -1310.2120361328, 6762.9248046875, 41.715350341797);
barenter = CreatePickup(1318, 23, -780.858200, 2404.935300, 157.063600);
barexit = CreatePickup(1318, 23, -2015.3364257813, 6646.5830078125, 72.319000);

Quote:

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == hospitalenter)
{
SetPlayerPos(playerid, -1310.2120361328, 6762.9248046875, 41.715350341797); //Enter hospital
SendClientMessage(playerid, 0xFFFFFFFF, "Entrou no Hospital Militar.");
return 1;
}
else if(pickupid == hospitalexit)
{
SetPlayerPos(playerid, -1218.9871, 2397.3027, 134.2641); //Exit hospital
SendClientMessage(playerid, 0xFFFFFFFF, "Saiu do Hospital Militar.");
return 1;
}
else if(pickupid == barenter)
{
SetPlayerPos(playerid, -2015.3364257813, 6646.5830078125, 72.319); //Enter bar
SendClientMessage(playerid, 0xFFFFFFFF, "Entrou no Bar Militar.");
return 1;
}
else if(pickupid == barexit)
{
SetPlayerPos(playerid, -780.8582, 2404.9353, 157.0636); //Exit bar
SendClientMessage(playerid, 0xFFFFFFFF, "Saiu do Bar Militar.");
return 1;
}
return 0;
}

And got this error:
Quote:

...\filterscripts\teste.pwn(404) : error 021: symbol already defined: "OnPlayerPickUpPickup"

Sorry if a silly mistake, but I'm starting scripting now.

Thanks for the attention.
Reply
#2

Search in your script (CTR+F) for "OnPlayerPickUpPickup". If it's already there, copy the code inside it. Next, delete that callback, and go to the other OnPlayerPickUpPickup" callback and paste the code inside that one.

Basically, what the error is saying is that you should only have one of these lines:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
Reply
#3

Quote:
Originally Posted by PinkMan
I'm trying to make some teleports.

4 hours searching and reading tutorials and I could not resolve alone, so I have to ask for help from you.

I'm using Double-O-Stream.
Quote:

new hospitalenter;
new hospitalexit;
new barenter;
new barexit;

Quote:

hospitalenter = CreatePickup(1318, 23, -1218.987100, 2397.302700, 134.264100);
hospitalexit = CreatePickup(1318, 23, -1310.2120361328, 6762.9248046875, 41.715350341797);
barenter = CreatePickup(1318, 23, -780.858200, 2404.935300, 157.063600);
barexit = CreatePickup(1318, 23, -2015.3364257813, 6646.5830078125, 72.319000);

Quote:

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == hospitalenter)
{
SetPlayerPos(playerid, -1310.2120361328, 6762.9248046875, 41.715350341797); //Enter hospital
SendClientMessage(playerid, 0xFFFFFFFF, "Entrou no Hospital Militar.");
return 1;
}
else if(pickupid == hospitalexit)
{
SetPlayerPos(playerid, -1218.9871, 2397.3027, 134.2641); //Exit hospital
SendClientMessage(playerid, 0xFFFFFFFF, "Saiu do Hospital Militar.");
return 1;
}
else if(pickupid == barenter)
{
SetPlayerPos(playerid, -2015.3364257813, 6646.5830078125, 72.319); //Enter bar
SendClientMessage(playerid, 0xFFFFFFFF, "Entrou no Bar Militar.");
return 1;
}
else if(pickupid == barexit)
{
SetPlayerPos(playerid, -780.8582, 2404.9353, 157.0636); //Exit bar
SendClientMessage(playerid, 0xFFFFFFFF, "Saiu do Bar Militar.");
return 1;
}
return 0;
}

And got this error:
Quote:

...\filterscripts\teste.pwn(404) : error 021: symbol already defined: "OnPlayerPickUpPickup"

Sorry if a silly mistake, but I'm starting scripting now.

Thanks for the attention.
There still is a other "OnPlayerPickUpPickup". Search it and delete, or put the code, you have in this one, into the other one. One of them has to be deleted, one way or the other.

Cheers.
Reply
#4

Thanks for clearing that up, I'm sure mine would've been to complex to understand.
Reply
#5

I thought about it, but has no other OnPlayerPickUpPickup.

Here is all the code: Pastebin deleted - problem solved.

** Objects deleted to prevent leech.
Reply
#6

Quote:
Originally Posted by PinkMan
I thought about it, but has no other OnPlayerPickUpPickup.

Here is all the code: http://pastebin.com/f41b9f4ed

** Objects deleted to prevent leech.
The error line is not correct anymore. Please tell me what line it is now (in the pastebin-version).
Reply
#7

Then Double-O-Stream has the callback already declared in the include file. Go into it and change it to something like OnPlayerPickUpPickupEx.
Reply
#8

Quote:
Originally Posted by DeathOnaStick
Quote:
Originally Posted by PinkMan
I thought about it, but has no other OnPlayerPickUpPickup.

Here is all the code: http://pastebin.com/f41b9f4ed

** Objects deleted to prevent leech.
The error line is not correct anymore. Please tell me what line it is now (in the pastebin-version).
Oh, sorry. Line 168.

Quote:
Originally Posted by _Xerxes_
Then Double-O-Stream has the callback already declared in the include file. Go into it and change it to something like OnPlayerPickUpPickupEx.
I will try this.
Reply
#9

Your suggest solved the problem, Xerxes. Thanks!
Thanks DeathOnaStick too.

Sorry double posting.
Reply
#10

No problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)