17.02.2011, 19:41
Hi,
So i made a script for my RPG/DM server, the script is working fine, but the timer buggs a little.
Now, the 'Filling:%d' is doing well untill it comes to 50, then it jumps every 5 seconds over 6 or 8 percent(so adding percentage very fast).
That's the bug.... Anyone knows whats the problem?
Tnx.
EDIT: Oh, and yes i forwarded the functions, no errors no warnings.
So i made a script for my RPG/DM server, the script is working fine, but the timer buggs a little.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new playerState;
playerState = GetPlayerState(playerid);
if(Shipment == 1)
{
if(playerState == 2)
{
if(Full != 100)
{
new string[128];
TextDrawShowForPlayer(playerid,Textdraw1[playerid]);
filling = SetTimer("Filling", 5000, true);
format(string, 64, "~w~Filling: ~g~~h~%d~w~%.",Full);
TextDrawSetString(Textdraw1[playerid], string);
}
else if(Full == 100)
{
return 1;
}
}
else
{
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"The Ship didn't bring the cargo yet!");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
TextDrawHideForPlayer(playerid,Textdraw1[playerid]);
KillTimer(punjenje);
return 1;
}
public Filling(playerid)
{
new string[128];
if(Full == 98)
{
Full = 100;
SendClientMessage(playerid, COLOR_YELLOW, "The truck is full, now hit to the Headquarters!");
TextDrawHideForPlayer(playerid,Textdraw1[playerid]);
KillTimer(filling);
SetPlayerCheckpoint(playerid,2217.5591,-1165.9092,25.7266,7.0);
}
else
{
Full += 2;
format(string, 64, "~w~Filling: ~g~~h~%d~w~%.", Full);
TextDrawSetString(Textdraw1[playerid], string);
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(Full == 100 && IsPlayerInRangeOfPoint(playerid,7.0,2217.5591,-1165.9092,25.7266))
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_GREEN,"You have successfully delivered the cargo to your Headquarters!");
Shipment = 0;
shipment = SetTimer("Shipment",1800000,false); // so half hour
}
return 1;
}
That's the bug.... Anyone knows whats the problem?
Tnx.
EDIT: Oh, and yes i forwarded the functions, no errors no warnings.