help if(AccInfo[playerid][AFK] == 0/1)
#1

hi gays I have cmd to be afk
pawn Код:
if (strcmp("/afk", cmdtext, true) == 0)
    {
        if(IsPlayerVipMember(playerid))
        {
            TogglePlayerControllable(playerid, 0);
            SetPlayerPos(playerid, 293, 2414, 17);
            SendClientMessage(playerid, COLOR_Red, "to back type /back");
            AFKCount++;
            s = SetTimer("stop", 1000, true);
           
        }
        else
        {
            TogglePlayerControllable(playerid, 0);
            SetPlayerPos(playerid, 293, 2414, 17);
            SendClientMessage(playerid, COLOR_Red, "you will kick after 10 min if you didn't type /back");
            AFKCount++;
            s = SetTimer("stop", 1000, true);
            k = SetTimer("kick", 600000, true);
        }
        return 1;
    }
    if (strcmp("/back", cmdtext, true) == 0)
    {
        if(IsPlayerVipMember(playerid))
        {
            TogglePlayerControllable(playerid, 1);
            SetPlayerPos(playerid, 334, 2417, 17);
            KillTimer(s);
            AFKCount--;
        }
        else
        {
            KillTimer(s);
            TogglePlayerControllable(playerid, 1);
            SetPlayerPos(playerid, 334, 2417, 17);
            KillTimer(k);
            AFKCount--;
        }
        return 1;
    }
I want it to be like this
pawn Код:
if (strcmp("/afk", cmdtext, true) == 0)
    {
        if(AccInfo[playerid][AFK] == 0)
        (
            if(IsPlayerVipMember(playerid))
            {
                AccInfo[playerid][AFK] = 1;
                TogglePlayerControllable(playerid, 0);
                SetPlayerPos(playerid, 293, 2414, 17);
                SendClientMessage(playerid, COLOR_Red, "to back type /back");
                AFKCount++;
                s = SetTimer("stop", 1000, true);
           
            }
            else
            {
                AccInfo[playerid][AFK] = 1;
                TogglePlayerControllable(playerid, 0);
                SetPlayerPos(playerid, 293, 2414, 17);
                SendClientMessage(playerid, COLOR_Red, "you will kick after 10 min if you didn't type /back");
                AFKCount++;
                s = SetTimer("stop", 1000, true);
                k = SetTimer("kick", 600000, true);
            }
        }
        else SendClientMessage(playerid. COLOR_Red, "you are alredy AFK");
        return 1;
    }
    if (strcmp("/back", cmdtext, true) == 0)
    {
        if(AccInfo[playerid][AFK] == 1)
        (
            if(IsPlayerVipMember(playerid))
            {
                AccInfo[playerid][AFK] = 0;
                TogglePlayerControllable(playerid, 1);
                SetPlayerPos(playerid, 334, 2417, 17);
                KillTimer(s);
                AFKCount--;
            }
            else
            {
                AccInfo[playerid][AFK] = 0;
                KillTimer(s);
                TogglePlayerControllable(playerid, 1);
                SetPlayerPos(playerid, 334, 2417, 17);
                KillTimer(k);
                AFKCount--;
            }
        }
        else SendClientMessage(playerid. COLOR_Red, "you are not AFK");
        return 1;
    }
Reply


Messages In This Thread
help if(AccInfo[playerid][AFK] == 0/1) - by cca - 24.09.2010, 15:37
Re: help if(AccInfo[playerid][AFK] == 0/1) - by wups - 24.09.2010, 15:47
Re: help if(AccInfo[playerid][AFK] == 0/1) - by Ash. - 24.09.2010, 15:48
Re: help if(AccInfo[playerid][AFK] == 0/1) - by cca - 24.09.2010, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)