12.10.2015, 12:43
Ok, I decided to add some freeroam features to my server, /rainbow and /autofix
idk if thats caused by my internet (its a lil bit slow atm) or the server lags (its hosted in ultra h though)
however, i made 2 timers with 700 intervals, the first looping all online players and if the players activated the /rainbow, it simple change his vehicle colour, the other does the same but repairs the car instead.
my ping is 311 in the server (canada hosted -.-)
idk if the server lagging or its my internet, can someone tell me?
heres my timers code :S
P.S.: I was online alone in the server so, Not sure what happens if theres 40 players online lol..
idk if thats caused by my internet (its a lil bit slow atm) or the server lags (its hosted in ultra h though)
however, i made 2 timers with 700 intervals, the first looping all online players and if the players activated the /rainbow, it simple change his vehicle colour, the other does the same but repairs the car instead.
my ping is 311 in the server (canada hosted -.-)
idk if the server lagging or its my internet, can someone tell me?
heres my timers code :S
PHP код:
forward AutoFixCars();
public AutoFixCars()
{
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(AutoFix[i] == 1 && IsPlayerInAnyVehicle(i)) RepairVehicle(GetPlayerVehicleID(i));
}
}
forward RainbowCars();
public RainbowCars()
{
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerInAnyVehicle(i) && Rainbow[i] == 1)
{
new veh = GetPlayerVehicleID(i);
ChangeVehicleColor(veh, random(256), random(256));
}
}
}