SA-MP Forums Archive
Pickups Problem - 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: Pickups Problem (/showthread.php?tid=558826)



Pickups Problem - Arxalan - 19.01.2015

Hello , i made pickup inside Ammunation . The pickup is visible but the OnPlayerPickupPickup Don't work .

Following is my OnPlayerPickupPickup code.
PHP код:
if(pickupid == Skills_Point)
    {
        
SetPlayerInterior(playerid,7);
        return 
1;
    } 
I want to set the player interior to Ammunation booths and its interior id is 7 but it isn't working.


Re: Pickups Problem - Diti1 - 19.01.2015

do you get any error ?


Re: Pickups Problem - Arxalan - 19.01.2015

nah , no errors.


Re: Pickups Problem - Ironboy - 19.01.2015

Use SetPlayerPos along with that.


Re: Pickups Problem - VishvaJeet - 19.01.2015

if you are using CreatePickup() then use
pawn Код:
new Skills_Point =  CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);

OnPlayerPickUpPickup(playerid,  pickupid)
{
    if(pickupid == Skills_Point)
    {
        SetPlayerInterior(playerid,7);
        return 1;
    }
}
else if you are using CreateDynamicPickup() then use
pawn Код:
new Skills_Point =  CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);

OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    if(pickupid == Skills_Point)
    {
        SetPlayerInterior(playerid,7);
        return 1;
    }
}



Re: Pickups Problem - Arxalan - 19.01.2015

Quote:
Originally Posted by VishvaJeet
Посмотреть сообщение
if you are using CreatePickup() then use
pawn Код:
new Skills_Point =  CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);

OnPlayerPickUpPickup(playerid,  pickupid)
{
    if(pickupid == Skills_Point)
    {
        SetPlayerInterior(playerid,7);
        return 1;
    }
}
I am using this command but it isn't working.


Re: Pickups Problem - Matess - 19.01.2015

Well show us your CreatePickup code and as someone said above -> setting interior isnt enough, you need also setplayerpos


Re: Pickups Problem - Arxalan - 19.01.2015

Quote:
Originally Posted by Matess
Посмотреть сообщение
Well show us your CreatePickup code and as someone said above -> setting interior isnt enough, you need also setplayerpos
PHP код:
new Skills_Point;
public 
OnGameModeInit()
{
 
Skills_Point=  CreatePickup(bla bla bla);
}
Public 
OnPlayerPickUpPickup(playerid,  pickupid)
{
    if(
pickupid == Skills_Point)
    {
        
SetPlayerInterior(playerid,7);
        return 
1;
    }

Where to set SetPlayerPos?


Re: Pickups Problem - Matess - 19.01.2015

bla bla bla... TYPE OF PICKUP IS ALSO IMPORTANT! Not every type cooperate with onplayerpickup and pos is here for example : http://weedarr.wikidot.com/interior


Re: Pickups Problem - Arxalan - 19.01.2015

Quote:
Originally Posted by Matess
Посмотреть сообщение
bla bla bla... TYPE OF PICKUP IS ALSO IMPORTANT! Not every type cooperate with onplayerpickup and pos is here for example : http://weedarr.wikidot.com/interior
PHP код:
new Skills_Point
public 
OnGameModeInit() 

 
Skills_Point=  Skills_Point CreatePickup(1318,1,286.2281,-30.3801,1001.5156,0);

Public 
OnPlayerPickUpPickup(playerid,  pickupid

    if(
pickupid == Skills_Point
    { 
        
SetPlayerInterior(playerid,7); 
        return 
1
    } 

The exact cooredinates and model and spawn types of that pickups are above .
I know the interior and i selected from it which is id 7.