AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Vips_motd (https://forums.alliedmods.net/showthread.php?t=83992)

Plug me up 01-18-2009 14:35

Vips_motd
 
Hi, first of all, I'M NOT A "CODDER!"
unfortunately, i dont hav the codding academy knowledge but i aways do some changes in some codes (not a pro, but not a totally noob)

here's the thing, i edited all of admins_motd from fakenick but one thing is killing me.

i need that the motd shows all players with "ADMIN_LEVEL_D" but unfortunately i dont know how. can you help me?



Code:

#include <amxmodx>
#include <amxmisc>
//To retrieve maxplayers
new g_maxplayers
//enum
enum
{
 TASK_INFO = 100
}
//Version information
new const VERSION[] = "1.0"
public plugin_init()
{
 register_plugin("Active vipsins MOTD", VERSION, "FakeNick")
 
 //Dictionary
 register_dictionary("vipsm.txt")
 
 //logevent
 register_logevent("logevent_round_start",2,"1=Round_Start")
 
 //Only to recognize, which sever is using this plugin
 register_cvar("vipsins_motd_version",VERSION,FCVAR_SERVER | FCVAR_SPONLY)
 
 //Say commands
 //register_clcmd("say !vipsins","func_vipsins")
 //register_clcmd("say_team !vipsins","func_vipsins")
 register_clcmd("say vips","func_vipsins")
 register_clcmd("say_team vips","func_vipsins")
 register_clcmd("say /vips","func_vipsins")
 register_clcmd("say_team /vips","func_vipsins")
 
 //Maxplayers information
 g_maxplayers = get_maxplayers()
}
public logevent_round_start()
{
 //Show info
 //client_print(0,print_chat,"%L",LANG_PLAYER,"INFO_COMMANV")
 
 //Rmeove old task and make a new one
 remove_task(TASK_INFO)
 //set_task(60.0,"logevent_round_start",TASK_INFO)
}
public func_vipsins(id)
{
 //Some common variables
 static vmotd[1000],vheader[100],name[32],vlen,vi,vcounter
 vlen = 0
 vcounter = 0
 
 //Format bg and font colors
 vlen += formatex(vmotd[vlen],sizeof vmotd - 1 - vlen,"%L",id,"MOTD_2")
 
 //Format MOTD header
 formatex(vheader,sizeof vheader - 1,"%L",id,"MOTD_HEADV")
 
 //Check for vipsins
 for(vi = 1; vi <= g_maxplayers;vi++)
 {
  //If player is vipsin...
  if(cmd_access(vi,ADMIN_LEVEL_D))
  {
  //...increase counter...
  vcounter++
 
  //...retrieve vipsin name...
  get_user_name(vi,name,sizeof name - 1)
 
  //...add vipsin to MOTD
  vlen += formatex(vmotd[vlen],sizeof vmotd - 1 - vlen,"&nbsp %d. <b>%s</b><br>",vcounter,name)
  }
 }
 
 //Finally, show MOTD
 show_motd(id,vmotd,vheader)
 
}


Dr.G 01-18-2009 14:44

Re: Vips_motd
 
You can fix that really easy, check out this http://www.amxmodx.org/funcwiki.php?...lcmd&go=search

Plug me up 01-18-2009 19:37

Re: Vips_motd
 
Quote:

Originally Posted by Dr.G (Post 746359)
You can fix that really easy, check out this http://www.amxmodx.org/funcwiki.php?...lcmd&go=search

no, you dont get it
i want that all the flag D guys are SHOWN in the motd,
not that all who have flag D can see the motd
know what i mean?

SnoW 01-19-2009 06:33

Re: Vips_motd
 
Code:

new String[256], name[33];
new max_playas = get_maxplayers();
for(new i = 1; i <= max_playas; i++)

 //Connect check here still...
        if(get_user_flags(i) & ADMIN_BAN) //Or here...
        {
              get_user_name(i, name, 32);
              format(String, 255, "%s, %s", String, name);
        }
}
//Print(String) blblaa...
//....
/*
      Note that you should make better (Only an example), bec that will print/show in motd:
      ", admin_name, admin_name2..."
*/


Plug me up 01-19-2009 09:42

Re: Vips_motd
 
alllright!! its working!! thanks both for trying help and thanks more snow for get it right!

i just replace this
Code:

if(cmd_access(vi,ADMIN_LEVEL_D))
  {

with this:
Quote:

if(get_user_flags(i) & ADMIN_BAN)
and than, voilla! ahahahah


All times are GMT -4. The time now is 01:42.

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