29.03.2014, 14:58
Hey
I want to make script with repair pickups, but there is bug with the pickup ID 14 in SAMP through objects.
Well, I thought to make with timer:
SetTimer("RepairPickup", 50, true);
and by loop:
The question if that will make lags with 50+ players?
I did the timer to "50" because if someone driving to fast he can miss the pickup.
I want to make script with repair pickups, but there is bug with the pickup ID 14 in SAMP through objects.
Well, I thought to make with timer:
SetTimer("RepairPickup", 50, true);
and by loop:
PHP код:
forward RepairPickups();
public RepairPickups()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerState(i) == 2)
{
for(new rep; rep < 100; rep++)
{
if(IsPlayerInRangeOfPoint(i, 5, RepairPickups[rep][Pos][0], RepairPickups[rep][Pos][1], RepairPickups[rep][Pos][2]))
{
RepairVehicle(GetPlayerVehicleID(i));
}
}
}
}
}
I did the timer to "50" because if someone driving to fast he can miss the pickup.