27.02.2014, 17:51
So I have played around with Checkpoints, but it seems that the server is lagging too much when I am detecting checkpoints. This is what I've got.
Any help would be appreciated.
pawn Код:
public OnPlayerUpdate(playerid)
{
new wID = GetPlayerVirtualWorld(playerid);
for(new o = 1; o<1000; o++)
{
if(IsPlayerInRangeOfPoint(playerid, 5, hInfo[o][hEx], hInfo[o][hEy], hInfo[o][hEz]) && hInfo[o][CP] == 0)
{
hInfo[o][CP] = CreateDynamicCP(hInfo[o][hEx], hInfo[o][hEy], hInfo[o][hEz], 1, -1, -1, -1, 100);
}
if(!IsPlayerInRangeOfPoint(playerid, 5, hInfo[o][hEx], hInfo[o][hEy], hInfo[o][hEz]) && hInfo[o][CP] != 0)
{
DestroyDynamicCP(hInfo[o][CP]);
hInfo[o][CP] = 0;
}
if(!IsPlayerInRangeOfPoint(playerid, 2, hInfo[wID][hExitx], hInfo[wID][hExity], hInfo[wID][hExitz]) && AtHExit[playerid] == 1)
{
AtHExit[playerid] = 0;
PlayerTextDrawHide(playerid, DoorDraw[playerid]);
}
}
}