SA-MP Forums Archive
[Ajuda] Comando travando o servidor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Comando travando o servidor (/showthread.php?tid=494786)



Comando travando o servidor - iHarzard - 14.02.2014

Bom, nunca tive um problema como este, o comando trava o samp-server por alguns segundos, onde nгo posso fazer nada mais no servidor durante esses segundos, nгo trava o GTA e sim o processo do servidor. Fiz tambйm esse debug para calcular o tempo que executa, e ficou com 6854 ms.

Tentei outros rtc, mais ficou do mesmo jeito, o que pode ser?

Comando:
pawn Код:
CMD:rtc(playerid)
{
    new count = GetTickCount();
    print("[debug] Play");
    new bool:vehicle[MAX_VEHICLES];
    for(new j = 1; GetVehicleModel(j); ++j)
    {
        vehicle[j] = false;
        for(new i, p = GetMaxPlayers(); i < p; ++i)
        {
            if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
            if(IsPlayerInVehicle(i, j))
            {
                vehicle[j] = true;
                break;
            }
        }
        if(!vehicle[j]) SetVehicleToRespawn(j);
    }
    printf("[debug] Time taken to execute respawn: %d", GetTickCount() - count);
    return 1;
}



Re: Comando travando o servidor - xXCallXX - 14.02.2014

usa asim vai fica de boa

pawn Код:
if (strcmp("/rtc", cmdtext, true, 10) == 0) {
{
    new count = GetTickCount();
    print("[debug] Play");
    new bool:vehicle[MAX_VEHICLES];
    for(new j = 1; GetVehicleModel(j); ++j)
    {
        vehicle[j] = false;
        for(new i, p = GetMaxPlayers(); i < p; ++i)
        {
            if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
            if(IsPlayerInVehicle(i, j))
            {
                vehicle[j] = true;
                break;
            }
        }
        if(!vehicle[j]) SetVehicleToRespawn(j);
    }
    printf("[debug] Time taken to execute respawn: %d", GetTickCount() - count);
    return 1;
}



Re: Comando travando o servidor - iHarzard - 14.02.2014

Quote:
Originally Posted by xXCallXX
Посмотреть сообщение
usa asim vai fica de boa

pawn Код:
if (strcmp("/autos", cmdtext, true, 10) == 0) {
{
    new count = GetTickCount();
    print("[debug] Play");
    new bool:vehicle[MAX_VEHICLES];
    for(new j = 1; GetVehicleModel(j); ++j)
    {
        vehicle[j] = false;
        for(new i, p = GetMaxPlayers(); i < p; ++i)
        {
            if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
            if(IsPlayerInVehicle(i, j))
            {
                vehicle[j] = true;
                break;
            }
        }
        if(!vehicle[j]) SetVehicleToRespawn(j);
    }
    printf("[debug] Time taken to execute respawn: %d", GetTickCount() - count);
    return 1;
}
O que vocк mudou? Sу deixou em strcmp, eu uso zcmd amigo.


Re: Comando travando o servidor - xXCallXX - 14.02.2014

sim tabem estava com isso no meu e fiz isso e ficou de boa tudo la


Re: Comando travando o servidor - RayksonCouto - 14.02.2014

Quote:
Originally Posted by xXCallXX
Посмотреть сообщение
usa asim vai fica de boa

pawn Код:
if (strcmp("/rtc", cmdtext, true, 10) == 0) {
{
    new count = GetTickCount();
    print("[debug] Play");
    new bool:vehicle[MAX_VEHICLES];
    for(new j = 1; GetVehicleModel(j); ++j)
    {
        vehicle[j] = false;
        for(new i, p = GetMaxPlayers(); i < p; ++i)
        {
            if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
            if(IsPlayerInVehicle(i, j))
            {
                vehicle[j] = true;
                break;
            }
        }
        if(!vehicle[j]) SetVehicleToRespawn(j);
    }
    printf("[debug] Time taken to execute respawn: %d", GetTickCount() - count);
    return 1;
}