[Ajuda] Bug - 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] Bug (
/showthread.php?tid=591156)
Bug -
CZ - 08.10.2015
alguйm pode me ajudar resolver esse bug?
meu OnPlayerText
pawn Код:
public OnPlayerText(playerid, text[])
{
new textchat[128];
format(textchat,sizeof(textchat), "<%d> %s: {FFFFFF}%s",playerid,Nome(playerid),text);
SendClientMessageToAll(GetPlayerColor(playerid), textchat);
new chatgz[128];
if(text[0] == '!')
{
format(chatgz,sizeof(chatgz), "<%d> [Chat-Gang] %s: %s",playerid, Nome(playerid), text[1]);
CallRemoteFunction("OnPlayerGangText","ds",playerid,chatgz);
return 0;
}
return 0;
}
pawn Код:
public OnPlayerGangText(playerid,text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && TeamGang[i] == TeamGang[playerid])
{
SendClientMessage(i, 0xFFFF00AA, text);
}
return 0;
}
Re: Bug -
Nixtren - 08.10.2015
Vocк no seu script faz a verificaзгo se a frase possui o carбcter "!" depois de jб ter feito SendClientMessage anteriormente. Vocк tem que fazer essa verificaзгo antes de fazer o SendClientMessage. Provavelmente vocк vai ter de usar um "if" e um "else"
P.S: Funзгo OnPlayerText
Re: Bug -
PT - 08.10.2015
Apenas inverta a ordem de verificaзгo na callback onplayertext
Re: Bug -
CZ - 09.10.2015
Consegui man vlw.