stock return floats
#1

I am have trouble with this function here. I probably don't have the correct way of returing the float it is giving me a warning

Код:
C:\Users\joshua\Desktop\sampserver\filterscripts\jbcars2.pwn(3342) : warning 208: function with tag result used before definition, forcing reparse
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2013, ITB CompuPhase


1 Warning.
pawn Код:
//all variables have been defined
stock Float:TakeGasOutOfRefinery(playerid,refineryid,Float:ammountofgas)//mark
{
    new numofoilstorage,Float:fuel;
    for(new count;count < MAX_OILPUMPS;count++)
    {
        if((oilstoragestate[count][refineryid])==1)
        {
            numofoilstorage ++;
        }
    }
    new Float:splitgas = ammountofgas / numofoilstorage;
    new Float:passon;
    for(new count;count < MAX_OILPUMPS;count++)
    {
        if((oilstoragestate[count][refineryid])==1)
        {
            new Float:currentsplitgas = splitgas;
            if((passon) > 0)
            {
                currentsplitgas = currentsplitgas + passon;
                passon = 0;
            }
            if((oilstoragefuel[count][refineryid])<currentsplitgas)
            {
                passon = splitgas - oilstoragefuel[count][refineryid];
            }
            else
            {
                oilstoragefuel[count][refineryid] = oilstoragefuel[count][refineryid] - currentsplitgas;
                fuel = fuel + currentsplitgas;
            }
        }
    }
    if((passon)> 0)
    {
        new str[256];
        format(str,sizeof(str),"you could not take %fL of fuel becuse the refinery does not have anymore",passon);
        SendClientMessage(playerid, RED , str);
    }
    return fuel;
}
Reply
#2

Add TakeGasOutOfRefinery function before the part you're using it or just add
pawn Код:
forward Float:TakeGasOutOfRefinery(playerid,refineryid,Float:ammountofgas);
under the includes/defines.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Add TakeGasOutOfRefinery function before the part you're using it or just add
pawn Код:
forward Float:TakeGasOutOfRefinery(playerid,refineryid,Float:ammountofgas);
under the includes/defines.
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)