SA-MP Forums Archive
/admins FAIL - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /admins FAIL (/showthread.php?tid=498002)



/admins FAIL - AwokenNeoX - 01.03.2014

Admin Level 2 = Trusted Player and if you type /tps you see all Online Trusted Player..It works but he only shows 1 Trusted Player if 2 Trusted Players are online only 1 is shown

My Command

Код:
dcmd_tps(playerid, params[])
{
    #pragma unused params
    new count = 0, string[256];
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
    	if(IsPlayerConnected(i))
     	{
      		if(AccInfo[i][Level] == 2)
        	{

				new nameee[128];
    			GetPlayerName(i, nameee, 16);
   				format(string, sizeof(string),"%s (ID:%d)\n",PlayerName2(i), i);
       			ShowPlayerDialog(playerid, 139, DIALOG_STYLE_MSGBOX, "Trusted Players", string, "Ok", "");
          		count++;
            }
       	}
    }
    if(count == 0)
    {
    	ShowPlayerDialog(playerid, 139, DIALOG_STYLE_MSGBOX, "Trusted Players Online List", "No Trusted Player Online.", "Ok", "");
    }
	return 1;
}



Re: /admins FAIL - Golimad - 01.03.2014

pawn Код:
dcmd_tps(playerid, params[])
{
    #pragma unused params
    new count = 0, string[256];
     SendClientMessage(playerid, -1,"-------- Trusted Players : --------");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(AccInfo[i][Level] == 2)
            {

                new nameee[128];
                GetPlayerName(i, nameee, 16);
                format(string, sizeof(string),"%s (ID:%d)\n",nameee, i);
                SendClientMessage(playerid, -1, string);
                count++;
            }
        }
    }
    if(count == 0)
    {
        SendClientMessage(playerid, -1, "No Trusted Player Online.");
    }
      SendClientMessage(playerid, -1,"--------------------------------");
    return 1;
}
Try this


AW: Re: /admins FAIL - AwokenNeoX - 01.03.2014

Quote:
Originally Posted by Golimad
Посмотреть сообщение
pawn Код:
dcmd_tps(playerid, params[])
{
    #pragma unused params
    new count = 0, string[256];
     SendClientMessage(playerid, -1,"-------- Trusted Players : --------");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(AccInfo[i][Level] == 2)
            {

                new nameee[128];
                GetPlayerName(i, nameee, 16);
                format(string, sizeof(string),"%s (ID:%d)\n",nameee, i);
                SendClientMessage(playerid, -1, string);
                count++;
            }
        }
    }
    if(count == 0)
    {
        SendClientMessage(playerid, -1, "No Trusted Player Online.");
    }
      SendClientMessage(playerid, -1,"--------------------------------");
    return 1;
}
Try this
Thank you but I want it in a DIALOG_BOX


Re: /admins FAIL - RoboN1X - 01.03.2014

pawn Код:
dcmd_tps(playerid, params[])
{
    #pragma unused params
    new count = 0, string[256], name[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i) && AccInfo[i][Level] == 2)
        {
            GetPlayerName(i, name, MAX_PLAYER_NAME);
            format(string, sizeof(string),"%s%s (ID:%i)\n", string, name, i);
            count++;
        }
    }
    if(count == 0) ShowPlayerDialog(playerid, 139, DIALOG_STYLE_MSGBOX, "Online Trusted Player List", "No Trusted Player Online.", "Ok", "");
    else ShowPlayerDialog(playerid, 139, DIALOG_STYLE_MSGBOX, "Online Trusted Player List", string, "Ok", "");
    return 1;
}
Try it, not yet tested, but should work, i also modified some code.


Re: /admins FAIL - Golimad - 01.03.2014

Edit : ^ I like your idea haha
Well I'm not familiar with Dialogs so .. :P Good luck trying