[SOLVED] Onplayerpickuppickup
#1

I am trying to make a pickup that teleports me somewhere.
I want it to be the pickup id 1273 that takes me there.
at the top of my gamemode i have

new Home;

next to my staticpickups( weapons) i have

Home = CreatePickup(1273, 2, 1300.7528,-795.9010,1084.007;

at the bottom of my gamemode i have

public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == Home)
{
SetPlayerPos(playerid,1299.7760,-791.3349,1084.007;
}
return 1;
}


It compiles, however when i stand over the pickup it has no effect and just dissappears.

Any help would be appreciated.
Reply
#2

Are you shoure you are not in a vehicle while entering that point ?
Reply
#3

Quote:
Originally Posted by Dj_maryo1993
Are you shoure you are not in a vehicle while entering that point ?
then it wouldnt dissappear
Reply
#4

its ok i done it now but i get unreachable code error when compiling!?

Line,

if (pickupid == Back)


Around it,


public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == Home)
{
SetPlayerPos(playerid,1298.3142,-797.9921,84.1406);
}
return 1;

if (pickupid == Back)

{
SetPlayerPos(playerid,1384.9432,-2487.6943,16.9050);
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)