SA-MP Forums Archive
OnPlayerPickUpPickup Help - 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)
+--- Thread: OnPlayerPickUpPickup Help (/showthread.php?tid=419262)



OnPlayerPickUpPickup Help - Lemonaidz - 28.02.2013

Hello, So im wanting to make an arrow and when i drive into it it teleports me to a set location, i can see the arrow and it teleports me when i step into it but wont when i drive onto it. Code :

Quote:

new pickup1;

Quote:

public OnGameModeInit()
pickup1 = CreatePickup(1318, 19, 974.5681,1399.5906,67.371;

Quote:

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup1)
{
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, -289.1765,1536.6274,75.5625);
}
else
{
SetPlayerPos(playerid, -289.1765,1536.6274,75.5625);
}
return 1;
}

Why wont this work? sorry im new to Scripting


Respuesta: OnPlayerPickUpPickup Help - Strier - 28.02.2013

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(playerid, -289.1765,1536.6274,75.5625);
        }
        else
        {
            SetPlayerPos(playerid, -289.1765,1536.6274,75.5625);
        }
    }
  return 1;
 }
Note this is untested.


Re: OnPlayerPickUpPickup Help - Lemonaidz - 28.02.2013

Hmm, Thx for code, still doesnt work, i can run into it and it will teleport me but i cant drive into it, Mabye i need a new object


Re: OnPlayerPickUpPickup Help - Lemonaidz - 28.02.2013

Bump, Anyone know, would be epic if i could get this working


Re: OnPlayerPickUpPickup Help - park4bmx - 28.02.2013

Yes the pickup spawn type u use is only for player on foot
https://sampwiki.blast.hk/wiki/PickupTypes
Take a look at N0: 14
That is what u need.


Re: OnPlayerPickUpPickup Help - Lemonaidz - 28.02.2013

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
Yes the pickup spawn type u use is only for player on foot
https://sampwiki.blast.hk/wiki/PickupTypes
Take a look at N0: 14
That is what u need.
Thx Heaps, Lol i feel stupid, was just looking at that chart, +rep