OnPlayerPickUpPickup Help
#1

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
Reply
#2

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.
Reply
#3

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
Reply
#4

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

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.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)