13.12.2011, 13:43
hi .. i was scripting a fuel system with fuel bars ((include and when i almost finished it it gave me errors i dont know how to solve them could you help me ?
these are the errors
and here is the fuel script were the errors are located.
hope someone can help me ^^
these are the errors
pawn Код:
D:\sa-mp server\gamemodes\base.pwn(3006) : error 035: argument type mismatch (argument 2)
D:\sa-mp server\gamemodes\base.pwn(3008) : error 035: argument type mismatch (argument 2)
D:\sa-mp server\gamemodes\base.pwn(3572) : warning 204: symbol is assigned a value that is never used: "vid"
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
bar_fuel[playerid] = CreateProgressBar(548.5, 36.0, _, _, 0x00FF00FF, 1000.0);
ShowProgressBarForPlayer(playerid, bar_fuel)//3006
} else {
HideProgressBarForPlayer(playerid, bar_fuel)//3008
}
return 1;
}
pawn Код:
public timer_fuel_lower()
{
for(new i=0;i<MAX_PLAYERS;i++) {
if (isrefuelling[i]) continue;
new vid = GetPlayerVehicleID(i);
if (GetPlayerVehicleSeat(i) == 0) { )
fuel[vid] = fuel[vid] -1;
if (fuel[vid]<1)
{
fuel[vid] = 0;
RemovePlayerFromVehicle(i);
GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,4);
}
}
SetProgressBarValue(bar_fuel[i], fuel[vid]);
UpdateProgressBar(bar_fuel[i], i);
}
return 1;
}
public timer_refuel(playerid)
{
new vid = GetPlayerVehicleID(playerid); //3572
isrefuelling[playerid] = 0;
SetProgressBarValue(bar_fuel[playerid], 100);
UpdateProgressBar(bar_fuel[playerid], playerid);
}