SA-MP Forums Archive
Some more pickup 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: Some more pickup help.. (/showthread.php?tid=351462)



Some more pickup help.. - nogh445 - 16.06.2012

So I have it set up and it compiles but when I walk into the pickup it wont put me into the interior.
Code:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid, 1318 == house)
    {
        SetPlayerInterior(playerid, 5);
        SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250);
        return 1;
    }
    return 1;
}



Re: Some more pickup help.. - [NWA]Hannes - 16.06.2012

Quote:
Originally Posted by nogh445
Посмотреть сообщение
So I have it set up and it compiles but when I walk into the pickup it wont put me into the interior.
Code:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == house)
    {
        SetPlayerInterior(playerid, 5);
        SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250);
        return 1;
    }
    return 1;
}



Re: Some more pickup help.. - iggy1 - 16.06.2012

Pickupid isn't the model of the pickup, it's the internal id. Assign the value returned by "CreatePickup" to a var. This is the pickupid.

pawn Код:
house = CreatePickup(...);//house now holds this pickups ID (pickupid)
Then OnPlayerPickUpPickup

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == house)
    {
        SetPlayerInterior(playerid, 5);
        SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250);
        return 1;
    }
    return 1;
}
EDIT: Too slow.


Re: Some more pickup help.. - nogh445 - 16.06.2012

Quote:
Originally Posted by [NWA]Hannes
Посмотреть сообщение
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == house)
    {
        SetPlayerInterior(playerid, 5);
        SetPlayerPos(playerid, 1267.663208,-781.323242,1091.906250);
        return 1;
    }
    return 1;
}
Worked. Thanks a bunch!