Admin CMD help again
#1

i need to move this again to dialog instead of sendclientmessage
Код:
CMD:admins(playerid, params[])
{
	new online, string[128], file[32];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1)
	{
		foreach(Player, i)
		{
		    if(PlayerInfo[i][pAdmin] && aDuty[i])
		    {
		        online ++;
		    }
		}
		format(string, sizeof(string), "On-Duty Admins: %d", online);
		SendClientMessage(playerid, COLOR_ORANGE, string);
		foreach(Player, i)
		{
		    if(PlayerInfo[i][pAdmin] && aDuty[i])
		    {
		     	format(string, sizeof(string), "- [Level: %d] %s", PlayerInfo[i][pAdmin], NORPN(i));
		     	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		    }
		}
	}
	else
	{
		foreach(Player, i)
		{
		    if(PlayerInfo[i][pAdmin])
		    {
		        online ++;
		    }
		}
		format(string, sizeof(string), "Online Admins: %d", online);
		SendClientMessage(playerid, COLOR_ORANGE, string);
		foreach(Player, i)
		{
		    if(PlayerInfo[i][pAdmin])
		    {
		     	if(!aDuty[i])
	 			{
	 			    format(file, sizeof(file), "users/%s.ini",RPNU(i));
				 	format(string, sizeof(string), "- [Level: %d] %s [Admin Name: %s]", PlayerInfo[i][pAdmin], NORPN(i), dini_Get(file, "AdminName"));
				}
		     	else
	 			{
	 			    format(file, sizeof(file), "users/%s.ini",RPNU(i));
					format(string, sizeof(string), "- [Level: %d] %s [RP Name: %s]", PlayerInfo[i][pAdmin], NORPN(i), dini_Get(file, "OldName"));
				}
				if(PlayerInfo[i][pGangMod]) strcat(string, " [Gang Mod]");
				if(PlayerInfo[i][pFacMod]) strcat(string, " [Fac Mod]");
				if(PlayerInfo[i][pDoorMod]) strcat(string, " [Door Mod]");
				if(PlayerInfo[i][pBizMod]) strcat(string, " [Biz Mod]");
				if(PlayerInfo[i][pHouseMod]) strcat(string, " [House Mod]");
				if(PlayerInfo[i][pGameAffairs]) strcat(string, " [Game Affairs]");
		        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		    }
		}
	}
	return 1;
}
Reply
#2

Hope it's work
pawn Код:
CMD:admins(playerid, params[])
{
    new online, string[128], string2[512], file[32], count = 0;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 1)
    {
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin] && aDuty[i])
            {
                format(string, sizeof(string), "- [Level: %d] %s", PlayerInfo[i][pAdmin], NORPN(i));
                if(count == 0)
                {
                    strcat(string2, string);
                }
                if(count > 0)
                {
                    strcat(string, "\n");
                    strcat(string2, string);
                }
                count++;
            }
        }
        ShowPlayerDialog(playerid,DIALOG_ID,DIALOG_STYLE_LIST,"On Duty Admins:",string2,"Close","");//change the DIALOG_ID
    }
    else
    {
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin])
            {
                if(!aDuty[i])
                {
                    format(file, sizeof(file), "users/%s.ini",RPNU(i));
                    format(string, sizeof(string), "- [Level: %d] %s [Admin Name: %s]", PlayerInfo[i][pAdmin], NORPN(i), dini_Get(file, "AdminName"));
                }
                else
                {
                    format(file, sizeof(file), "users/%s.ini",RPNU(i));
                    format(string, sizeof(string), "- [Level: %d] %s [RP Name: %s]", PlayerInfo[i][pAdmin], NORPN(i), dini_Get(file, "OldName"));
                }
                if(PlayerInfo[i][pGangMod]) strcat(string, " [Gang Mod]");
                if(PlayerInfo[i][pFacMod]) strcat(string, " [Fac Mod]");
                if(PlayerInfo[i][pDoorMod]) strcat(string, " [Door Mod]");
                if(PlayerInfo[i][pBizMod]) strcat(string, " [Biz Mod]");
                if(PlayerInfo[i][pHouseMod]) strcat(string, " [House Mod]");
                if(PlayerInfo[i][pGameAffairs]) strcat(string, " [Game Affairs]");
                if(count == 0)
                {
                    strcat(string2,string);
                }
                else if(count > 0)
                {
                    strcat(string, "\n");
                    strcat(string2, string);
                }
                count++;
            }
        }
        ShowPlayerDialog(playerid,DIALOG_ID,DIALOG_STYLE_LIST,"Online Admins:",string2,"Close","");//change the DIALOG_ID
    }
    return 1;
}
Reply
#3

Код:
C:\Users\Matt\Desktop\SAMP\SC-RP\gamemodes\UMRP.pwn(18114) : warning 203: symbol is never used: "online"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Код:
new online, string[128], string2[512], file[32], count = 0;
Reply
#4

remove the online,












1. This forum requires that you wait 120 seconds between posts. Please try again in 74 seconds.
Reply
#5

Quote:
Originally Posted by AiRaLoKa
Посмотреть сообщение
remove the online,












1. This forum requires that you wait 120 seconds between posts. Please try again in 74 seconds.
gives 5 errors.
Reply
#6

-_-

can you give me the errors?
Reply
#7

Quote:
Originally Posted by AiRaLoKa
Посмотреть сообщение
-_-

can you give me the errors?
Код:
C:\Users\Matt\Desktop\SAMP\PRLSRP\gamemodes\UMRP.pwn(18114) : error 001: expected token: "-identifier-", but found ","
C:\Users\Matt\Desktop\SAMP\PRLSRP\gamemodes\UMRP.pwn(18122) : error 017: undefined symbol "string"
C:\Users\Matt\Desktop\SAMP\PRLSRP\gamemodes\UMRP.pwn(18122) : error 017: undefined symbol "string"
C:\Users\Matt\Desktop\SAMP\PRLSRP\gamemodes\UMRP.pwn(18122) : error 029: invalid expression, assumed zero
C:\Users\Matt\Desktop\SAMP\PRLSRP\gamemodes\UMRP.pwn(18122) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#8

maybe you only delete the online and it become
pawn Код:
new , string[128], string2[512], file[32], count = 0;
where it should be
pawn Код:
new string[128], string2[512], file[32], count = 0;
Reply
#9

Quote:
Originally Posted by AiRaLoKa
Посмотреть сообщение
maybe you only delete the online and it become
pawn Код:
new , string[128], string2[512], file[32], count = 0;
where it should be
pawn Код:
new string[128], string2[512], file[32], count = 0;
it worked thanks
Reply
#10

no problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)