[Ajuda]Anti-Flood - 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]Anti-Flood (
/showthread.php?tid=319247)
[Ajuda]Anti-Flood -
|_MeGaTroN_| - 18.02.2012
pawn Код:
public OnPlayerText(playerid,text[])
{
new pvar[128];
GetPVarString(playerid,"UltimoTexto",pvar,sizeof(pvar));
if(!strcmp(pvar,text))
{
SendClientMessage(playerid,-1,"Palavra repetida !");
return false;
}
SetPVarString(playerid,"UltimoTexto",text);
return true;
}
Estranho retorna sempre que a palavra " Repetida " mesmo eu digitando qualquer coisa...
Re: [Ajuda]Anti-Flood -
Lucas_Alemao - 18.02.2012
nгo manjo de usar esse GetPVarString e nem outros desse tipo, mas testa ae:
pawn Код:
public OnPlayerText(playerid,text[])
{
new pvar[128];
GetPVarString(playerid,"UltimoTexto",pvar,sizeof(pvar));
if(!strcmp(pvar,text))
{
SendClientMessage(playerid,-1,"Palavra repetida !");
return false;
}
return true;
}
Re: [Ajuda]Anti-Flood -
|_MeGaTroN_| - 18.02.2012
Mesma coisa lek, alias vocк naum mudou nada ..
Re: [Ajuda]Anti-Flood - rjjj - 18.02.2012
Isto deve resolver o seu problema

:
pawn Код:
public OnPlayerText(playerid,text[])
{
new pvar[128];
GetPVarString(playerid,"UltimoTexto",pvar,sizeof(pvar));
if(strlen(pvar) && !strcmp(pvar,text))
{
SendClientMessage(playerid,-1,"Palavra repetida !");
return 0;
}
SetPVarString(playerid,"UltimoTexto",text);
return 1;
}
Espero ter ajudado

.
Re: [Ajuda]Anti-Flood -
Lucas_Alemao - 18.02.2012
Quote:
Originally Posted by |_MeGaTroN_|
Mesma coisa lek, alias vocк naum mudou nada ..
|
eu tirei o SetPVarString(playerid,"UltimoTexto",text);
pra mim isso tava setando a variavel pro texto de antes, por isso podia dar o negocio ¬¬
Re: [Ajuda]Anti-Flood -
|_MeGaTroN_| - 18.02.2012
Obrigado rjj funcionou
@Lucas
Tambйm tinha pensado nisso mais deu no mesmo e obrigado..