[Ajuda] de um simples cуdigo
#1

Tenho um cуdigo aqui na public onplayerconnect que й:
Код:
	{
  		new string[256];
		format(string, 256, "%s estб online.", plname);
    	SendClientMessageToAll(0xFF0000AA ,string);
	}
Queria saber se eu botase no onplayerdisconnect ele iria funcionar do mesmo jeito? exemplo
Код:
	{
  		new string[256];
		format(string, 256, "%s estб offline.", plname);
    	SendClientMessageToAll(0xFF0000AA ,string);
	}
Reply
#2

Sim funcionara certinho
Reply
#3

DICA: diminua o valor da string
pawn Код:
{
        //new string[256];  256 й um valor muito grande vocк nгo vai usar nem METADE
        new string[40];
        format(string, sizeof(string), "%s estб offline.", plname);
        SendClientMessageToAll(0xFF0000AA ,string);
    }
Reply
#4

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    switch(reason)
    {
        case 0: format(string, sizeof(string), "{00D5FF}%s {FFFFFF}se desconectou do servidor. {7CFC00}[Crash]", GetPlayerNameEx(playerid));
        case 1: format(string, sizeof(string), "{00D5FF}%s {FFFFFF}se desconectou do servidor. {7CFC00}[Conta Prуpria]", GetPlayerNameEx(playerid));
        case 2: format(string, sizeof(string), "{00D5FF}%s {FFFFFF}se desconectou do servidor. {7CFC00}[Kickado ou Banido]", GetPlayerNameEx(playerid));
        SendClientMessageToAll(-1, string);
    }
    return 1;
}
pawn Код:
stock GetPlayerNameEx(playerid)
{
    new STRING[MAX_PLAYER_NAME];
    GetPlayerName(playerid, STRING, sizeof STRING);
    return STRING;
}
Reply
#5

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
DICA: diminua o valor da string
pawn Код:
{
        //new string[256];  256 й um valor muito grande vocк nгo vai usar nem METADE
        new string[40];
        format(string, sizeof(string), "%s estб offline.", plname);
        SendClientMessageToAll(0xFF0000AA ,string);
    }
ok, valeu, vou testar;
rep para ambos.
Reply
#6

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
DICA: diminua o valor da string
pawn Код:
{
        //new string[256];  256 й um valor muito grande vocк nгo vai usar nem METADE
        new string[40];
        format(string, sizeof(string), "%s estб offline.", plname);
        SendClientMessageToAll(0xFF0000AA ,string);
    }
diminua mais!

pawn Код:
{
        //new string[256];  256 й um valor muito grande vocк nгo vai usar nem METADE
        new string[15];
        format(string, sizeof(string), "%s estб offline.", plname);
        SendClientMessageToAll(0xFF0000AA ,string);
    }
Reply
#7

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
diminua mais!

pawn Код:
{
        //new string[256];  256 й um valor muito grande vocк nгo vai usar nem METADE
        new string[15];
        format(string, sizeof(string), "%s estб offline.", plname);
        SendClientMessageToAll(0xFF0000AA ,string);
    }
se o nome do player for 15 caracteres nгo irб aparecer o resto... 'Estб offline'..
Reply
#8

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
se o nome do player for 15 caracteres nгo irб aparecer o resto... 'Estб offline'..
pawn Код:
new string[MAX_PLAYER_NAME+10];
        format(string, sizeof(string), "%s estб offline.", plname);
        SendClientMessageToAll(0xFF0000AA ,string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)