Bug with chat! +rep - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bug with chat! +rep (
/showthread.php?tid=384204)
Bug with chat! +rep -
Beljulji - 10.10.2012
I have a problem, not always but players reported that when they type something like: Blabla it shows 2 times some kind of bug, happend to me once if anyone knows the problem pls help.
Код:
public OnPlayerText(playerid, text[])
{
SetPlayerChatBubble(playerid, text, 0xFF0000FF, 30.0, 5000);
new is1=0;
new r=0;
while(strlen(text[is1]))
{
if('0'<=text[is1]<='9')
{
new is2=is1+1;
new p=0;
while(p==0)
{
if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
else
{
strmid(strR[r],text,is1,is2,255);
if(strval(strR[r])<255) r++;
is1=is2;
p=1;
}
}
}
is1++;
}
if(r>=4)
{
new strMy[255];
new STRname[255];
GetPlayerName(playerid,STRname,255);
format(strMy, sizeof(strMy), " Suspicion of advertising %s(%d): %s",STRname,playerid,text);
for(new j1=0; j1 < MAX_PLAYERS;j1++)
if(IsPlayerAdmin(j1)) SendClientMessage(j1, 0xFF0000FF, strMy);
for(new z=0;z<r;z++)
{
new pr2;
while((pr2=strfind(text,strR[z],true))!=-1) for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++) text[i]='*';
SendClientMessage(playerid, red, "You are Banned! Reason: No advertize on this server!!!");
Ban(playerid);
}
}
if(strval(text) == ContestAnswer && ContestAnswer != -1)
{
OnPlayerWinContest(playerid);
}
return 1;
}
Re: Bug with chat! +rep -
BlackBank - 10.10.2012
Remove the line:
pawn Код:
SetPlayerChatBubble(playerid, text, 0xFF0000FF, 30.0, 5000);
Re: Bug with chat! +rep -
Beljulji - 13.10.2012
hmmm you shure that is the problem?
Re: Bug with chat! +rep -
JaKe Elite - 13.10.2012
You mean two times of sending message?
If so, then change return 1; to return 0;
Still not sure, Please give some more info.
Re: Bug with chat! +rep -
Beljulji - 13.10.2012
look at my new thread about this prob you will see picture
Re: Bug with chat! +rep -
_Khaled_ - 13.10.2012
Don't doublepost.