/admins
#1

Hello. Can you give me a command for when i type /afk /aduty and type /admins to see wRoberTw Founder -AFK.
Thank You!
Reply
#2

Try to make it by yourself use your mind and try something out.
Reply
#3

i have no idee how to make it.
Reply
#4

This may help you , /afk command using dini and AutoKick after 15minutes
+Rep if i helped you.


Code:
dcmd_afk(playerid,params[])
{
    #pragma unused params
	new name[24];
	new string[128];
	if(GetPlayerInterior(playerid) != 0)
	{
		SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot go AFK while in an Interior");
		return 1;
	}
	if(Away[playerid] == 1)
	{
		SendClientMessage(playerid, COLOR_ERROR, "{CACA00}[ERROR]{FFFFFF}You are already set to Away.");
		return 1;
	}
    Away[playerid] =1;
    IsAFK[playerid] =900;
    TogglePlayerControllable(playerid,0);
    SetCameraBehindPlayer(playerid);
    GetPlayerName(playerid,name,128);
    format(string, sizeof(string), "[AWAY] %s(%d) is now AFK! (Away from keyboard)",name,playerid);
    SendClientMessageToAll(COLOR_LIME, string);

    new setname[16];
    format(setname, sizeof(setname), "%s[AFK]",name);
    if(!strlen(name[11]))
	{
	    afktag[playerid] =1;
	    SetPlayerName(playerid,setname);
    }
    SendClientMessage(playerid, COLOR_LIME, "Type /back when you are back on the computer.");
    SendClientMessage(playerid, COLOR_LIME, "You will be Auto-Kicked After 15 Minutes.");
    return 1; //return value
}
Command /back to back from afk.
Code:
dcmd_back(playerid,params[])
{
	#pragma unused params
    new name[24];
	new string[128];
	if(Away[playerid] == 0)
	{
		SendClientMessage(playerid, COLOR_ERROR, "You are not set to Away.");
		return 1;
	}
    Away[playerid] =0;
    IsAFK[playerid] =0;
    TogglePlayerControllable(playerid,1);
    SetCameraBehindPlayer(playerid);
    GetPlayerName(playerid,name,16);
    new pname[16];
    GetPlayerName(playerid,pname,16);
    strdel(pname, strlen(pname)-5, strlen(pname));
    if(afktag[playerid] == 1)
    {
	    afktag[playerid] =0;
	    SetPlayerName(playerid,pname);
    }
    new name2[16];
    GetPlayerName(playerid,name2,16);
    format(string, sizeof(string), "[BACK] %s(%d) is now back infront of the computer.",name2,playerid);
    SendClientMessageToAll(COLOR_LIME, string);
 	SendClientMessage(playerid, COLOR_LIME, "Type /afk to go AFK again.");
   	return 1;
}
+Rep if i Helped you.
In Need.
Reply
#5

i am using mysql and i don't want to kick if you are afk i want only to see when i type /admins wRoberTw Founder - AFK
Reply
#6

first you need to make a global per player var
PHP Code:
new IamAFK[MAX_PLAYERS char]; 
second you need to make afk command
PHP Code:
CMD:afk(playeridparams[])
{
    
//....
    
IamAFKplayerid } = 1;

and back command
PHP Code:
CMD:back(playeridparams[])
{
    
//....
    
IamAFKplayerid } = 0;

then use if statement to check if player is afk and give him afk tag here's a ex
PHP Code:
CMD:admins(playeridparams[])
{
    (
loopwith i var )
    
//... your codes if connected checker, admin level checker....
    
if(IamAFK})
    {
      
// he is afk wow!
    
}
    else
    {
       
// he is not afk ._. bad player.
    
}

Reply
#7

Its not working man....
Reply
#8

Quote:
Originally Posted by wRoberTw
View Post
Its not working man....
Did you add your Admin level checker?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)