fuelbar errors - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: fuelbar errors (
/showthread.php?tid=303410)
fuelbar errors -
demonarn - 13.12.2011
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
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"
and here is the fuel script were the errors are located.
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);
}
hope someone can help me ^^
Re: fuelbar errors -
TheArcher - 13.12.2011
What's the lines 3006, 3008 and 3572?
Re: fuelbar errors -
demonarn - 13.12.2011
they are shown now
Re: fuelbar errors -
Phanto90 - 13.12.2011
Код:
bar_fuel[playerid] = CreateProgressBar(548.5, 36.0, _, _, 0x00FF00FF, 1000.0);
Creating 3 textdraw for each player? Isn't it a bit inefficient?
Create the Textdrawboxes by yourself instead and use 3 for all players.
Re: fuelbar errors -
demonarn - 13.12.2011
but can i make them like hp boxes ? and can you show me how ?