SA-MP Forums Archive
How can I count my pickups? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can I count my pickups? (/showthread.php?tid=163871)



How can I count my pickups? - taki5baj - 29.07.2010

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];


Re: How can I count my pickups? - 3ventic - 29.07.2010

public OnPlayerPickUpPickup(playerid, pickupid)


Re: How can I count my pickups? - ikey07 - 29.07.2010

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]);

    }
}



Re: How can I count my pickups? - taki5baj - 29.07.2010

Thanks a lot!