LoadGas();
stock LoadGas()
{
new s = sizeof(FuelTanks);
for(new i=0;0<s;i++)
{
CreateDynamicObject(3465, FuelTanks[i][0], FuelTanks[i][1], FuelTanks[i][2], 0.00000, 0.00000, FuelTanks[i][3]);
new gas[50];
format(gas,50,"Gas Tank\n/v fill yo use\n%d$ per liter", gasprice);
Create3DTextLabel(gas, COLOR_WHITE, FuelTanks[i][0], FuelTanks[i][1], FuelTanks[i][2], 32.0, 0, 0);
}
return 1;
}
forward LoadGas();
public LoadGas()
{
new s = sizeof(FuelTanks);
for(new i=0;0<s;i++)
{
CreateDynamicObject(3465, FuelTanks[i][0], FuelTanks[i][1], FuelTanks[i][2], 0.00000, 0.00000, FuelTanks[i][3]);
new gas[50];
format(gas,50,"Gas Tank\n/v fill yo use\n%d$ per liter", gasprice);
Create3DTextLabel(gas, COLOR_WHITE, FuelTanks[i][0], FuelTanks[i][1], FuelTanks[i][2], 32.0, 0, 0);
}
return 1;
}

forward LoadGas();
public LoadGas()
{
new gas[50];
for(new i = 0, s = sizeof(FuelTanks); i < s; i++)
{
CreateDynamicObject(3465, FuelTanks[i][0], FuelTanks[i][1], FuelTanks[i][2], 0.00000, 0.00000, FuelTanks[i][3]);
format(gas,50,"Gas Tank\n/v fill yo use\n%d$ per liter", gasprice);
Create3DTextLabel(gas, COLOR_WHITE, FuelTanks[i][0], FuelTanks[i][1], FuelTanks[i][2], 32.0, 0, 0);
}
return true;
}
|
Look at this line:
for(new i=0;0<s;i++) For a start, if you spaced it out, it's easier to read: for(new i=0; 0<s; i++) Then you may notice the second expression is wrong. It's causing an infinite loop, because 's' will always be 1+, so 'while 0 is less than 1/2/3/etc.' is always going to be true. It's meant to be i, not 0. |