Ajuda.
#1

pawn Код:
#include <a_samp>
#include <dini>
#include <dudb>
#include <sscanf2>
#include <zcmd>


#define SetPlayerHoldingObject(%1, %2, %3,%4, %5, %6, %7, %8, %9) SetPlayerAttachedObject(%1, MAX_PLAYER_ATTACHED_OBJECTS - 1, %2, %3, %4, %5, %6, %7, %8, %9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1, MAX_PLAYER_ATTACHED_OBJECTS - 1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1, MAX_PLAYER_ATTACHED_OBJECTS - 1)


enum ipl
{
    administrador,
    sexo
}


new Aleatoriomsgs[][] =
{
    "Servidor em manutenзгo."
};

new Aleatoriocores[] =
{
    0x18FFFFAA,
    0xF8EB00AA,
    0x00E000AA,
    0x00E000AA,
    0xFF5900AA
};


new contagemc;


new arquivo[2*100];


new civil[MAX_PLAYERS];


new nome[MAX_PLAYER_NAME];


new informacoes[MAX_PLAYERS][ipl];


new bool: logado[MAX_PLAYERS], bool: iniciante[MAX_PLAYERS], bool: checkpoint[MAX_PLAYERS], bool: trabalhar[MAX_PLAYERS];


new Float: x[MAX_PLAYERS], Float: y[MAX_PLAYERS], Float: z[MAX_PLAYERS], Float: angulo[MAX_PLAYERS];


forward Contagem();
forward Mandarmsgs();
forward mensagempraadm(COLOR, const string[]);
forward ProxDetector(Float:radi, playerid, str[], col1, col2, col3, col4, col5);


command(adm, playerid, params[])
{
    if (informacoes[playerid][administrador] >= 1)
    {
        if (trabalhar[playerid] == false)
        {
            dini_IntSet(arquivo, "Pele", GetPlayerSkin(playerid) );
            trabalhar[playerid] = true;
            SetPlayerSkin(playerid, 294);
            SetPlayerHealth(playerid, 999);
            SetPlayerArmour(playerid, 999);
            SetPlayerAttachedObject(playerid, 2, 18930, 2, 0.145951, -0.043442, -0.010053, 1.504234, 0.415596, 320.469390);
            return 1;
        }

        if (trabalhar[playerid] == true)
        {
            if (IsPlayerAttachedObjectSlotUsed(playerid, 2) )
            {
                RemovePlayerAttachedObject(playerid, 2);
            }

            SetPlayerHealth(playerid, 100.0);
            SetPlayerArmour(playerid, 100.0);
            trabalhar[playerid] = false;
            SetPlayerSkin(playerid, dini_Int(arquivo, "Pele") );
            return 1;
        }
    }
   
    if (informacoes[playerid][administrador] <= 0)
    {
        SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo й um moderador.");
        return 1;
    }
    return 1;
}

command(daradmin, playerid, params[])
{
    GetPlayerName(playerid, nome, sizeof nome);

    if (strcmp(nome, "Jose_Freire", true) == 0 || strcmp(nome, "JoNaTHaN_BSC", true) == 0)
    {
        new id, level;
       
        if (sscanf(params, "ud", id, level) ) SendClientMessage(playerid, 0x68FFFFAA, "Use: /daradmin id level.");
       
        else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xB9FF18AA, "Jogador nгo conectado.");
       
        else
        {
            informacoes[id][administrador] = level;
            SendClientMessage(id, 0xF87C00AA, "Parabйns vocк entrou na administraзгo.");
        }
    }

    else
    {
        SendClientMessage(playerid, 0xBFC0C2FF, "Vocк nгo й o criador do servidor.");
    }
    return 1;
}

