Admin CMD help
#1

Help me i wait to change this to dialog instead of sendclientmessage

Код:
CMD:admins(playerid, params[])
{
	new online, string[128];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
   	if(PlayerInfo[playerid][pAdmin] < 1) SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pHelper])
	    {
	        online ++;
	    }
	}
	format(string, sizeof(string), "|_____Philippine Roleplay[0.3z] Admins Team_____|");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pAdmin])
	    {
	        format(string, sizeof(string), " %s %s ", RPALN(i), RPN(i));
	        SendClientMessage(playerid, COLOR_DARKRED, string);
	    }
	}
	return 1;
}
Change this to dialog
Reply
#2

Код:
define DIALOG_ADMINS // ON TOP OF SCRIPT 

CMD:admins(playerid, params[])
{
new online, string[128];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
   	if(PlayerInfo[playerid][pAdmin] < 1) SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pHelper])
	    {
	        online ++;
	    }
	}
 if(PlayerInfo[i][pAdmin])
	    {
	        format(string, sizeof(string), " %s %s ", RPALN(i), RPN(i));
ShowPlayerDialog(playerid,DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "|_____Philippine Roleplay[0.3z] Admins Team_____|", "string", "", "");
return 1;
}
TYr it If it works Please Rep ME
Reply
#3

pawn Код:
CMD:admins(playerid, params[])
{
    new online, string[128],stringx[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 1) SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
    foreach(Player, i)
    {
        if(PlayerInfo[i][pHelper])
        {
            online ++;
        }

        if(PlayerInfo[i][pAdmin])
        {
                format(stringx, sizeof(stringx), "|_____Philippine Roleplay[0.3z] Admins Team_____|");
            format(string, sizeof(string), " %s %s ", RPALN(i), RPN(i));
            ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, stringx, string, "Close", "");
        }
    }
    return 1;
}
Reply
#4

CMD:admins(playerid, params[])
{
new online, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
foreach(Player, i)
{
if(PlayerInfo[i][pHelper])
{
online ++;
}
}
format(string, sizeof(string), "|_____Philippine Roleplay[0.3z] Admins Team_____|");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin])
{
format(string, sizeof(string), " %s %s ", RPALN(i), RPN(i));
ShowPlayerDialog(playerid, 99999, DIALOG_STYLE_MSGBOX, "Admin Online", string, "Okay", "Close");
}
}
return 1;
}
Reply
#5

Are All Sleeping ? Lol So fast 3 replies
Reply
#6

Yes, and all 3 incorrect replies.

pawn Код:
CMD:admins(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
    new string[860], fstr[50], count = 0;
    format(string, sizeof(string), "|_____Philippine Roleplay[0.3z] Admin Team_____|{FF0000}\n\n");
    foreach(Player, i)
    {
        if(!PlayerInfo[i][pAdmin]) continue;
        count++;
        if(count > 15) continue;
        format(fstr, sizeof(fstr), " %s %s\n", RPALN(i), RPN(i));
        strcat(string, fstr);
    }
    if(!count) strcat(string, "There are no Administrators online.");
    else if(count > 15)
    {
        format(fstr, sizeof(fstr), "There are %d other Administrators online.", (count - 15));
        strcat(string, fstr);
    }
    ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_MSGBOX, "Philippine Roleplay[0.3z] Admin Team", string, "Okay", "");
        //Replace '1234' with your own dialog ID.
    return 1;
}
Reply
#7

BumP!
Reply
#8

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Yes, and all 3 incorrect replies.

pawn Код:
CMD:admins(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
    new string[860], fstr[50], count = 0;
    format(string, sizeof(string), "|_____Philippine Roleplay[0.3z] Admin Team_____|{FF0000}\n\n");
    foreach(Player, i)
    {
        if(!PlayerInfo[i][pAdmin]) continue;
        count++;
        if(count > 15) continue;
        format(fstr, sizeof(fstr), " %s %s\n", RPALN(i), RPN(i));
        strcat(string, fstr);
    }
    if(!count) strcat(string, "There are no Administrators online.");
    else if(count > 15)
    {
        format(fstr, sizeof(fstr), "There are %d other Administrators online.", (count - 15));
        strcat(string, fstr);
    }
    ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_MSGBOX, "Philippine Roleplay[0.3z] Admin Team", string, "Okay", "");
        //Replace '1234' with your own dialog ID.
    return 1;
}
Thanks it work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)