/admins
#1

i need the command /admins
and i need that all the 3 admins will be in 1 line like
Bla(ID:0|Lvl:6) ~ Bla2(ID:2|Lvl:2) ~ Bla3(ID:5|Lvl:
And after 3 admins it will creat a new line like:
Bla(ID:0|Lvl:6) ~ Bla2(ID:2|Lvl:2) ~ Bla3(ID:5|Lvl:
Bla4(ID:0|Lvl:100) ~ Bla5(ID:55|Lvl:1) ~ Bla6(ID:3|Lvl:1)
tanks for the helpers
Reply
#2

i think it's impossible to make 3 admin in the same line !!
Reply
#3

cant you use 9 variables instead of 3 variables?
Reply
#4

it should be posiible lol... you just need how to format it.. maybe if u use the Split function.. :P I am not a pro but just i think this should work.
Reply
#5

what is the code
can someone tell me how to do that?
Reply
#6

Код:
new a[4],[128];
for(new i;i<200;i++){
  if(connected(i)&&admin(i)){
    a[a[3]++] = i;
    if(a[3] == 3){
      a[3] = 0;format(b,128,"a:lv%d,id%d blablabla",plv(a[0]),a[0],bla...);
      send
    }
   }
   if(a[3] >0){
    format,send
  }
It's example, please DIY^^
Reply
#7

tanks but i need also the admin name like this: %s not: bla
Reply
#8

Quote:
Originally Posted by nuriel8833
tanks but i need also the admin name like this: %s not: bla
Search "PlayerName" in useful function
Reply
#9

try
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(..... blabla bla);
Reply
#10

Quote:
Originally Posted by James_Alex(Coder)
try
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(..... blabla bla);
I used variable i here is the code:
pawn Код:
new a[4],[128];
for(new i;i<200;i++){
if(IsPlayerConnected(i))
    {
  if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 11)
    {
    GetPlayerName(i, adminname, sizeof(adminname));
  if(connected(i)&&admin(i)){
    a[a[3]++] = i;
    if(a[3] == 3){
      a[3] = 0;format(b,128,"%s (ID:%d|Lvl:%d) ~ %s (ID:%d|Lvl:%d) ~ %s (ID:%d|Lvl:%d)",adminname,a[0],PlayerInfo[i][pAdmin](a[0]),,bla...);
      send
    }
   }
   if(a[3] >0){
    format,send
  }
but the i can use only for 1 player and i dont know how to use it for the 3 players
can someone help me?
Reply
#11

Again, search "stock PlayerName" in this topic
And my code is just an example, you need to modtify to yourself
Reply
#12

Quote:
Originally Posted by yezizhu
Код:
new a[4],[128];
for(new i;i<200;i++){
  if(connected(i)&&admin(i)){
    a[a[3]++] = i;
    if(a[3] == 3){
      a[3] = 0;format(b,128,"a:lv%d,id%d blablabla",plv(a[0]),a[0],bla...);
      send
    }
  }
  if(a[3] >0){
    format,send
  }
It's example, please DIY^^
This may work but I guess yezizhu is too lazy to finish this example Doesn't help much if you give it like that.
Reply
#13

Quote:
Originally Posted by MadeMan
Quote:
Originally Posted by yezizhu
Код:
new a[4],[128];
for(new i;i<200;i++){
  if(connected(i)&&admin(i)){
    a[a[3]++] = i;
    if(a[3] == 3){
      a[3] = 0;format(b,128,"a:lv%d,id%d blablabla",plv(a[0]),a[0],bla...);
      send
    }
   }
   if(a[3] >0){
    format,send
  }
It's example, please DIY^^
This may work but I guess yezizhu is too lazy to finish this example Doesn't help much if you give it like that.
I'm lazy for teaching him to learn what DIY is, don't you know?
Reply
#14

Quote:
Originally Posted by yezizhu
Quote:
Originally Posted by MadeMan
Quote:
Originally Posted by yezizhu
Код:
new a[4],[128];
for(new i;i<200;i++){
  if(connected(i)&&admin(i)){
    a[a[3]++] = i;
    if(a[3] == 3){
      a[3] = 0;format(b,128,"a:lv%d,id%d blablabla",plv(a[0]),a[0],bla...);
      send
    }
  }
  if(a[3] >0){
    format,send
  }
It's example, please DIY^^
This may work but I guess yezizhu is too lazy to finish this example Doesn't help much if you give it like that.
I'm lazy for teaching him to learn what DIY is, don't you know?
Ofc, as you say
Reply
#15

Why don't you just let it show each admin on one line? Saves code.

Код:
if ( strcmp ( cmd, "/admins", true ) == 0 )
{
	for ( new i = 0; i < MAX_PLAYERS; i++ )
	{
		if ( IsPlayerConnected ( i ) )
		{
			if ( AdminVarBlaBla >= 1 )
			{
            	new plname[MAX_PLAYERS];
			    GetPlayerName( i, plname, sizeof( plname ) );
				format ( string, sizeof ( string ), "Admin %s is online (Level %d), ID: %d.", plname, AdminVarBlaBla, i );
			    SendClientMessage ( playerid, 0xB4B5B7FF, string );
			}
		}
	}

	return 1;
}
Reply
#16

Quote:

if ( strcmp ( cmd, "/admins", true ) == 0 )
{
for ( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerConnected ( i ) )
{
if ( AdminVarBlaBla >= 1 )
{
new plname[MAX_PLAYERS];
GetPlayerName( i, plname, sizeof( plname ) );
format ( string, sizeof ( string ), "Admin %s is online (Level %d), ID: %d.", plname, AdminVarBlaBla, i );
SendClientMessage ( playerid, 0xB4B5B7FF, string );
}
}
}

return 1;
}

That you need ?
Reply
#17

That's just a simple /admins command.

Read the first post again:
Quote:
Originally Posted by nuriel8833
and i need that all the 3 admins will be in 1 line like
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)