Some problem
#1

I put this code on OnPlayerUpdate:
if(GetPlayerAnimationIndex(playerid))
{
new animlib[32],animname[32],acname[MAX_PLAYER_NAME];
GetPlayerName(playerid, acname, sizeof(acname));
GetAnimationName(GetPlayerAnimationIndex(playerid) ,animlib,32,animname,32);
if(strcmp(animlib, "PED", true) == 0)
{
if(strcmp(animname, "RUN_PLAYER", true) == 0)
{
format(string, sizeof(string), "AdmWarn: %s[%d] possibly CJ Running", acname,playerid);
ABroadCast(COLOR_YELLOW,string,1);
}
}
return 1;
}

It works good but when the player is CJ running it spamms the whole chat..
anyone can help ?
Reply
#2

Try this:

pawn Код:
if(GetPlayerAnimationIndex(playerid))
{
new animlib[32],animname[32],acname[MAX_PLAYER_NAME];
GetPlayerName(playerid, acname, sizeof(acname));
GetAnimationName(GetPlayerAnimationIndex(playerid) ,animlib,32,animname,32);
if(strcmp(animlib, "PED", true) == 0)
{
if(strcmp(animname, "RUN_PLAYER", true) == 0)
{
format(string, sizeof(string), "AdmWarn: %s[%d] possibly CJ Running", acname,playerid);
// Your sendmessagetoadmins
ABroadCast(COLOR_YELLOW,string,1);
}
}
return 1;
}
Reply
#3

The code you gave works, but it spamming the all admin chat like:
AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running

AdmWarn: %s[%d] possibly CJ Running
Reply
#4

pawn Код:
ABroadCast(COLOR_YELLOW,string,1);
Remove the 1 at the end

pawn Код:
ABroadCast(COLOR_YELLOW,string);
Try that
Reply
#5

What should it do then?
Reply
#6

nevermind
Reply
#7

never mind
Reply
#8

pawn Код:
new RunWarning[MAX_PLAYERS];
pawn Код:
if(GetPlayerAnimationIndex(playerid))
{
    new animlib[32],animname[32],acname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, acname, sizeof(acname));
    GetAnimationName(GetPlayerAnimationIndex(playerid) ,animlib,32,animname,32);
    if(strcmp(animlib, "PED", true) == 0 && strcmp(animname, "RUN_PLAYER", true) == 0)
    {
        if(RunWarning[playerid] == 0)
        {
            format(string, sizeof(string), "AdmWarn: %s[%d] possibly CJ Running", acname,playerid);
            ABroadCast(COLOR_YELLOW,string,1);
            RunWarning[playerid] = 1;
        }
    }
    else
    {
        RunWarning[playerid] = 0;
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
pawn Код:
new RunWarning[MAX_PLAYERS];
pawn Код:
if(GetPlayerAnimationIndex(playerid))
{
    new animlib[32],animname[32],acname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, acname, sizeof(acname));
    GetAnimationName(GetPlayerAnimationIndex(playerid) ,animlib,32,animname,32);
    if(strcmp(animlib, "PED", true) == 0 && strcmp(animname, "RUN_PLAYER", true) == 0)
    {
        if(RunWarning[playerid] == 0)
        {
            format(string, sizeof(string), "AdmWarn: %s[%d] possibly CJ Running", acname,playerid);
            ABroadCast(COLOR_YELLOW,string,1);
            RunWarning[playerid] = 1;
        }
    }
    else
    {
        RunWarning[playerid] = 0;
    }
    return 1;
}
thanks, its not spamming now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)