/staff (/admins) help
#1



Thats my problem,

My code
pawn Код:
CMD:staff(playerid, params[])
{
        new online, string[128];
        if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin])
            {
                online ++;
            }
        }
        format(string, sizeof(string), "________Divoro Staff Team________");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin])
            if(PlayerInfo[i][pHelper])
            {
                SendClientMessage(playerid,COLOR_ORANGE, "Administrators:");
                format(string, sizeof(string), "%s %s", RPALN(i), RPN(i));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                SendClientMessage(playerid,COLOR_ORANGE, "Helpers:");
                format(string, sizeof(string), " %s ",RPN(i));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
           
        }
        format(string, sizeof(string), "_________________________________");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        return 1;
}
Reply
#2

Check PM. Already answered that question.

pawn Код:
CMD:staff(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
        //online wordt niet gebruikt, ik had die erinstaan voor een vorig admin systeem. :) Dus dat kunnen we eruit laten ;)!

    format(string, sizeof(string), "________Divoro Staff Team________"); // Begin
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    SendClientMessage(playerid,COLOR_ORANGE, "Administrators:");
        foreach(Player, i)
        {
            if(PlayerInfo[i][pAdmin])
            {
                    format(string, sizeof(string), "%s", RPN(i));
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
        }
    SendClientMessage(playerid,COLOR_ORANGE, "Helpers:");
        foreach(Player, i)
        {
            if(PlayerInfo[i][pHelper])
            {
                    format(string, sizeof(string), "%s", RPN(i));
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
        }
    format(string, sizeof(string), "_________________________________"); // Ik neem aan dat dit het einde is.
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    return 1;
}
Reply
#3

Maybe becasue you are looping twice? foreach(Player, i) X2

Here the fixed one:

Код:
CMD:staff(playerid, params[])
{
	new online, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	foreach(Player, i)
	{
		if(PlayerInfo[i][pAdmin])
		{
			online ++;
		}
	}
	format(string, sizeof(string), "________Divoro Staff Team________");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	{
		if(PlayerInfo[i][pAdmin])
		if(PlayerInfo[i][pHelper])
		{
			SendClientMessage(playerid,COLOR_ORANGE, "Administrators:");
			format(string, sizeof(string), "%s %s", RPALN(i), RPN(i));
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			SendClientMessage(playerid,COLOR_ORANGE, "Helpers:");
			format(string, sizeof(string), " %s ",RPN(i));
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		}
		
	}
	format(string, sizeof(string), "_________________________________");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)