[Ajuda] Quebra de linha
#1

Jб procurei em outras abas, fiz adaptando para minha GM e nгo deu muito certo, nгo quebra a linha ainda.

Code:
CMD:me(playerid, params[])
{
	new acao[500], texto[500];
	if(sscanf(params,"s", acao)) return msg(playerid, C_Laranja, "Use: /me(eu) [acao].");
	if(strlen(acao) > 36){
		new primeiralinha[64];
		format(primeiralinha, sizeof(primeiralinha), "** %s %s...", PegarNome(playerid), acao[36]);
		strdel(acao, 36, 100);
		ChatProximo(30.0, playerid, 0xC2A2DAAA, primeiralinha);
		ChatProximo(30.0, playerid, 0xC2A2DAAA, acao);
	}
	else{
		format(texto, sizeof(texto), "** %s %s", PegarNome(playerid), acao);
		ChatProximo(30.0, playerid, 0xC2A2DAAA, texto);
	}
	return 1;
}
Reply
#2

Isso estar em portugues? vou por pra ingles para poder ver o problema, dai se muda dps '-'
Reply
#3

eu achei um pra voce aki

Code:
public OnPlayerCommandText ( playerid, cmdtext [ ] ) 
{ 
    if ( ! strcmp ( cmdtext, "/ me" , true, 3 ) )  // 3 й o tamanho de / me 
    { 
        if ( ! cmdtext [ 3 ] ) return SendClientMessage ( playerid, 0xFF0000FF, "USAGE: / me [aзгo]" ) ; 
        new str [ 128 ] ; 
        GetPlayerName ( playerid, str, sizeof( str ) ) ; 
        formato ( str, sizeof ( str ) , "*% s% s" , str, cmdtext [ 4 ] ) ; 
        SendClientMessageToAll ( 0xFFFF00AA, str ) ; 
        retornar  1 ; 
    } 
    retornar  0 ; 
}
Creditos:
Quote:

Twisted_Insane

Reply
#4

pawn Code:
SendClientMessageEx(playerid, color, const text[])
{
    #define LENGHT (36)

    if(strlen(text) > LENGHT)
    {
        new firstString[LENGHT], secondString[LENGHT];

        strmid(firstString, text, 0, LENGHT);
        strmid(secondString, text, LENGHT - 1, LENGHT * 2);

        format(firstString, LENGHT, "%s", firstString);
        format(secondString, LENGHT, "..%s", secondString);

        SendClientMessage(playerid, color, firstString);
        SendClientMessage(playerid, color, secondString);
   }
    else SendClientMessage(playerid, color, text);
   
    #undef LENGHT

    return 1;
}
Reply
#5

Quote:
Originally Posted by Syxh0wN
View Post
pawn Code:
SendClientMessageEx(playerid, color, const text[])
{
    #define LENGHT (36)

    if(strlen(text) > LENGHT)
    {
        new firstString[LENGHT], secondString[LENGHT];

        strmid(firstString, text, 0, LENGHT);
        strmid(secondString, text, LENGHT - 1, LENGHT * 2);

        format(firstString, LENGHT, "%s", firstString);
        format(secondString, LENGHT, "..%s", secondString);

        SendClientMessage(playerid, color, firstString);
        SendClientMessage(playerid, color, secondString);
   }
    else SendClientMessage(playerid, color, text);
   
    #undef LENGHT

    return 1;
}
Muito obrigado, me ajudou muito.
Rep +
Reply


Forum Jump:


Users browsing this thread: