SA-MP Forums Archive
[Ajuda] Quebra de linha - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Quebra de linha (/showthread.php?tid=671838)



Quebra de linha - Henriquearauj - 15.01.2020

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;
}



Re: Quebra de linha - iPhonee - 15.01.2020

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


Re: Quebra de linha - iPhonee - 15.01.2020

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




Re: Quebra de linha - Syxh0wN - 15.01.2020

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;
}



Re: Quebra de linha - Henriquearauj - 15.01.2020

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 +