command(cv, playerid, params[])
{
    new idcarro, cor, cor2;

    if (informacoes[playerid][administrador] >= 3)
    {
        if (trabalhar[playerid] == true)
        {
            if (sscanf(params, "ddd", idcarro, cor, cor2) ) SendClientMessage(playerid, 0x68FFFFAA, "Use: /cv id cor primбria cor secundбria.");
           
            else if (idcarro < 400 || idcarro > 611) SendClientMessage(playerid, 0xB9FF18AA, "Id de 400 a 611.");
           
            else if (cor < 0 || cor > 126) SendClientMessage(playerid, 0xB9FF18AA, "Id de 0 a 126.");
           
            else
            {
                GetPlayerPos(playerid, x[playerid], y[playerid], z[playerid]);
                GetPlayerFacingAngle(playerid, angulo[playerid]);
                CreateVehicle(idcarro, x[playerid], y[playerid] + 2, z[playerid], angulo[playerid], cor, cor2, 10000);
            }
        }
       
        if (trabalhar[playerid] == false)
        {
            SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo estб trabalhando.");
        }
    }
   
    if (informacoes[playerid][administrador] <= 2)
    {
        SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo й um organizador.");
    }
    return 1;
}

command(repararv, playerid, params[])
{
    if (informacoes[playerid][administrador] >= 2)
    {
        if (trabalhar[playerid] == true)
        {
            if (IsPlayerInAnyVehicle(playerid) )
            {
                RepairVehicle(GetPlayerVehicleID(playerid) );
                SendClientMessage(playerid, 0xFFF310AA, "Veнculo reparado com sucesso.");
            }
       
            if (!IsPlayerInAnyVehicle(playerid) )
            {
                SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo estб em nenhum veнculo.");
            }
        }
       
        if (trabalhar[playerid] == false)
        {
            SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo estб trabalhando.");
        }
    }

    if (informacoes[playerid][administrador] <= 1)
    {
        SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo й um moderador.");
    }
    return 1;
}

command(tunarv, playerid, params[])
{
    if (informacoes[playerid][administrador] >= 4)
    {
        if (trabalhar[playerid] == true)
        {
            if (IsPlayerInAnyVehicle(playerid) )
            {
                ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "{FFFFFF}Tunagem", "{FFFFFF}Hidraulica\nNitro", "Selecionar", "Cancelar");
            }

            if (!IsPlayerInAnyVehicle(playerid) )
            {
                SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo estб em nenhum veнculo.");
            }
        }

        if (trabalhar[playerid] == false)
        {
            SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo estб trabalhando.");
        }
    }

    if (informacoes[playerid][administrador] <= 3)
    {
        SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo й um administrador.");
    }
    return 1;
}

command(contar, playerid, params[])
{
    new segundos, texto[500];
   
    if (informacoes[playerid][administrador] >= 1)
    {
        if (trabalhar[playerid] == true)
        {
            if (sscanf(params, "d", segundos) ) SendClientMessage(playerid, 0x68FFFFAA, "Use: /contar segundos.");
   
            else
            {
                GetPlayerName(playerid, nome, sizeof nome);
                contagemc = segundos;
                format(texto, sizeof texto, "O administrador %s iniciou uma contagem de %s segundos.", nome, segundos);
                SendClientMessageToAll(0x8308FFAA, texto);
                SetTimer("Contagem", 2000, false);
            }
        }
       
        if (trabalhar[playerid] == false)
        {
            SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo estб trabalhando.");
        }
    }

    if (informacoes[playerid][administrador] <= 0)
    {
        SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo й colaborador.");
    }
    return 1;
}

command(ir, playerid, params[])
{
    new idj, intid = GetPlayerInterior(idj), vid = GetPlayerVehicleID(playerid);

    if (informacoes[playerid][administrador] >= 1)
    {
        if (trabalhar[playerid] == true)
        {
            if (sscanf(params, "u", idj) ) SendClientMessage(playerid, 0x68FFFFAA, "Use: /ir id.");

            else if (idj == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xB9FF18AA, "Jogador nгo conectado.");

            else
            {
                GetPlayerPos(idj, x[playerid], y[playerid], z[playerid]);
           
                if (!IsPlayerInAnyVehicle(playerid) )
                {
                    SetVehiclePos(vid, x[playerid], y[playerid] + 2, z[playerid]);
                    SetPlayerPos(playerid, x[playerid], y[playerid] + 2, z[playerid]);
                    SetPlayerInterior(playerid, intid);
                }
               
                if (IsPlayerInAnyVehicle(playerid) )
                {
                    SetVehiclePos(vid, x[playerid], y[playerid] + 2, z[playerid]);
                    LinkVehicleToInterior(vid, intid);
                    SetPlayerPos(playerid, x[playerid], y[playerid] + 2, z[playerid]);
                    SetPlayerInterior(playerid, intid);
                }
            }
        }
       
        if (trabalhar[playerid] == false)
        {
            SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo estб trabalhando.");
        }
    }

    if (informacoes[playerid][administrador] <= 0)
    {
        SendClientMessage(playerid, 0xBFC0C2FF, "Vocк nгo й um colaborador");
    }
    return 1;
}

