SA-MP Forums Archive
PickUp mess up. - 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: PickUp mess up. (/showthread.php?tid=549742)



PickUp mess up. - dan40o - 08.12.2014

I have 10-20 pickups. They are messed up.

Код:
if(pickupid == barpickup)
	{
            SetPlayerInterior(playerid, 11);
            SetPlayerPos(playerid, 502.1638,-71.0073,998.7578);
            return 1;
	}
	else if(pickupid == pickup)
	{
	    GivePlayerMoney(playerid, 62000);
	    DestroyPickup(pickup);
	    return 1;
        }
When i pickup 'barpickup' it gives me money and teleports me. Why?


Re: PickUp mess up. - Capua - 08.12.2014

Remove 'else'.


Re: PickUp mess up. - dan40o - 08.12.2014

Same thing.


Re: PickUp mess up. - Capua - 08.12.2014

Use return 1 only once at the end of the callback so like this:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == barpickup)
    {
        SetPlayerInterior(playerid, 11);
        SetPlayerPos(playerid, 502.1638,-71.0073,998.7578);
    }
    else if(pickupid == pickup)
    {
        GivePlayerMoney(playerid, 62000);
        DestroyPickup(pickup);
    }
    return 1;
}



Re : PickUp mess up. - ManuelNeuer - 08.12.2014

pawn Код:
}    return 1;}
Return like this


Re: PickUp mess up. - dan40o - 08.12.2014

This doesn't work too.

Other solutions? Can it be bug from samp?


Re : PickUp mess up. - ManuelNeuer - 08.12.2014

I'm not very sho but it's defenitly not a bug of SA-MP.


Re: PickUp mess up. - dan40o - 08.12.2014

Could someone help?


Re: PickUp mess up. - dan40o - 09.12.2014

BUMP


Re: PickUp mess up. - Puff - 09.12.2014

It teleports you because of this

PHP код:
if(pickupid == barpickup)
    {
        
SetPlayerInterior(playerid11);
        
SetPlayerPos(playerid502.1638,-71.0073,998.7578);
    }