[Ajuda] SetTimer
#1

Pessoal.

Qual o Mais Recomendado. - Leg Para o Servidor:


SetTimer - Atualizado Globalmente.

ou

SetTimerEx - Atualizado por Player.


Em Meu Servidor eu Uso:

CallBack OnGamemodeInit:

SetTimer("AtualizarTodos", 990, 1);//Timer de Atualizacao Global para Todos Do Servidor. Atualiza Score,Level etcc..
Em Textdraw..


Seria Mais Recomendado Criar um Timer Repetitivo para Cada Player?


vlw


#2 Duvida. Tem Como Melhorar Isto:

PHP код:
public VisibilityUpdate()////Creditos a Devastator - UGW
{
    new 
dist;
    new 
Float:xFloat:x1Float:yFloat:y1Float:tmp;
    for(new 
0<= MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
GetPlayerPos(ixytmp);
            for(new 
0<= MAX_PLAYERSj++)
            {
                if(
IsPlayerConnected(j) && != && Player[i][PlayerGPS] != j)
                {
                    
GetPlayerPos(jx1y1tmp);
                    
dist floatround(floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)+floatpower(floatabs(floatsub(y,y1)),2)));
                    if(
Player[i][PlayingWar] == true)
                    {
                        
SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000011));
                      }
                      else if(
GetPlayerVirtualWorld(j) == GetPlayerVirtualWorld(i) && GetPlayerVirtualWorld(i) == 24)
                      {
                          
SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x000000FF));
                      }
                    else if(
dist <= 300)
                    {
                        if( (
PlayerGang[i] != INVALID_GANG && PlayerGang[j] != INVALID_GANG && PlayerGang[i] == PlayerGang[j]) ||
                            (
PlayerGang[i] == T_LEI && Player[i][GangLevel] > && IsPlayerInRadarVehicle(i)) ||
                            (
VillageData[VILL_PALOMINO][Owner] == PlayerGang[i] && PlayerGang[i] != INVALID_GANG && IsPlayerInAnyVehicle(i)) )
                        {
                    
//        if(GetVehicleModel(GetPlayerVehicleID(i)) != 520)   // nгo aplicavel a hydra
                            
SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x000000EE));
                        }
                        else if(
Player[i][AdvancedRadar] == true && GetPlayerVehicleID(j) != 0)
                        {
                            
SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x000000EE));
                        }
                        else
                        {
                            
SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000001));
                        }
                    }
                    else if(
dist <= 400SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x000000AA));
                    else if(
dist <= 500SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000099));
                    else if(
dist <= 600SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000088));
                    else if(
dist <= 700SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000077));
                    else if(
dist <= 800SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000066));
                    else if(
dist <= 900SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000055));
                    else if(
dist <= 1000SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000044));
                    else if(
dist <= 1200SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000033));
                    else if(
dist <= 1400SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000022));
                    else if(
dist <= 1600SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000011));
                    else if(
dist <= 2000SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000011));
                    else 
SetPlayerMarkerForPlayer(ij, ((GetPlayerColor(j) & 0xFFFFFF00) | 0x00000011));
                    if(
GetPlayerInterior(i) != GetPlayerInterior(j)) SetPlayerMarkerForPlayer(ij, (GetPlayerColor(j) & 0xFFFFFF00));
                }
            }
        }
    }

- Isto Aumenta Leg Correto? й atualizado por Timer. a Cada Segundo ele Faz Loop. +Leg?
Reply


Messages In This Thread
SetTimer - by SeV_ - 19.05.2013, 15:36
Re: SetTimer - by .FuneraL. - 19.05.2013, 15:38
Re: SetTimer - by SeV_ - 19.05.2013, 17:05
Re: SetTimer - by zSuYaNw - 19.05.2013, 20:01
Re: SetTimer - by SeV_ - 19.05.2013, 20:23

Forum Jump:


Users browsing this thread: 1 Guest(s)