Problema mensaje 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: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Problema mensaje flood (
/showthread.php?tid=358235)
Problema mensaje flood -
krauser - 09.07.2012
Pues tengo esque codigo, que te manda un mensaje si alguien usa fly hack, pero cuando salta hace un flood impresionante, aver si alguien me ayuda a que solo manda ese mensaje cada 3 segundos
pawn Код:
new i=0; i<MAX_PLAYERS; i++;
new Float:animX, Float:animY, Float:animZ;
new anim = GetPlayerAnimationIndex(playerid);
GetPlayerPos(playerid, animX, animY, animZ);
if((anim >= 1538) && (anim <= 1542) && animZ > 5)
{
format(string, 128, "* %s (ID:%d) esta usando Fly Hack.",pName(i), i);
ABroadCast(RojoIntenso, string, 1);
}
Re: Problema mensaje flood -
MrKaiser - 09.07.2012
En que callback lo estas usando?
Respuesta: Re: Problema mensaje flood -
krauser - 09.07.2012
Quote:
Originally Posted by MrKaiser
En que callback lo estas usando?
|
OnPlayerUpdate
Respuesta: Problema mensaje flood -
Bu11Sh0t - 09.07.2012
pawn Код:
new Adviced[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
new i=0; i<MAX_PLAYERS; i++;
new Float:animX, Float:animY, Float:animZ;
new anim = GetPlayerAnimationIndex(playerid);
GetPlayerPos(playerid, animX, animY, animZ);
if((anim >= 1538) && (anim <= 1542) && animZ > 5)
{
if(Adviced[playerid] == 0)
{
format(string, 128, "* %s (ID:%d) esta usando Fly Hack.",pName(i), i);
ABroadCast(RojoIntenso, string, 1);
Adviced[playerid] = 1;
}
}
}
Y puedes hacer esto:
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 50 //Tus maximos jugadores
Respuesta: Problema mensaje flood -
godoy32 - 10.07.2012
Te recomiendo cambiarlo por un timmer.
pawn Код:
new Timer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Timer[playerid]=SetTimerEx("CheckFly",2000,"d",playerid);
}
forward CehckFly(playerid);
public CehckFly(playerid)
{
new i=0; i<MAX_PLAYERS; i++;
new Float:animX, Float:animY, Float:animZ;
new anim = GetPlayerAnimationIndex(playerid);
GetPlayerPos(playerid, animX, animY, animZ);
if((anim >= 1538) && (anim <= 1542) && animZ > 5)
{
if(Adviced[playerid] == 0)
{
format(string, 128, "* %s (ID:%d) esta usando Fly Hack.",pName(i), i);
ABroadCast(RojoIntenso, string, 1);
Adviced[playerid] = 1;
}
}
}
public OnPlayerDisconnect(playerid)
{
KillTimer(Timer[playerid]);
}