PickUp mess up.
#1

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

Remove 'else'.
Reply
#3

Same thing.
Reply
#4

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;
}
Reply
#5

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

This doesn't work too.

Other solutions? Can it be bug from samp?
Reply
#7

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

Could someone help?
Reply
#9

BUMP
Reply
#10

It teleports you because of this

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


Forum Jump:


Users browsing this thread: 1 Guest(s)