command(trazer, playerid, params[])
{
    new idf, intid = GetPlayerInterior(playerid), vid = GetPlayerVehicleID(idf);

    if (informacoes[playerid][administrador] >= 1)
    {
        if (trabalhar[playerid] == true)
        {
            if (sscanf(params, "u", idf) ) SendClientMessage(playerid, 0x68FFFFAA, "Use: /ir id.");

            else if (idf == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xB9FF18AA, "Jogador nгo conectado.");

            else
            {
                GetPlayerPos(playerid, x[playerid], y[playerid], z[playerid]);

                if (!IsPlayerInAnyVehicle(playerid) )
                {
                    SetVehiclePos(vid, x[playerid], y[playerid] + 2, z[playerid]);
                    SetPlayerPos(idf, x[playerid], y[playerid] + 2, z[playerid]);
                    SetPlayerInterior(idf, intid);
                }

                if (IsPlayerInAnyVehicle(playerid) )
                {
                    SetVehiclePos(vid, x[playerid], y[playerid] + 2, z[playerid]);
                    LinkVehicleToInterior(vid, intid);
                    SetPlayerPos(idf, x[playerid], y[playerid] + 2, z[playerid]);
                    SetPlayerInterior(idf, intid);
                }
            }
        }

        if (trabalhar[playerid] == false)
        {
            SendClientMessage(playerid, 0xB9FF18AA, "Vocк nгo estб trabalhando.");
        }
    }

    if (informacoes[playerid][administrador] <= 0)
    {
        SendClientMessage(playerid, 0xBFC0C2FF, "Vocк nгo й um colaborador");
    }
    return 1;
}


main()
{
    print("\nServidor conectado\n");
}


