help with arrays
#5

Quote:
Originally Posted by shitbird
Посмотреть сообщение
God damnit. Disregard my comment about the null character, I messed up when I was reading your code.
I'm not entirely sure on your code, I'll see if I can find out, otherwise wait for someone else.

EDIT: I guess you will have to do something like this, unless someone else can help you out.

pawn Код:
#include    <a_samp>

// new pickup[] = {0, 1, 2, 3};
// new pickup[4];

public OnGameModeInit()
{
    pickup[0] = CreatePickup(params);
    pickup[1] = CreatePickup(params);
    pickup[2] = CreatePickup(params);
    pickup[3] = CreatePickup(params);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    for(new i = 0; i<sizeof(pickup); i++)
    if(pickupid == pickup[i]) GivePlayerMoney(playerid,10000);
    return 1;
}
I tried something else... I tried to not define slots, like this: "new a[] = {"m4");"
and it work....


tnx anyway!
Reply


Messages In This Thread
help with arrays - by lidor5353 - 25.08.2012, 10:36
Re: help with arrays - by shitbird - 25.08.2012, 10:44
Re: help with arrays - by lidor5353 - 25.08.2012, 11:00
Re: help with arrays - by shitbird - 25.08.2012, 11:12
Re: help with arrays - by lidor5353 - 25.08.2012, 19:54

Forum Jump:


Users browsing this thread: 2 Guest(s)