23.08.2013, 18:33
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;
}