20.12.2013, 10:12
Hello everyone I am having problem with these checkpoints the thing is that whenever I am near a point I want that there will appear the checkpoint at the point where I am near to, but unfortunately it doesn't even appear. Okay so when the checkpoint should appear and whenever I go away from the checkpoint I want it to be deleted or destroyed however when I am coming to the point the server just start lagging as hell. here the code:
Any help is appreciated! If you need my code in OnPlayerEnterDynamicCP just tell me.
Код:
public OnPlayerUpdate(playerid)
{
new Float:X, Float:Y, Float:Z;
for(new o = 1; o<1000; o++)
{
if(IsPlayerInRangeOfPoint(playerid, 5, hInfo[o][hEx], hInfo[o][hEy], hInfo[o][hEz]) && AtHouse[playerid] == 0)
{
X = hInfo[o][hEx];
Y = hInfo[o][hEy];
Z = hInfo[o][hEz];
AtHouse[playerid] = CreateDynamicCP(hInfo[o][hEx], hInfo[o][hEy], hInfo[o][hEz], 1, -1, -1, -1, 100);
}
if(!IsPlayerInRangeOfPoint(playerid, 5, X, Y, Z) && AtHouse[playerid] != 0)
{
DestroyDynamicCP(AtHouse[playerid]);
DisablePlayerCheckpoint(playerid);
}
}
}

