18.11.2013, 08:19
Hey all! I got a problem with my pickups IDs. I have a variable in which I store ID of the pickup for a gift. So when anyone walks through that pickup, it gives him something and then the pickup is deleted. But when I start my server, first pickup that is created is bugged. It has ID 0, and it shows completely different text that it should show.
Does anyone know why are my pickup IDs messed up? And one more thing, does CreatePickup creates a pickup with starting number of 1, or is it 0? Thank you
pawn Код:
EnterExitPU[7] = CreatePickup(1239, 1,-2571.4, 318.3, 10.6); // this pickup is for buying weed seeds
public OnPlayerPickUpPickup(playerid, pickupid)
{
// here are many other pickups stored in EnterExitPU array
if(pickupid == EnterExitPU[7])
{
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~y~/buyseeds",1000, 3);
// I dont see this text, which I should
}
for(new i=0;i<11;i++)
{
if(pickupid == ATMPickup[i])
{
// I see this text, which is for one of the ATM pickups placed somewhere in the town, and also, ATM pickups are created later on, so they got larger ID than previous pickups
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~g~/atm",1000, 3);
return 1;
}
}
return 1;
}