2 Warnings
#7

Well let me try,
The system does not know what "count" is, so we'v got to tell it what "count" is.
Lets add new count; INSIDE the command,
Now the script is like "aaaah, I now know count! Lets use it!".

AKA:

pawn Код:
public CheckBunnyHopping(playerid)
{
    new count=0;
    new animlib[32];
    new animname[32];
    GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
    if(strcmp(oldanim[playerid],animname,true) != 0)
    {
        strcat(PlayerSequence[playerid],oldanim[playerid],100);
        count++;
        if(count >= 3 && GetPVarInt(playerid,"HasSended") == 0)
        {
            if(strfind(PlayerSequence[playerid],"JUMP_LAUNCH",true) != -1
            && strfind(PlayerSequence[playerid],"JUMP_LAND",true) != -1
            && strfind(PlayerSequence[playerid],"JUMP_GLIDE",true) != -1)
            {
                new string[80];
                count=0;
                format(PlayerSequence[playerid],1,"");
                #if MODE == 0
                format(string,80,"[WARNING] %s are doing Bunny Hopping!",GetNick(playerid));
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i) && IsPlayerAdmin(i))
                    {
                        SendClientMessage(i,COLOR_WHITE,string);
                    }
                }
                #else
                if(GetPVarInt(playerid,"Warnings") == MAX_WARNINGS)
                {
                    format(string,80,"[WARNING] %s has kicked for doing Bunny Hopping!",GetNick(playerid));
                    SendClientMessageToAll(COLOR_WHITE,string);
                    Kick(playerid);
                    return 1;
                }
                #endif
                SendClientMessage(playerid,COLOR_WHITE,"You're Bunny Hopping, stop or you will be kicked.");
                SetPVarInt(playerid,"HasSended",1);
                SetPVarInt(playerid,"Warnings",GetPVarInt(playerid,"Warnings")+1);
                SetTimerEx("ResetPlayer",5000,false,"d",playerid);
            }
            format(PlayerSequence[playerid],1,"");
            count=0;
        }
    }
    format(oldanim[playerid],32,"%s",animname);
    return 1;
}
Reply


Messages In This Thread
2 Warnings - by kujox222 - 17.06.2012, 12:54
Re: 2 Warnings - by milanosie - 17.06.2012, 13:03
Re: 2 Warnings - by kujox222 - 17.06.2012, 14:38
Re: 2 Warnings - by Rudy_ - 17.06.2012, 14:40
Re: 2 Warnings - by kujox222 - 17.06.2012, 14:44
Re: 2 Warnings - by Kindred - 17.06.2012, 14:45
Re: 2 Warnings - by milanosie - 17.06.2012, 14:46
Re: 2 Warnings - by kujox222 - 17.06.2012, 14:47
Re: 2 Warnings - by kujox222 - 17.06.2012, 14:52
Re: 2 Warnings - by milanosie - 17.06.2012, 14:55

Forum Jump:


Users browsing this thread: 1 Guest(s)