AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   /admin | who etc (https://forums.alliedmods.net/showthread.php?t=60519)

vl@d 09-05-2007 17:25

/admin | who etc
 
I modify the amx_who.sma to show in a hud not in console.
but the problem is when more admin connect is shown on not all :(
PHP Code:

#include <amxmod>
#include <amxmisc>

#define MAX_GROUPS 7

new g_groupNames[MAX_GROUPS][] = {
"Conqueror",
"High Guard Warrior",
"Mortal Figthers",
"Comandos",
"Delta Squad",
"The Undead",
"NightCrawlers"
}

new 
g_groupFlags[MAX_GROUPS][] = {
"abcdefghijklmnopqrstuvwy",
"abcdefghijlmnopqrstuvw",
"abcdefghijlmnopqrstu",
"abcdefghijmnopqru",
"abcdefgijmnopu",
"abcdefijmu",
"ab"
}

new 
g_groupFlagsValue[MAX_GROUPS]

public 
plugin_init() {
    
register_plugin("Amx_who Hud","0.1","FireW@ll")
    
register_concmd("say who","who",0)
    
register_concmd("say admin","who",0)
    
register_concmd("say /admin","who",0)
    for(new 
0MAX_GROUPSi++) {
    
g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
  }
}


public 
who(id){
    new 
players[32], inumplayername[32], ia
      get_players
(playersinum)
      for(
0MAX_GROUPSi++) {
    for(
0inum; ++a) {
     
player players[a]
     
get_user_name(playername31)
     if(
get_user_flags(player) == g_groupFlagsValue[i]) {
     
set_hudmessage(42255850.030.2906.06.0)
    
show_hudmessage(id,"..:: Admini Online ::..^n-=- %s -=-^n%s^n..:: Intrati pe site-ul oficial http://hl.darkstrike.ro ::..",g_groupNames[i],name)
              }
            }
    }
    return 
PLUGIN_HANDLED


Have a fix for this?

[ --<-@ ] Black Rose 09-05-2007 17:29

Re: /admin | who etc
 
Let me guess, It only shows four of em? And they get melded together in one single row?

[ --<-@ ] Black Rose 09-05-2007 17:38

Re: /admin | who etc
 
How's the output of this?
Please screen & post.
Code:
#include <amxmod> #include <amxmisc> #define MAX_GROUPS 7 new g_groupNames[MAX_GROUPS][] = {     "Conqueror",     "High Guard Warrior",     "Mortal Figthers",     "Comandos",     "Delta Squad",     "The Undead",     "NightCrawlers" } new g_groupFlags[MAX_GROUPS][] = {     "abcdefghijklmnopqrstuvwy",     "abcdefghijlmnopqrstuvw",     "abcdefghijlmnopqrstu",     "abcdefghijmnopqru",     "abcdefgijmnopu",     "abcdefijmu",     "ab" } new g_groupFlagsValue[MAX_GROUPS] public plugin_init() {     register_plugin("Amx_who Hud","0.1","FireW@ll")     register_concmd("say who","who",0)     register_concmd("say admin","who",0)     register_concmd("say /admin","who",0)     for(new i = 0; i < MAX_GROUPS; i++) {         g_groupFlagsValue[i] = read_flags(g_groupFlags[i])     } } public who(id){         new players[32], inum, player, name[32], i, a, text[2048]     new len = formatex(text, 2047, "..:: Admini Online ::..^n")         get_players(players, inum, "c")         for(i = 0; i < MAX_GROUPS; i++) {                 len += formatex(text[len], 2047-len, "^n-=- %s -=-", g_groupNames[i])                 for(a = 0; a < inum; ++a) {                         if ( get_user_flags(player) == g_groupFlagsValue[i] ) {                                 player = players[a]                 get_user_name(player, name, 31)                                 len += formatex(text[len], 2047-len, "^n   %s", name)             }         }     }         set_hudmessage(42, 255, 85, 0.03, 0.15, 0, 6.0, 6.0)     show_hudmessage(id, "%s^n^n..:: Intrati pe site-ul oficial http://hl.darkstrike.ro ::..", text)         return PLUGIN_HANDLED }

vl@d 09-05-2007 17:53

Re: /admin | who etc
 
no it shows like it suposed to show but one of the group not all admin :(
I will try your code :)

Edit: It shows like i want but it does not show the name of the admin :(

[ --<-@ ] Black Rose 09-05-2007 18:22

Re: /admin | who etc
 
print screen?

vl@d 09-05-2007 18:28

Re: /admin | who etc
 
sry i tryed to show a print but my driver is not working right and the picture is black :|
it shows like this:
Code:

..:: Admini Online ::..

-=- Conqueror -=-
-=- High Guard Warrior  -=-
-=- Mortal Figthers -=- 
-=- Comandos  -=-
-=- Delta Squad -=- 
-=- The Undead -=- 
-=- NightCrawlers -=-

..:: Intrati pe site-ul oficial http://hl.darkstrike.ro ::..

The spaces in this code is corect.
But no name :|:)

[ --<-@ ] Black Rose 09-05-2007 18:42

Re: /admin | who etc
 
I assume there was no "conquerors" online, anyway the a var was never reset.

I belive this would work.
Code:
#include <amxmod> #include <amxmisc> #define MAX_GROUPS 7 new g_groupNames[MAX_GROUPS][] = {     "Conqueror",     "High Guard Warrior",     "Mortal Figthers",     "Comandos",     "Delta Squad",     "The Undead",     "NightCrawlers" } new g_groupFlags[MAX_GROUPS][] = {     "abcdefghijklmnopqrstuvwy",     "abcdefghijlmnopqrstuvw",     "abcdefghijlmnopqrstu",     "abcdefghijmnopqru",     "abcdefgijmnopu",     "abcdefijmu",     "ab" } new g_groupFlagsValue[MAX_GROUPS] public plugin_init() {     register_plugin("Amx_who Hud","0.1","FireW@ll")     register_concmd("say who","who",0)     register_concmd("say admin","who",0)     register_concmd("say /admin","who",0)         for ( new i = 0 ; i < MAX_GROUPS ; i++)         g_groupFlagsValue[i] = read_flags(g_groupFlags[i]) } public who(id){         new players[32], inum, player, name[32], text[2048]     new len = formatex(text, 2047, "..:: Admini Online ::..^n")         get_players(players, inum, "c")         for ( new i = 0; i < MAX_GROUPS; i++ ) {                 len += formatex(text[len], 2047-len, "^n-=- %s -=-", g_groupNames[i])                 for ( new a = 0; a < inum ; ++a ) {                                 player = players[a]             if ( get_user_flags(player) == g_groupFlagsValue[i] ) {                 get_user_name(player, name, 31)                 len += formatex(text[len], 2047-len, "^n   %s", name)             }         }     }         set_hudmessage(42, 255, 85, 0.03, 0.15, 0, 6.0, 6.0)     show_hudmessage(id, "%s^n^n..:: Intrati pe site-ul oficial http://hl.darkstrike.ro ::..", text)         return PLUGIN_HANDLED }

vl@d 09-05-2007 19:03

Re: /admin | who etc
 
html code in a hud? why?

[ --<-@ ] Black Rose 09-05-2007 19:15

Re: /admin | who etc
 
its the auto link parser of the forum...

vl@d 09-05-2007 19:16

Re: /admin | who etc
 
aaa sry :P
I will tell if it works tommorow.
going to sleep :)


All times are GMT -4. The time now is 16:06.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.