Írtam neked egy teszt szkriptet.
Az /indit paranccsal tudod letesztelni!
#include a_samp
#include progress
#include zcmd
new Bar:bar;
public OnFilterScriptInit() {
bar = CreateProgressBar(264.00, 191.00, 116.50, 5.19, 12779519, 100.0);
SetProgressBarMaxValue(bar, 100);
return 1;
}
CMD:indit(playerid) {
SetPVarInt(playerid, \"bartimer\", SetTimerEx(\"progressbar\", 300, true, \"i\", playerid));
ShowProgressBarForPlayer(playerid, bar);
SetPVarInt(playerid, \"barvalue\", 0);
return 1;
}
forward progressbar(playerid);
public progressbar(playerid) {
SetPVarInt(playerid, \"barvalue\", GetPVarInt(playerid, \"barvalue\") +1);
SetProgressBarValue(bar, GetPVarInt(playerid, \"barvalue\"));
UpdateProgressBar(bar, playerid);
if(GetPVarInt(playerid, \"barvalue\") >= 100) {
KillTimer(GetPVarInt(playerid, \"bartimer\"));
HideProgressBarForPlayer(playerid, bar);
}
return 1;
}