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; }
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 ; }
Twisted_Insane |
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;
}
pawn Code:
|