[HELP] AFK Puts [AFK] In-Front Of Name (eg. /afk = [AFK]Name) ?
#1

Ok i have a working /afk command. I want to know how to make the /afk command put a "[AFK]" tag in there name when in AFK so players know when people are AFK and when they /back there name is back to normal?

Any help?

pawn Код:
CMD:afk(playerid, params[])
{
        new string[128];
        new name[MAX_PLAYER_NAME];
        if(isafk[playerid] == false)
        {
            if(afktimer[playerid]) return SendClientMessage(playerid,RED,"Please Wait Before Being AFK Again!");
            afktimer[playerid] =30;
            isafk[playerid] = true;
            SetPlayerHealth(playerid, 9999);
            GetPlayerName(playerid, name, MAX_PLAYER_NAME);
            format(string, sizeof(string), "%s Is Now AFK",name);
            printf(string);
            SendClientMessage(playerid, YELLOW, "Type /back To Stop Being AFK.");
            SendClientMessageToAll(RED, string);
            TogglePlayerControllable(playerid,0);
        }
        else
        {
            SendClientMessage(playerid, RED, "You Are Already AFK!");
        }
    return true;
}

CMD:back(playerid, params[])
{
        new string[128];
        new name[MAX_PLAYER_NAME];
        if(isafk[playerid] == true)
        {
            isafk[playerid] = false;
            GetPlayerName(playerid, name, MAX_PLAYER_NAME);
            format(string, sizeof(string), "%s Is No Longer AFK",name);
            SendClientMessageToAll(YELLOW, string);
            printf(string);
            TogglePlayerControllable(playerid,1);
        }
        else
        {
        SendClientMessage(playerid, RED, "You Are Not AFK!");
        }
    return true;
}
Thanks In Advanced!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)