Originally Posted by Shum493
public OnPlayerCommandText (caso haja algum comando, por exemplo o /an, etc. Onde todos podem ver, inclua isto nos mesmos)
pawn Код:
if(TentouDivulgar(result)) { if(cdivulgar[playerid] >= 4) { SendClientMessage(playerid, COLOR_LIGHTBLUE,"Aqui vocк nгo pode anunciar servidores!"); SendClientMessage(playerid, COLOR_LIGHTBLUE,"Seu servidor й um lixo, nгo divulgue aqui!"); SendClientMessage(playerid, COLOR_LIGHTBLUE,"Seu noob peguei esse IP e vou divulgar nesse server tambйm, uaheuhaeuhaeahe!"); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); Kick(playerid); } format(string, 128, "AdmAviso: [%d]%s tentou divulgar: %s.",playerid,PlayerName(playerid),result); ABroadCast(COLOR_YELLOW,string,1); DivulgouLog(string); cdivulgar[playerid] += 1; return 1; }
OnPlayerCommandText (tbm, se nao me engano)
pawn Код:
stock TentouDivulgar(string[]) { new x=0; for (new i = 0, j = strlen(string); i <= j; i++) { if (string[i] >= 46 && string[i] <= 58) { x+=1; } }
public OnPlayerText
pawn Код:
if(TentouDivulgar(text)) { if(cdivulgar[playerid] >= 4) { SendClientMessage(playerid, COLOR_LIGHTBLUE,"Aqui vocк nгo pode anunciar servidores!"); SendClientMessage(playerid, COLOR_LIGHTBLUE,"Nгo divulgue servidores aqui!"); SendClientMessage(playerid, COLOR_LIGHTBLUE,"Seu noob peguei esse IP e vou divulgar nesse server tambйm, uaheuhaeuhaeahe!"); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); Kick(playerid); } format(string, 128, "AdmAviso: [%d]%s tentou divulgar: %s.",playerid,PlayerName(playerid),text); ABroadCast(COLOR_YELLOW,string,1); DivulgouLog(string); cdivulgar[playerid] += 1; return 0; }
Provalvelmente vai dar algum erro, se der, espero que algum outro membro consigo resolvк-lo, pois jб estou de saida. Poste aqui o erro, de qualquer forma.
|