How to get the result from multiple variable
#1

Help me to answer this questions.

I'm confused how to get the result from multiple variable, like how to make fish system to get weight of fish.
i write this code as example:

Код:
//-------
static 
    fishgrams[MAX_PLAYERS][5];

//------

public OnPlayerConnect(playerid)
{
    for(new i; i < 5; i++) {
        fishgrams[playerid][i] = random(100);
    }
    return 1;
}

//------

CMD:fishgrams(playerid, params[])
{
    //How can i get all variable value from fishgrams?
    //Like this?

    static 
        count = 0;
    for(new i; i < 5; i++) {
        count += fishgrams[playerid][i];
    }
    printf("You have weight %d lbs of fish.", count);
    return 1;
}
Or anyone have other method to get the result?.
Reply
#2

bump.
Reply
#3

I don't see any issue there. What's your problem? Can you print what your count variable contains?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)