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; }
And add 'return 1;' to the end of each pickup code |
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;
}
Pickup1 = CreatePickup(1550, 2, BagPos[0], BagPos[1], BagPos[2], -1);
Pickup2 = CreatePickup(1254, 2, BagPos[0], BagPos[1], BagPos[2], -1);
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);