28.09.2011, 17:26
Quote:
Looks like thats your problem, your server is more or less doing an infinite loop. If i was you I'd find a better way of doing that. "IsVehicleCloseSpike" probably has a loop too (and range check maybe) so your embedding loops in a callback that gets called many times per second - per player..
|
pawn Код:
stock IsVehicleCloseSpike(playerid, vehicleid, Float:range)
{
new Float:vX, Float:vY, Float:vZ;
GetVehiclePos(vehicleid, vX, vY, vZ);
for(new i = 0; i < sizeof(SpikeData); i++)
{
if(IsPlayerInRangeOfPoint(playerid, range, SpikeData[i][SpikeX], SpikeData[i][SpikeY], SpikeData[i][SpikeZ])
&& IsPlayerInRangeOfPoint(playerid, range, vX, vY, vZ) && IsPlayerInAnyVehicle(playerid))
{
if(SpikeData[i][SpikeCreated] == 1)
{
return true;
}
}
}
return false;
}