How can I count my pickups?
#1

I make pickups for hidden packages ( 1276, tiki pickup from Vice City ). And I want to count it. When I pickup the first one, it'll make a game text: Hidden Packages 1 / 5, and when you pickup the 2nd, the game textes: Hidden Packages 2 / 5, and so on. How Can I make this? [Sorry For My Bad English, but I'm from Hungary];
Reply
#2

public OnPlayerPickUpPickup(playerid, pickupid)
Reply
#3

I would use this way.

pawn Код:
new VCPickup[5];
new PlayerFindHidden[MAX_PLAYERS];

VCPickup[0] = CreatePickup..
VCPickup[1] = CreatePickup..
....

OnPlayerPickupPickup(playerid,pickupid)
for(new i = 0; i < sizeof(VCPickup); i++)
{
    if(pickupid == VCPickup[i])
    {
        new string[128];
        PlayerFindHidden[playerid]++;
        format(string,sizeof(string),"You found hidden packages %d/5",PlayerFindHidden[playerid]);
        GameTextForPlayer(playerid,string,3000,3);
        DestroyPickup(VCPickup[i]);

    }
}
Reply
#4

Thanks a lot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)