[UNSOLVED] Onplayerpickuppickup
#1

I am trying to make it so that when a player walks on the pickup, it will teleport them to the inside of a building.
Heres What i am doing.

new Home;

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

}


It compiles but when i test it, it doesn't teleport me anywhere. What have i done wrong that has made it so when you stand on it it just disappears.

Any help is appreciated.
Reply
#2

You need to do it like:
pawn Код:
new Home = CreatePickup(..
https://sampwiki.blast.hk/wiki/CreatePickup
Reply
#3

ok so i done that but what do i put the in the brackets, new Home = CreatePickup(..
Reply
#4

ooh i see that website tells me ok thanks so much
Reply
#5

ok, so i still have problems, my compiler keeps not responding when i compile?!

"Pawn Compiler Library has stopped working."
Reply
#6

sorry for multiple posts,
now i get this error.
(6521) : error 010: invalid function or declaration

Heres line 6521,

pickup = CreatePickup( 1300.7528,-795.9010,1084.007;
Reply
#7

You're not using it correctly. Read this:
Quote:

CreatePickup(model, type, Float:X, Float:Y, Float:Z)
model The model ID you'd like for the pickup.
type The pickup spawn type, see further down this page.
Float:X The X-coordinate for the pickup to show.
Float:Y The Y-coordinate for the pickup to show.
Float:Z The Z-coordinate for the pickup to show.
Returns The PickupID.

Reply
#8

oh yes silly me, thanks
Reply
#9

wow errors are so annoying, i still get that error even after changing it?

(6521) : error 010: invalid function or declaration

lines,

new Home;
home = CreatePickup(1273, 2, 1300.7528,-795.9010,1084.007; (this ones line 6521)

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

}


Reply
#10

All pickups should be at OnGameModeInit callback.

And here is another mistake:
Quote:

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

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)