public OnGameModeInit()
{
    UsePlayerPedAnims();
    SetGameModeText("Bsc");
    SetTimer("Mandarmsgs", 300000, 1);
    AddPlayerClass(0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
    AddStaticVehicle(462, 1562.51904297, -2338.48339844, 13.21709442, 90.00000000, -1, 1);
    AddStaticVehicle(462, 1562.44750977, -2334.94116211, 13.21709442, 90.00000000, -1, -1);
    AddStaticVehicle(462, 1562.40856934, -2331.87475586, 13.22153664, 90.00000000, -1, -1);
    AddStaticVehicle(462, 1562.53649902, -2328.61914062, 13.22187996, 90.00000000, 6, 1);
    AddStaticVehicle(462, 1562.54785156, -2325.38549805, 13.22191048, 90.00000000, 3, 1);
    AddStaticVehicle(462, 1562.53295898, -2322.26831055, 13.22187042, 90.00000000, -1, -1);
    AddStaticVehicle(462, 1562.58117676, -2318.79101562, 13.22200012, 90.00000000, -1, -1);
    return 1;
}

public OnGameModeExit()
{
    print("\nServidor desconectado\n");
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    static
        sNick[20],
        iBurlo = 0,
        sChars[56],
        iLenChars,
        iLenNick,
        iUnder;

    sChars = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz_", iBurlo = 0,
    GetPlayerName(playerid, sNick, 22), iUnder = 0,
    iLenNick = strlen(sNick),
    iLenChars = strlen(sChars);

    for(new i; i < iLenNick; i++)
    {
        for(new a; a < iLenChars; ++a)
        {
            if(sNick[i] != sChars[a] && sNick[i] != sChars[a] - 64)
                ++iBurlo;

        }
       
        if(sNick[i] == '_')
            ++iUnder;
    }

    if(iBurlo == ( iLenChars * iLenNick ) - iLenNick && iUnder == 1)
    {
        GetPlayerName(playerid, nome, sizeof nome);

        format(arquivo, sizeof arquivo, "contas/%s.ini", nome);
   
        if (!fexist(arquivo) )
        {
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{FFFFFF}Registro", "{FFFFFF}Bem vindo.\nPor favor digite uma senha:", "Registrar-me", "");
        }

        if (fexist(arquivo) )
        {
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{FFFFFF}Login", "{FFFFFF}Por favor digite sua senha:", "Logar-me", "");
        }
    }
   
    else
    {
        ShowPlayerDialog(playerid, 6, DIALOG_STYLE_MSGBOX, "{FFFFFF}Aviso", "{FFFFFF}Neste servidor sу й permitido nome com letra maiъscula e minъscula, com uma\nunderline no meio. Troque seu nome e volte novamente.", "Sair", "");
        Kick(playerid);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    GetPlayerName(playerid, nome, sizeof nome);
    format(arquivo, sizeof arquivo, "contas/%s.ini", nome);

    if (fexist(arquivo) )
    {
        GetPlayerPos(playerid, x[playerid], y[playerid], z[playerid]);
        GetPlayerFacingAngle(playerid, angulo[playerid]);
        dini_IntSet(arquivo, "Civil", civil[playerid]);
        dini_IntSet(arquivo, "Dinheiro", GetPlayerMoney(playerid) );
        dini_IntSet(arquivo, "Interior", GetPlayerInterior(playerid) );
        dini_IntSet(arquivo, "Level", GetPlayerScore(playerid) );
        dini_IntSet(arquivo, "Level procurado", GetPlayerWantedLevel(playerid) );
        dini_IntSet(arquivo, "Level administrativo", informacoes[playerid][administrador]);
        dini_FloatSet(arquivo, "X", x[playerid]);
        dini_FloatSet(arquivo, "Y", y[playerid]);
        dini_FloatSet(arquivo, "Z", z[playerid]);
        dini_FloatSet(arquivo, "Вngulo", angulo[playerid]);
       
        if (trabalhar[playerid] == false)
        {
            dini_IntSet(arquivo, "Pele", GetPlayerSkin(playerid) );
        }
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    format(arquivo, sizeof arquivo, "contas/%s.ini", nome);

    if (logado[playerid] == false)
    {
        Kick(playerid);
        return 1;
    }

    if (civil[playerid] == 1)
    {
        SetPlayerColor(playerid, 0xFFFFFFFF);
    }

    if (iniciante[playerid] == true)
    {
        if (informacoes[playerid][sexo] == 1)
        {
            SetPlayerSkin(playerid, 60);
        }

        if (informacoes[playerid][sexo] == 2)
        {
            SetPlayerSkin(playerid, 56);
        }

        SetPlayerPos(playerid, 1612.4882, -2329.4709, 13.5469);
        SetPlayerFacingAngle(playerid, 358.4933);
        SendClientMessage(playerid, 0x33CCFFAA, "Caso tenha dъvidas digite o comando /ajuda.");
        iniciante[playerid] = false;
        return 1;
    }

    x[playerid] = dini_Float(arquivo, "X");
    y[playerid] = dini_Float(arquivo, "Y");
    z[playerid] = dini_Float(arquivo, "Z");
    angulo[playerid] = dini_Float(arquivo, "Вngulo");
    SetPlayerPos(playerid, x[playerid],  y[playerid], z[playerid]);
    SetPlayerFacingAngle(playerid, angulo[playerid]);
    SetPlayerSkin(playerid, dini_Int(arquivo, "Pele") );
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    new texto[500];
   
    GetPlayerName(playerid, nome, sizeof nome);
    format(texto, sizeof texto, "%s diz: %s", nome, text);
    ProxDetector(13.0, playerid, texto, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
    return 0;
}

/*public OnPlayerCommandText(playerid, cmdtext[])
{
    new idx, cmd[500], texto[500];
    cmd = strtok(cmdtext, idx);

    if (strcmp("/gps", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "{FFFFFF}Gps", "{FFFFFF}Lugares do governo", "Selecionar", "Cancelar");
        return 1;
    }
   
    if (strcmp("/admins", cmdtext, true, 10) == 0)
    {
        admins(playerid);
        return 1;
    }
   
    if (strcmp(cmd, "/reportar", true) == 0)
    {
        GetPlayerName(playerid, nome, sizeof nome);
   
        new length = strlen(cmdtext);
       
        while ((idx < length) && (cmdtext[idx] <= ' ') )
        {
            idx++;
        }
       
        new offset = idx;
        new result[64];
       
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1) ) )
        {
            result[idx - offset] = cmdtext[idx];
            idx++;
        }
       
        result[idx - offset] = EOS;
       
        if (!strlen(result) )
        {
            SendClientMessage(playerid, 0x7D2803FF, "Use: /reportar texto.");
            return 1;
        }
       
        format(texto, sizeof texto, "O jogador %s disse: %s", nome, (result) );
        SendClientMessage(playerid, 0x33CCFFAA, "Mensagem enviada com sucesso.");
        mensagempraadm(0x597D3EAA, texto);
        return 1;
    }
   
    if (strcmp(cmd, "/mall", true) == 0)
    {
        if (informacoes[playerid][administrador] >= 1 || strcmp(nome, "ANTONIO_NUNES", true) == 0)
        {
            GetPlayerName(playerid, nome, sizeof nome);
       
            new length = strlen(cmdtext);

            while ((idx < length) && (cmdtext[idx] <= ' ') )
            {
                idx++;
            }

            new offset = idx;
            new result[64];

            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1) ) )
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }

            result[idx - offset] = EOS;

            if (!strlen(result) )
            {
                SendClientMessage(playerid, 0x7D2803FF, "Use: /mall texto.");
                return 1;
            }
       
            format(texto, sizeof texto, "O administrador %s disse: %s", nome, (result) );
            SendClientMessageToAll(0x597D3EAA, texto);
            return 1;
        }
       
        if (informacoes[playerid][administrador] <= 0)
        {
            SendClientMessage(playerid, 0xBFC0C2FF, "Vocк nгo й um moderador.");
            return 1;
        }
        return 1;
    }

    if (strcmp("/adm", cmdtext, true, 10) == 0)
    {
        if (informacoes[playerid][administrador] >= 1)
        {
            if (trabalhar[playerid] == false)
            {
                dini_IntSet(arquivo, "Pele", GetPlayerSkin(playerid) );
                trabalhar[playerid] = true;
                SetPlayerSkin(playerid, 294);
                SetPlayerHealth(playerid, 999);
                SetPlayerArmour(playerid, 999);
                SetPlayerAttachedObject(playerid, 2, 18930, 2, 0.145951, -0.043442, -0.010053, 1.504234, 0.415596, 320.469390);
                return 1;
            }
       
            if (trabalhar[playerid] == true)
            {
                if (IsPlayerAttachedObjectSlotUsed(playerid, 2) )
                {
                    RemovePlayerAttachedObject(playerid, 2);
                }
           
                SetPlayerHealth(playerid, 100.0);
                SetPlayerArmour(playerid, 100.0);
                trabalhar[playerid] = false;
                SetPlayerSkin(playerid, dini_Int(arquivo, "Pele") );
                return 1;
            }
        }
       
        if (informacoes[playerid][administrador] <= 0)
        {
            SendClientMessage(playerid, 0xBFC0C2FF, "Vocк nгo й um moderador.");
            return 1;
        }
        return 1;
    }
   
    if(strcmp(cmd, "/ir", true) == 0)
    {
        new tmp[500];
   
        if (informacoes[playerid][administrador] >= 1)
        {
            if (logado[playerid] == true)
            {
                tmp = strtok(cmdtext, idx);
           
                if (!strlen(tmp) )
                {
                    SendClientMessage(playerid, 0xBFC0C2FF, "Use: /ir id.");
                    return 1;
                }
               
                new ida, Float: idxc, Float: idy, Float: idz;
               
                ida = ReturnUser(tmp);
               
                if (logado[ida] == true)
                {
                    if (ida != INVALID_PLAYER_ID)
                    {
                        if (trabalhar[playerid] == false)
                        {
                            SendClientMessage(playerid, 0x7D2803FF, "Vocк nгo estб trabalhando.");
                            return 1;
                        }
                       
                        GetPlayerPos(ida, idxc, idy, idz);
                       
                        new idint = GetPlayerInterior(ida);

                        if (IsPlayerInAnyVehicle(playerid) )
                        {
                            new tmpcar = GetPlayerVehicleID(playerid);
                           
                            SetVehiclePos(tmpcar, idxc, idy + 4, idz);
                            SetPlayerInterior(playerid, idint);
                            LinkVehicleToInterior(ida, idint);
                        }
                       
                        else
                        {
                            SetPlayerPos(playerid, idxc, idy + 2, idz);
                            SetPlayerInterior(playerid, idint);
                        }
                    }
                   
                    if (ida == INVALID_PLAYER_ID)
                    {
                        SendClientMessage(playerid, 0xBFC0C2FF, "Este jogador nгo estб conectado.");
                        return 1;
                    }
                }
                return 1;
            }
           
            if (informacoes[playerid][administrador] <= 0)
            {
                SendClientMessage(playerid, 0xBFC0C2FF, "Vocк nгo й um moderador.");
                return 1;
            }
            return 1;
        }
        return 1;
    }
    return SendClientMessage(playerid, 0xBFC0C2FF, "Comando inexistente.");
}*/


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if (checkpoint[playerid] == true)
    {
        DisablePlayerCheckpoint(playerid);
    }
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new carroatual = GetPlayerVehicleID(playerid);

    GetPlayerName(playerid, nome, sizeof nome);
    format(arquivo, sizeof arquivo, "contas/%s.ini", nome);

    if (dialogid == 1)
    {
        if (response)
        {
            if (strlen(inputtext) == 0)
            {
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{FFFFFF}Registro", "{FFFFFF}Por favor digite algo:", "Registrar-me", "");
                return 0;
            }

            if (!fexist(arquivo) )
            {
                dini_Create(arquivo);
                dini_IntSet(arquivo, "Senha", udb_hash(inputtext) );
                ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "{FFFFFF}Sexo", "{FFFFFF}Selecione o seu sexo.", "Masculino", "Feminino");
            }
        }
    }

    if (dialogid == 2)
    {
        if (response)
        {
            if (strlen(inputtext) == 0)
            {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{FFFFFF}Login", "{FFFFFF}Por favor digite algo:", "Logar-me", "");
                return 0;
            }

            if (fexist(arquivo) )
            {
                new senha = dini_Int(arquivo, "Senha");

                if (udb_hash(inputtext) != senha)
                {
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{FFFFFF}Login", "{FFFFFF}Por favor digite a senha correta:", "Logar-me", "");
                    return 1;
                }

                if (udb_hash(inputtext) == senha)
                {
                    SendClientMessage(playerid, 0xE80B00AA, "Por motivos de seguranзa clique em spawn.");
                    civil[playerid] = dini_Int(arquivo, "Civil");
                    SetPlayerMoney(playerid, dini_Int(arquivo, "Dinheiro") );
                    SetPlayerInterior(playerid, dini_Int(arquivo, "Interior") );
                    SetPlayerScore(playerid, dini_Int(arquivo, "Level") );
                    SetPlayerWantedLevel(playerid, dini_Int(arquivo, "Level procurado") );
                    informacoes[playerid][administrador] = dini_Int(arquivo, "Level administrativo");
                    logado[playerid] = true;
                    return 1;
                }
            }
        }
    }

    if (dialogid == 3)
    {
        if (response)
        {
            informacoes[playerid][sexo] = 1;
            iniciante[playerid] = true;
            logado[playerid] = true;
            civil[playerid] = 1;
            SpawnPlayer(playerid);
            SetSpawnInfo(playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
        }

        else
        {
            informacoes[playerid][sexo] = 2;
            iniciante[playerid] = true;
            civil[playerid] = 1;
            logado[playerid] = true;
            SpawnPlayer(playerid);
            SetSpawnInfo(playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
        }
    }
   
    if (dialogid == 4)
    {
        if (response)
        {
            ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "{FFFFFF}Gps - lugares governamentais", "{FFFFFF}Estacionamento pъblico", "Selecionar", "Voltar");
        }
       
        else
        {
            SendClientMessage(playerid, 0x667800AA, "Vocк cancelou.");
        }
    }
   
    if (dialogid == 5)
    {
        if (response)
        {
            SetPlayerCheckpoint(playerid, 1546.9358, -2324.6958, 13.5547, 3.0);
            checkpoint[playerid] = true;
        }
       
        else
        {
            ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "{FFFFFF}Gps", "{FFFFFF}Lugares do governo", "Selecionar", "Cancelar");
        }
    }
   
    if (dialogid == 7)
    {
        if (response)
        {
            if (listitem == 0)
            {
                AddVehicleComponent(carroatual, 1087);
                SendClientMessage(playerid, 0xFFF310AA, "Veнculo tunado com sucesso.");
            }
           
            if (listitem == 1)
            {
                ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "{FFFFFF}Tunagem - nitro", "{FFFFFF}2\n5\n10", "Selecionar", "Voltar");
            }
        }
       
        else
        {
            SendClientMessage(playerid, 0x667800AA, "Vocк cancelou.");
        }
    }
   
    if (dialogid == 8)
    {
        if (response)
        {
            if (listitem == 0)
            {
                AddVehicleComponent(carroatual, 1009);
                SendClientMessage(playerid, 0xFFF310AA, "Veнculo tunado com sucesso.");
            }
           
            if (listitem == 1)
            {
                AddVehicleComponent(carroatual, 1008);
                SendClientMessage(playerid, 0xFFF310AA, "Veнculo tunado com sucesso.");
            }
           
            if (listitem == 2)
            {
                AddVehicleComponent(carroatual, 1010);
                SendClientMessage(playerid, 0xFFF310AA, "Veнculo tunado com sucesso.");
            }
        }
        else
        {
            ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "{FFFFFF}Tunagem", "{FFFFFF}Hidraulica\nNitro", "Selecionar", "Cancelar");
        }
    }
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}

