[Help] Pickup Problem
#1

Код:
	Pickup1 = CreatePickup(1550, 2, BagPos[0], BagPos[1], BagPos[2], -1);
 	Pickup2 = CreatePickup(1254, 2, BagPos[0], BagPos[1], BagPos[2], -1);
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == Pickup1)
	{
		SendClientMessage(playerid, -1, "TEST 1");
		DestroyPickup(Pickup1);
  		if(PlayerInfo[playerid][CbPoint] >= 4)
  	 	{
	 	PlayerInfo[playerid][Exp]++;
    	              PlayerInfo[playerid][CbPoint] = 0;
  		SendClientMessage(playerid, COLOR_YELLOW, "You are getting stronger Exp +1");
  }
	 	for(new i = 0; i < MAX_PLAYERS; i++)
    	{
		RemovePlayerMapIcon( i, 25 );
    	}
 	}
	else if(pickupid == Pickup2)
	{
		SendClientMessage(playerid, -1, "TEST 2!");
		DestroyPickup(Pickup2); 
 		PlayerInfo[playerid][GbPoint]++;
  		if(PlayerInfo[playerid][GbPoint] >= 4)
  	 	{
	 	PlayerInfo[playerid][Exp]++;
    	               PlayerInfo[playerid][GbPoint] = 0;
  		SendClientMessage(playerid, COLOR_YELLOW, "You are getting stronger Exp +1");
		}
	 	for(new i = 0; i < MAX_PLAYERS; i++)
    	{
		RemovePlayerMapIcon( i, 26 );
    	}
 	}
	return 1;
	}
If i take the Pickup2 it gives me Pickup1 whats the problem?
Reply
#2

Try removing the 'else' on the start of the second pickup

And add 'return 1;' to the end of each pickup code
Reply
#3

I tried that dont helps

edit: If i change it to "if" onl, it gives me the both pickups
Reply
#4

Quote:

And add 'return 1;' to the end of each pickup code

i cant add "return1" end of the first pickup it gives me much errors... Can you show me how ?
Reply
#5

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Pickup1)
    {
        SendClientMessage(playerid, -1, "TEST 1");
        DestroyPickup(Pickup1);
        if(PlayerInfo[playerid][CbPoint] >= 4)
        {
            PlayerInfo[playerid][Exp]++;
            PlayerInfo[playerid][CbPoint] = 0;
            SendClientMessage(playerid, COLOR_YELLOW, "You are getting stronger Exp +1");
        }
        for(new i = 0; i < MAX_PLAYERS; i++)
            RemovePlayerMapIcon(i, 25);
        return 1;
    }
    if(pickupid == Pickup2)
    {
        SendClientMessage(playerid, -1, "TEST 2!");
        DestroyPickup(Pickup2);
        PlayerInfo[playerid][GbPoint]++;
        if(PlayerInfo[playerid][GbPoint] >= 4)
        {
            PlayerInfo[playerid][Exp]++;
            PlayerInfo[playerid][GbPoint] = 0;
            SendClientMessage(playerid, COLOR_YELLOW, "You are getting stronger Exp +1");
        }
        for(new i = 0; i < MAX_PLAYERS; i++)
            RemovePlayerMapIcon( i, 26 );
        return 1;
    }
    return 0;
}
and why pos are the same?
pawn Код:
Pickup1 = CreatePickup(1550, 2, BagPos[0], BagPos[1], BagPos[2], -1);
Pickup2 = CreatePickup(1254, 2, BagPos[0], BagPos[1], BagPos[2], -1);
Reply
#6

pos are different i forgot to change it here :P

hmm smth wrong getting much errors
Reply
#7

*bump*

If i take one it gives me both pickups
Reply
#8

U must have something wrong with BagPos[0], BagPos[1], BagPos[2]

Must be

pawn Код:
new BagPos[6];
Pickup1 = CreatePickup(1550, 2, BagPos[0], BagPos[1], BagPos[2], -1);
Pickup2 = CreatePickup(1254, 2, BagPos[3], BagPos[4], BagPos[5], -1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)