Problema mensaje flood
#1

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);
    }
Reply
#2

En que callback lo estas usando?
Reply
#3

Quote:
Originally Posted by MrKaiser
Посмотреть сообщение
En que callback lo estas usando?
OnPlayerUpdate
Reply
#4

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
Reply
#5

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]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)