/afk and /back commands
#1

Hi people,

today I've encountered a bug in my script.

You can type as many /afk's as you want to and showing them.
Could someone make it like when you typed /afk once you can't type it again till you've done /back?

code:
pawn Код:
COMMAND:afk(playerid, params[])  
{  
    if (APlayerData[playerid][LoggedIn] == true)  
    {  
        SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}You are afk, when you come back, do /back");  
        TogglePlayerControllable(playerid,0);    

        new string3[160];  
        new name[MAX_PLAYER_NAME];  
        GetPlayerName(playerid, name, sizeof(name));  
   
        format(string3, sizeof(string3), "{FF6600}%s {FFFFFF}is now AFK - {FF6600}%s", name, params);  
        SendClientMessageToAll(0xFFFFFFFF, string3);  
    }  
    return 1;  
}
 
COMMAND:back(playerid, params[])  
{  
    if (APlayerData[playerid][LoggedIn] == true)  
    {  
        SendClientMessage(playerid, 0xFFFFFFFF, "Welcome Back!!");  
        TogglePlayerControllable(playerid,1);    
        SetPlayerFacingAngle(playerid, 180);  

        new string3[70];  
        new name[MAX_PLAYER_NAME];  
        GetPlayerName(playerid, name, sizeof(name));  
   
        format(string3, sizeof(string3), "{FF6600}%s {FFFFFF}is back from being afk!", name);  
        SendClientMessageToAll(0xFFFFFFFF, string3);  
    }  
    return 1;  
}
Thanks

-SomebodyAndMe
Reply


Messages In This Thread
/afk and /back commands - by SomebodyAndMe - 09.12.2011, 13:10
Re: /afk and /back commands - by xMichaelx - 09.12.2011, 13:17
Re: /afk and /back commands - by grand.Theft.Otto - 09.12.2011, 13:18
Re: /afk and /back commands - by SomebodyAndMe - 09.12.2011, 13:23
Re: /afk and /back commands - by Rob_Maate - 09.12.2011, 13:27
Re: /afk and /back commands - by SomebodyAndMe - 09.12.2011, 13:35
Re: /afk and /back commands - by grand.Theft.Otto - 09.12.2011, 19:43

Forum Jump:


Users browsing this thread: 1 Guest(s)