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


Messages In This Thread
How to get the result from multiple variable - by Jonggol - 09.10.2016, 10:23
Re: How to get the result from multiple variable - by Jonggol - 09.10.2016, 14:07
Re: How to get the result from multiple variable - by Skimmer - 09.10.2016, 14:47

Forum Jump:


Users browsing this thread: 1 Guest(s)