[Ajuda] OnPlayerConnect
#7

pawn Код:
public OnPlayerConnect(playerid)
{
    //VIP
    LoadPlayerVIP(playerid);
    //________
    new samp[128];
    GetPlayerVersion(playerid, samp, 128);
    if(strcmp(samp, "unknown", false) == 0)
        return BanEx(playerid, "BOT"); //Proteзгo by NicK

    //Mudarnick
    MudarNick[playerid] = false;
    //Musica
    PlayerPlaySound(playerid, 1185, 0, 0, 0);
    //Escudo
    Equipamentos[playerid] = 0;
    //afk
    g_AFK[playerid] = false; // Definir g_AFK para false.
    //chat kill
    SendDeathMessage(INVALID_PLAYER_ID, playerid, 200);
    //loteria
    _BilheteComprado[playerid] = 0;
    /*ClassRank[playerid] = Create3DTextLabel(RankPlayer, 0x067D00FF, 0.0, 0.0, 0.0, 30.0, 0,1);*/
    /* -----------------------------------------------------------------------------------------------------*/
    // Tempo conectado /admins
    /* -----------------------------------------------------------------------------------------------------*/
    APlayerData[playerid][TempoConectado] = 0;
    GPSCasa[playerid] = false;
    /* -----------------------------------------------------------------------------------------------------*/
    // Get info da INC geoip
    /* -----------------------------------------------------------------------------------------------------
    GetPlayerGeoIP(playerid);*/

    /* -----------------------------------------------------------------------------------------------------*/
    // Speedometer setup
    /* -----------------------------------------------------------------------------------------------------*/
    Speedometer_Setup(playerid);

    /* -----------------------------------------------------------------------------------------------------*/
    // Remove objetos do desvio do tunel de SANTA MARIA LS
    /* -----------------------------------------------------------------------------------------------------*/
    RemoveBuildingForPlayer(playerid, 762, 1023.5938, -2050.6875, 16.0859, 0.25);
    RemoveBuildingForPlayer(playerid, 762, 1011.8594, -2043.5000, 16.0859, 0.25);
    /* -----------------------------------------------------------------------------------------------------*/
    // Textdraw /skin 0.3x
    /* -----------------------------------------------------------------------------------------------------*/
    gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    for(new x=0; x < SELECTION_ITEMS; x++)
    {
        gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
    }
 /* --------------------------------------------------------*/
    // Text Draw reloginho
    /* --------------------------------------------------------*/

    gItemAt[playerid] = 0;
 /* --------------------------------------------------------*/
    // Cabelo
    /* --------------------------------------------------------*/
    pHairSlot[playerid] = -1;
    /* --------------------------------------------------------*/
    // A
    /* --------------------------------------------------------*/
    if(!IsPlayerNPC(playerid)) pObject[playerid][slotreserved] = false;
    /* --------------------------------------------------------*/
    // Le o PM
    /* --------------------------------------------------------*/
    LerPms[playerid] = false;
    /* --------------------------------------------------------*/
    // Bloqueia pm
    /* --------------------------------------------------------*/
    PmBlock[playerid] = false;
    /* --------------------------------------------------------*/
    // Verifica se esta no evento
    /* --------------------------------------------------------*/
    PlayerInfo[playerid][NoEvento] = 0;
    /* --------------------------------------------------------*/
    // Verifica se estб no carro
    /* --------------------------------------------------------*/
    PlayerInfo[playerid][Carro] = 0;
    /* --------------------------------------------------------*/
    // CHECA SE O PLAYER ESTБ BANIDO
    /* --------------------------------------------------------*/
    ChecarBan(playerid);
    /* --------------------------------------------------------*/
    // Ultimo Login
    /* --------------------------------------------------------*/
    APlayerData[playerid][UltimoLogin] = 0;
    /* --------------------------------------------------------*/
    // Objetos removidos ''Doherty''
    /* --------------------------------------------------------*/
    RemoveBuildingForPlayer(playerid, 11091, -2133.5547, -132.7031, 36.1328, 0.25);
    RemoveBuildingForPlayer(playerid, 11376, -2144.3516, -132.9609, 38.3359, 0.25);
    RemoveBuildingForPlayer(playerid, 11011, -2144.3516, -132.9609, 38.3359, 0.25);
    RemoveBuildingForPlayer(playerid, 11009, -2128.5391, -142.8438, 39.1406, 0.25);
    RemoveBuildingForPlayer(playerid, 1278, -2137.6172, -110.9375, 48.3516, 0.25);
    RemoveBuildingForPlayer(playerid, 16615, -389.7656, 1515.1641, 74.5547, 0.25);
    RemoveBuildingForPlayer(playerid, 16616, -326.6953, 1541.3906, 74.5547, 0.25);
    RemoveBuildingForPlayer(playerid, 16751, -324.1484, 1302.2266, 52.6641, 0.25);
    RemoveBuildingForPlayer(playerid, 16143, -324.1484, 1302.2266, 52.6641, 0.25);
    RemoveBuildingForPlayer(playerid, 16144, -324.1484, 1302.2266, 52.6641, 0.25);
    RemoveBuildingForPlayer(playerid, 16137, -389.7656, 1515.1641, 74.5547, 0.25);
    RemoveBuildingForPlayer(playerid, 16138, -326.6953, 1541.3906, 74.5547, 0.25);
    //Avenida Lv e Obejtos dO Resgate Chegando Em Ls
    RemoveBuildingForPlayer(playerid, 11372, -2076.4375, -107.9297, 36.9688, 0.25);
    RemoveBuildingForPlayer(playerid, 11014, -2076.4375, -107.9297, 36.9688, 0.25);
    RemoveBuildingForPlayer(playerid, 9120, 2027.3906, 833.1172, 5.8750, 0.25);
    RemoveBuildingForPlayer(playerid, 9160, 2027.3906, 833.1172, 5.8750, 0.25);
    RemoveBuildingForPlayer(playerid, 1438, -109.1641, -1181.3438, 1.6719, 0.25);
    RemoveBuildingForPlayer(playerid, 1438, -84.2422, -1180.2656, 0.8516, 0.25);
    RemoveBuildingForPlayer(playerid, 1415, -77.2188, -1188.3672, 0.8359, 0.25);
    RemoveBuildingForPlayer(playerid, 1676, -92.1016, -1161.7891, 2.9609, 0.25);
    RemoveBuildingForPlayer(playerid, 1676, -97.0703, -1173.7500, 3.0313, 0.25);
    RemoveBuildingForPlayer(playerid, 1440, -103.6875, -1172.5781, 2.2656, 0.25);
    RemoveBuildingForPlayer(playerid, 17065, -90.1953, -1169.6719, 5.3125, 0.25);
    RemoveBuildingForPlayer(playerid, 1676, -85.2422, -1165.0313, 2.6328, 0.25);
    RemoveBuildingForPlayer(playerid, 1676, -90.1406, -1176.6250, 2.6328, 0.25);
    RemoveBuildingForPlayer(playerid, 17064, -75.4688, -1174.5469, 0.8750, 0.25);
    RemoveBuildingForPlayer(playerid, 1438, -77.4219, -1165.5547, 1.0234, 0.25);
    RemoveBuildingForPlayer(playerid, 1447, -89.9297, -1133.7500, 1.3906, 0.25);
    RemoveBuildingForPlayer(playerid, 1438, -87.0547, -1132.6797, 0.0469, 0.25);
    RemoveBuildingForPlayer(playerid, 1462, -79.2500, -1137.7188, 0.0547, 0.25);
    RemoveBuildingForPlayer(playerid, 3285, -73.8047, -1141.4219, 1.9844, 0.25);
    RemoveBuildingForPlayer(playerid, 1462, -84.3750, -1116.0938, 0.2578, 0.25);
    RemoveBuildingForPlayer(playerid, 1447, -84.0547, -1117.2188, 1.3906, 0.25);
    RemoveBuildingForPlayer(playerid, 1462, -60.3594, -1116.9375, 0.2578, 0.25);
    RemoveBuildingForPlayer(playerid, 1438, -63.6719, -1125.6953, 0.0469, 0.25);
    RemoveBuildingForPlayer(playerid, 1438, -63.4141, -1115.4141, 0.0469, 0.25);
/*  //Agencia Bancбria SF
    RemoveBuildingForPlayer(playerid, 10317, -2655.1250, -15.4219, 23.8125, 0.25);
    RemoveBuildingForPlayer(playerid, 10368, -2655.1250, -15.4219, 23.8125, 0.25);
    RemoveBuildingForPlayer(playerid, 10716, -2655.1250, -15.4219, 23.8125, 0.25);
    */

    GetPlayerGeoIP(playerid);
    /* --------------------------------------------------------*/
    // Sempre permitir NPCs fazer o login sem senha ou conta
    /* --------------------------------------------------------*/
    if(IsPlayerNPC(playerid))
            return 1;
    /* --------------------------------------------------------*/
    // Configurar as variбveis ??locais
    /* --------------------------------------------------------*/
    new Name[MAX_PLAYER_NAME], HouseID;
    /* -----------------------------------------------------------------------------------------------------------------------*/
    // // Configurar um PVR para permitir cross-script de dinheiro-transferкncias (somente a partir filterscript para este script principal) e marcar pontos
    /* -----------------------------------------------------------------------------------------------------------------------*/
    SetPVarInt(playerid, "PVarMoney", 0);
    SetPVarInt(playerid, "PVarScore", 0);
    GetPlayerName(playerid, Name, sizeof(Name));
    GetPlayerName(playerid, APlayerData[playerid][PlayerName], 24);
    new serial[128], Ip[25];
    GetPlayerIp(playerid, Ip, sizeof(Ip));
    /* --------------------------------------------------------*/
    // Serial BAN
    /* --------------------------------------------------------*/
    gpci(playerid, serial, sizeof(serial));
    new Stringw[800], NomeR[34], IP[30], Strna[800], IPa[30], NomeaR[34];
    if(DOF2_IsSet("ServerData/BanSerial.txt", serial))
    {
        new JogadorNome[24], String[512];
        GetPlayerIp(playerid, Ip, sizeof(Ip));
        GetPlayerName(playerid, JogadorNome, sizeof(JogadorNome));
        format(String, sizeof(String), "\n                {FFFFFF}*~*Informaзхes Sobre o Banimento *~*\n\nVocк estб Banido Permanentemente do Servidor (AMC)\nCaso Ache isso um BUG Faзa Revisгo em Nosso Forum!!\n\n\n{FF0000}Seus Dados:\n\n{CCCCCC}Seu Nome: {FFFFFF}%s\n{CCCCCC}Seu IP: {FFFFFF}%s\n{CCCCCC}Seu Serial: {FFFFFF}%s\n\n\n\n{CCCCCC}Forum: {FFFF00}automais.sampforum.net", JogadorNome, Ip, serial, DOF2_GetString("ServerData/BanSerial.txt", serial));
        ShowPlayerDialog(playerid, DIALOG_BANIDO, DIALOG_STYLE_MSGBOX, "{00FF00}ж {FFFFFF}Banido permanentemente!", String, "Fechar", "");
        return 1;
    }      
    else if(PlayerFile_Load(playerid) == 1)
    {
        GetPlayerName(playerid, NomeR, sizeof(NomeR));
        GetPlayerIp(playerid, IP, 30);
        new dia, mes, hora, minuto;
        dia = DOF2_GetInt(ObterConta(playerid), "Dia");
        mes = DOF2_GetInt(ObterConta(playerid), "Mes");
        hora = DOF2_GetInt(ObterConta(playerid), "Hora");
        minuto = DOF2_GetInt(ObterConta(playerid), "Minuto");
        format(Stringw, sizeof(Stringw), "%s{FF8000}» Auto Mais Caminhoneiro «\n\n{999999}Sua Conta: {FFFFFF}%s\n{999999}Seu IP: {FFFFFF}%s\n{999999}Status: {00FF00}Registrada\n{999999}Ultimo Login:{FFFFFF}%s~%s~%s>%s %d:%d:%d:%d:%d:%d: %s<%s~%s~%s \n\n{838B8B}\n\n{FF8000}Digite sua senha para logar!", Stringw, NomeR, IP, dia, mes, hora, minuto, Hora, Minuto, Segundo, Dia, Mes, Ano);
  //    Verifique se o jogador ainda й proibido
        if (APlayerData[playerid][BanTime] < gettime()) // Jogador ban-tempo й passado
            ShowPlayerDialog(playerid, DialogLogin, DIALOG_STYLE_PASSWORD, "{00FF00}ж {FFFFFF}Insira sua senha para logar:", Stringw, TXT_DialogLoginButton1, TXT_DialogButtonCancel);
        else // Jogador ainda й proibido
        {
            ShowRemainingBanTime(playerid); // Mostrar o restante tempo proibiзгo para o jogador й dias, horas, minutos, segundos
            Kick(playerid); // Chute o jogador
        }
    }
   
    else if (PlayerFile_Load(playerid) == 0)
    {
        GetPlayerName(playerid, NomeaR, sizeof(NomeaR));
        GetPlayerIp(playerid, IPa, 30);
        format(Strna, sizeof(Strna), "%s{FF8000}» Auto Mais Caminhoneiro «\n\n{999999}Sua Conta: {FFFFFF}%s\n{999999}Seu IP: {FFFFFF}%s\n{999999}Status: {FF0000}Nгo registrada\n\n{FF8000}Digite uma senha para registrar-se no servidor!", Strna, NomeaR, IPa);
        LoginMsg(playerid);
        ShowPlayerDialog(playerid, DialogRegister, DIALOG_STYLE_INPUT, "{00FF00}ж {FFFFFF}Registre-se em nosso servidor:", Strna, TXT_DialogRegisterButton1, TXT_DialogButtonCancel);
    }
    // Tas casas foram carregados, mas nгo os carros, tгo alto todos os veнculos designados para as casas de jogadores
    for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
    {
        // Obter o houseid desta ranhura
        HouseID = APlayerData[playerid][Houses][HouseSlot];
        // Verifique se hб uma casa neste slot
        if (HouseID != 0)
        {
            HouseFile_Load(HouseID, true); // Coloque os carros da casa
        }
    }
    /* --------------------------------------------------------*/
    // Text Draw box mission
    /* --------------------------------------------------------*/
    APlayerData[playerid][MissionText] = TextDrawCreate(320.0, 430.0, " "); // Configurar o texto missгo, na parte inferior da tela
    TextDrawAlignment(APlayerData[playerid][MissionText], 2); // Alinhar o texto missгo ao centro
    TextDrawFont(APlayerData[playerid][MissionText], 2);
    TextDrawLetterSize(APlayerData[playerid][MissionText], 0.260000, 1.400000);
    TextDrawColor(APlayerData[playerid][MissionText], -1);
    TextDrawSetProportional(APlayerData[playerid][MissionText], 1);
    TextDrawSetShadow(APlayerData[playerid][MissionText], 1);
    TextDrawUseBox(APlayerData[playerid][MissionText], 1); // Definir o texto missгo de mostrar dentro de uma caixa
    TextDrawBoxColor(APlayerData[playerid][MissionText], 0x386DFF11); // Defina a cor da caixa de texto 0000FF missгo
    TextDrawSetOutline(APlayerData[playerid][MissionText], 1);

    /* --------------------------------------------------------*/
    // MSG LOGAR
    /* --------------------------------------------------------*/
    SendClientMessage(playerid, -1, "{FF0000}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    SendClientMessage(playerid, -1, "");
    SendClientMessage(playerid, -1, "                  Brasil Auto Mais Caminhoneiro             ");
    SendClientMessage(playerid, -1, "");
    SendClientMessage(playerid, -1, "{FF0000}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        //Frase
    new file [ 50 ],
                    tito [ 100 ];

    CkeckNick ( playerid ) ;

    format ( file , sizeof ( file ) , NFST , PlayerNameF[ playerid ] ) ;

    if( !DOF2_FileExists ( file ) )
    {
        DOF2_CreateFile ( file );
        DOF2_SetString ( file , "Frase",  "Sem Frase Brasil Auto Mais Caminhoneiro" ) ;
        DOF2_SaveFile();
    }

    format ( tito , sizeof ( tito ) , "{00ff00}Frase ao Conectar de %s:{0000FF} %s ", PlayerNameF[ playerid ] , DOF2_GetString ( file , "Frase" ) ) ;
    SendClientMessageToAll ( -1 , tito);
    return 1;
}
Reply


Messages In This Thread
OnPlayerConnect - by GHLEMES - 13.06.2014, 20:37
Re: OnPlayerConnect - by Dolby - 13.06.2014, 21:00
Re: OnPlayerConnect - by Cor3y - 13.06.2014, 21:01
Re: OnPlayerConnect - by GHLEMES - 13.06.2014, 21:13
Re: OnPlayerConnect - by Dolby - 13.06.2014, 21:19
Re: OnPlayerConnect - by GHLEMES - 14.06.2014, 01:10
Re: OnPlayerConnect - by PT - 14.06.2014, 12:52
Re: OnPlayerConnect - by GHLEMES - 14.06.2014, 18:45
Re: OnPlayerConnect - by GHLEMES - 14.06.2014, 21:44
Re: OnPlayerConnect - by PT - 14.06.2014, 22:32

Forum Jump:


Users browsing this thread: 1 Guest(s)