12.01.2017, 16:19
Hello all.
I try made a conquer script. But i have question. What is the best way to conquer a zone?
First: Use a SetTimer like ZoneUpdate and make a loop for all zones and check the time of players inside in zone and conquer area.
Second: Use OnPlayerUpdate for playerid and check if player is still in zone when time inside
What is the best way and why the other no?
What are the pros and cons of both in this case?
I try made a conquer script. But i have question. What is the best way to conquer a zone?
First: Use a SetTimer like ZoneUpdate and make a loop for all zones and check the time of players inside in zone and conquer area.
PHP код:
public ZoneUpdate()
{
Loop all zones
Check if zone have player inside
Check if Player inside
Check if player is in mode 'conquer zone'
Check the time of player inside with a var++
Check if time inside is the neccessary
conquer the zone
}
PHP код:
public OnPlayerUpdate(playerid)
{
Check if player is in mode 'conquer zone'
Check if player is insde a zone with a variable
Check the time with gettime of player inside
Check if time inside is the neccessary
Conquer the zone
}
What are the pros and cons of both in this case?