Raised This Month: $51 Target: $400
 12% 

Vips_motd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Plug me up
Member
Join Date: Aug 2008
Old 01-18-2009 , 14:35   Vips_motd
Reply With Quote #1

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)
 
}
__________________
always +karma to thoose who helps
Plug me up is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 01-18-2009 , 14:44   Re: Vips_motd
Reply With Quote #2

You can fix that really easy, check out this http://www.amxmodx.org/funcwiki.php?...lcmd&go=search
__________________
Dr.G is offline
Plug me up
Member
Join Date: Aug 2008
Old 01-18-2009 , 19:37   Re: Vips_motd
Reply With Quote #3

Quote:
Originally Posted by Dr.G View Post
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?
__________________
always +karma to thoose who helps
Plug me up is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-19-2009 , 06:33   Re: Vips_motd
Reply With Quote #4

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..."
*/

Last edited by SnoW; 01-19-2009 at 06:36.
SnoW is offline
Send a message via MSN to SnoW
Plug me up
Member
Join Date: Aug 2008
Old 01-19-2009 , 09:42   Re: Vips_motd
Reply With Quote #5

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
__________________
always +karma to thoose who helps
Plug me up is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:37.


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