public mensagempraadm(COLOR, const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if (logado[i] == true)
        {
            if (informacoes[i][administrador] >= 1)
            {
                SendClientMessage(i, COLOR, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}

public ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {

                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                {
                    SendClientMessage(i, col1, str);
                }
                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                {
                    SendClientMessage(i, col2, str);
                }
                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                {
                    SendClientMessage(i, col3, str);
                }
                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                {
                    SendClientMessage(i, col4, str);
                }
                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                {
                    SendClientMessage(i, col5, str);
                }
            }
        }
    }
    return 1;
}

public Mandarmsgs()
{
    new random1 = random(sizeof Aleatoriocores);
    new random2 = random(sizeof Aleatoriomsgs);
   
    SendClientMessageToAll(Aleatoriocores[random1], Aleatoriomsgs[random2]);
    return 1;
}

public Contagem()
{
    new texto[256];
   
    if (contagemc > 0)
    {
        format(texto, sizeof texto, "~w~%d", contagemc);
        GameTextForAll(texto, 1000, 5);
        contagemc --;
        SetTimer("Contagem", 1000, 0);
    }
}

stock admins(playerid)
{
    new texto[500];

    for(new i = 0; i <= MAX_PLAYERS; ++i)
    {
        if (logado[playerid] == true)
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "| Administradores |");
       
            GetPlayerName(i, nome, sizeof nome);

            if (informacoes[i][administrador] == 1)
            {
                format(texto, sizeof texto, "{FFFFFF}| %s | - Colaborador.", nome);
                SendClientMessage(playerid, 0xFFFFFFFF, texto);
            }

            if (informacoes[i][administrador] == 2)
            {
                format(texto, sizeof texto, "{FFFFFF}| %s | - Moderador.", nome);
                SendClientMessage(playerid, 0xFFFFFFFF, texto);
            }

            if (informacoes[i][administrador] == 3)
            {
                format(texto, sizeof texto, "{FFFFFF}| %s | - Organizador.", nome);
                SendClientMessage(playerid, 0xFFFFFFFF, texto);
            }

            if (informacoes[i][administrador] == 4)
            {
                format(texto, sizeof texto, "{FFFFFF}| %s | - Administrador.", nome);
                SendClientMessage(playerid, 0xFFFFFFFF, texto);
            }

            if (informacoes[i][administrador] == 5)
            {
                format(texto, sizeof texto, "{FFFFFF}| %s | - Dono do servidor.", nome);
                SendClientMessage(playerid, 0xFFFFFFFF, texto);
            }
        }
        return 1;
    }
    return 1;
}
O comando /contar nгo estб funcionando alguйm poderia consertб-lo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)