[SOLVED] Onplayerpickuppickup - 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: [SOLVED] Onplayerpickuppickup (
/showthread.php?tid=91349)
[SOLVED] Onplayerpickuppickup -
cozza123456 - 14.08.2009
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.
Re: [UNSOLVED] Onplayerpickuppickup -
Dj_maryo1993 - 14.08.2009
Are you shoure you are not in a vehicle while entering that point ?
Re: [UNSOLVED] Onplayerpickuppickup -
saiberfun - 14.08.2009
Quote:
Originally Posted by Dj_maryo1993
Are you shoure you are not in a vehicle while entering that point ?
|
then it wouldnt dissappear
Re: [UNSOLVED] Onplayerpickuppickup -
cozza123456 - 14.08.2009
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;
}