[Ajuda] Como Fazer Isto?...
#3

Quote:
Originally Posted by AlisonPereira
Посмотреть сообщение
//quando o player Conectar
Код:
 na public OnPlayerConnect

new str[78], pnome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pnome, sizeof(pnome));
    format(str, sizeof(str), "{6495ED}%s {FFD700}(ID:%d){FF7F00} Entrou no Servidor.", pnome, playerid); //Entrou no Servidor
    SendClientMessageToAll(-1, str);
return 1;
}
//Quando o player Desconectar
Код:
 //na public OnPlayerDisconnect(playerid, reason)
{
        new
        szString[64],
        name[MAX_PLAYER_NAME];

    GetPlayerName(playerid, name, MAX_PLAYER_NAME);

    switch(reason)
    {
        case 0: format(szString, sizeof szString, "%s Deixou o servidor. (Tempo esgotado/Crash)", name);
        case 1: format(szString, sizeof szString, "%s Deixou o servidor. (Saindo)", name);
        case 2: format(szString, sizeof szString, "%s Deixou o servidor. (Kickado/Banido)", name);
    }

    SendClientMessageToAll(0xC4C4C4FF, szString);
    return 1;
}
ou....
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s Entrou no servidor.",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}

//OnPlayerDisconnect
public OnPlayerDisconnect(playerid, reason)
{
    new
        szString[64],
        playerName[MAX_PLAYER_NAME];
 
    GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
 
    new szDisconnectReason[3][] =
    {
        "Conexгo/Crash",
        "Vontade Prуpia",
        "Kick/Ban"
    };
 
    format(szString, sizeof szString, "%s saiu do servidor (%s).", playerName, szDisconnectReason[reason]);
 
    SendClientMessageToAll(0xC4C4C4FF, szString);
    return 1;
}
Reply


Messages In This Thread
Como Fazer Isto?... - by protork - 25.04.2014, 21:36
Re: Como Fazer Isto?... - by AlisonPereira - 25.04.2014, 21:46
Re: Como Fazer Isto?... - by D3M0LISH3R - 25.04.2014, 22:01
Re: Como Fazer Isto?... - by protork - 25.04.2014, 22:04

Forum Jump:


Users browsing this thread: 2 Guest(s)