20.11.2012, 20:11
well i have antispam but when i type text in chat constantly says "don spam" but still send message to chat im not shure why i think maybe cuz i have
on the end of onplayertext so can someone help me so that antispam works on
?
Код:
return 0;
Код:
return 0;
Код:
public OnPlayerText(playerid, text[]) { switch(xTestBusy) { case true: { if(!strcmp(xChars, text, false)) { new string[128], pName[MAX_PLAYER_NAME] ; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "« \%s\" has won the reaction test. »", pName); SendClientMessageToAll(GREEN, string); format(string, sizeof(string), "« You have earned $%d + %d score points. »", xCash, xScore); SendClientMessage(playerid, GREEN, string); GivePlayerMoney(playerid, xCash); SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore); xReactionTimer = SetTimer("xReactionTest", TIME, 1); xTestBusy = false; } } } 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); } } SetPlayerChatBubble(playerid, text, red, 30.0, 5000); new idtext[128]; format(idtext, sizeof(idtext), "(ID: %d): %s", playerid, text); SendPlayerMessageToAll(playerid, idtext); if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid)) { SendClientMessage(playerid, 0xFF0000FF, "Do Not Spam!"); return 0; } if(!IsPlayerAdmin(playerid)) { if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text, false)) { SendClientMessage(playerid, 0xFF0000FF, "Do Not Spam"); format(szPlayerChatMsg[playerid], 128, "%s", text); return 0; } } format(szPlayerChatMsg[playerid], 128, "%s", text); iPlayerChatTime[playerid] = GetTickCount(); return 0; }