AFK And SetName Command
#1

The code works fine but it wont change the players name to '[AFK] <name>' it just says there away and leaves the name as it was:

pawn Код:
if(strcmp("/afk",cmdtext,true)==0)
{
  if(!IsPlayerConnected(playerid)) return SysMsg(playerid,"Please wait until you are fully connected!");       
    if(IsAFK[playerid] == 0)
    {
        format(string,sizeof(string),"[AFK] %s",Name(playerid));
        SetPlayerName(playerid,string);
        IsAFK[playerid] = 1;
        format(string,sizeof(string),"%s is now Away From Keyboard (AFK)",Name(playerid));
        SendClientMessageToAll(COLOUR_GREEN,string);
        printf("[Cmd] %s Is Now AFK",Name(playerid));
         
        }else{
           
        new nName[256],nFile[128];
        nFile = GetPlayersFile(playerid);
        nName = dini_Get(File,"Account Name");
        SetPlayerName(playerid,nName);
        format(string,sizeof(string),"%s is no longer Away From Keyboard (AFK)",Name(playerid));
        SendClientMessageToAll(COLOUR_GREEN,string);
        IsAFK[playerid] = 0;
        printf("[Cmd] %s Is No Longer AFK",Name(playerid));
    }      
    return 1;
}
Reply


Messages In This Thread
AFK And SetName Command - by Alec24 - 15.07.2009, 11:34
Re: AFK And SetName Command - by yom - 15.07.2009, 11:36
Re: AFK And SetName Command - by Jefff - 15.07.2009, 11:41
Re: AFK And SetName Command - by Alec24 - 15.07.2009, 11:45
Re: AFK And SetName Command - by Alec24 - 15.07.2009, 11:54
Re: AFK And SetName Command - by yom - 15.07.2009, 11:57

Forum Jump:


Users browsing this thread: 1 Guest(s)