SA-MP Forums Archive
Streamer Checkpoints - 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: Streamer Checkpoints (/showthread.php?tid=497604)



Streamer Checkpoints - Gilbonzo - 27.02.2014

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.

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]);
        }
    }
}
Any help would be appreciated.


Re: Streamer Checkpoints - Gilbonzo - 27.02.2014

Bump, plz help