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; }
//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; }
//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; } Код:
//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; } |
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;
}