l'm sad bug /admins "AFK"
#1

Код:
CMD:admins(playerid, params[])
{
    new string[256];
    new Rank[256];
     new AFK[256]; // --> AFK 
    SendClientMessage(playerid, -1, "** Administrators **");
    for(new i=0; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
        {
        if(pInfo[i][pAdmin] > 0)
	     {
          switch(pInfo[i][pAdmin])
	      {
            case 1: Rank = "Moderator";
	        case 2: Rank = "Master Moderator";
	        case 3: Rank = "Admin";
			case 4: Rank = "Master Admin";
			case 5: Rank = "Developer";
			case 6: Rank = "Web Developer";
			case 7: Rank = "Owner";
	        }
	        new spName[MAX_PLAYER_NAME];
            GetPlayerName(i,spName,MAX_PLAYER_NAME);
            if(AFK[playerid]>0) // --> AFK ?
            {
	        format(string,sizeof(string),"%s %s [Id:%d] %s {008080}[AFK]",Rank,spName,i,pInfo[i][pAdmin],AFK); // --> AFK ?
            }
             else
            {
	      format(string,sizeof(string),"%s %s [Id:%d] %s",Rank,spName,i,pInfo[i][pAdmin]); // --> Back ?
	      SendClientMessage(playerid, -1, string);
            }
        }
    }
}
Reply
#2

Please explain more about the bug, Like what errors are you receiving?

EDIT: I think I got the jist of what you were on about, Cleaned it up try this

Код:
CMD:admins(playerid, params[])
{
    new string[256];
    new Rank[256];
    new AFK[256]; // --> AFK 
    SendClientMessage(playerid, -1, "** Administrators **");
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(pInfo[i][pAdmin] > 0)
            {
                switch(pInfo[i][pAdmin])
                {
                    case 1: Rank = "Moderator";
                    case 2: Rank = "Master Moderator";
                    case 3: Rank = "Admin";
                    case 4: Rank = "Master Admin";
                    case 5: Rank = "Developer";
                    case 6: Rank = "Web Developer";
                    case 7: Rank = "Owner";
                }
                new spName[MAX_PLAYER_NAME];
                GetPlayerName(i,spName,MAX_PLAYER_NAME);
                if(AFK[playerid] > 0) format(string,sizeof(string),"%s %s [Id:%d] %s {008080}[AFK]",Rank,spName,i,pInfo[i][pAdmin],AFK);
                else format(string,sizeof(string),"%s %s [Id:%d] %s",Rank,spName,i,pInfo[i][pAdmin]);
                SendClientMessage(playerid, -1, string);
            }
        }
    }
}
Reply
#3

Look ---> http://imgur.com/a/QMr4G
Reply
#4

Please show me where this is being set like, You need to set it first

AFK[playerid]
Reply
#5

їHelpMe?
Reply
#6

If you don't have this already, download https://sampforum.blast.hk/showthread.php?tid=490436 place within

pawno -> includes, then add #include <callbacks> with your other includes inside the script, then add these inside your script

Код:
public OnPlayerPause(playerid)
{
        AFK[playerid] = 1;
	return 1;
}

public OnPlayerResume(playerid, time)
{
        AFK[playerid] = 0;
	return 1;
}
Reply
#7

l'm bug much sad...
Reply
#8

*rolls eyes* I can't help you if you don't understand what I'm saying :P
Reply
#9

Helpme
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)