17.07.2018, 17:12
Olб :/
Eu tava sem fazer nada e decidi criar um cod que mostrasse o nome do jogador quando ele fosse citado no chat.
tipo @Nome. Eu fiz como um cmd... e funcionou. mas na hora de colocar no OnPlayerText nгo aparece nada no chat
Obrigado!
Eu tava sem fazer nada e decidi criar um cod que mostrasse o nome do jogador quando ele fosse citado no chat.
tipo @Nome. Eu fiz como um cmd... e funcionou. mas na hora de colocar no OnPlayerText nгo aparece nada no chat
Код:
new OutraMsg[100],MsgFormatar[101];
new CorTexto1 = Vermelho;
new PosicaoInicial = strfind(Texto,"@",true);
new PosicaoFinal = strfind(Texto," ",true);
if(strfind(Texto,"@", true) != -1){
if(PosicaoFinal == -1){
PosicaoFinal = strlen(Texto);}
foreach(new Todos: Player){
if(IsPlayerConnected(Todos)){
strmid(OutraMsg,Texto,PosicaoInicial+1,PosicaoFinal,sizeof(OutraMsg));
if(strfind(Nome(Todos),OutraMsg, true,PosicaoInicial-1) != -1){
PlayerPlaySound(Todos,1085,0.0,0.0,0.0);
strdel(Texto,PosicaoInicial,PosicaoFinal);
format(MsgFormatar,sizeof(MsgFormatar),"{%06x}@%s{%06x}",GetPlayerColor(playerid)>>>8,OutraMsg,CorTexto1>>>8);
strins(Texto,MsgFormatar,PosicaoInicial,sizeof(Texto));}}}}
format(MsgFormatar,sizeof(MsgFormatar),"{%06x}%s(%d):{%06x} %s",GetPlayerColor(playerid)>>>8,Nome(playerid),playerid,CorTexto1>>>8,Texto);
SendClientMessageToAll(Branco,MsgFormatar);


