Raised This Month: $ Target: $400
 0% 

Ads for Admins only when they enter server?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ServingLife
Junior Member
Join Date: Aug 2010
Old 08-17-2010 , 08:49   Ads for Admins only when they enter server?
Reply With Quote #1

What would be the plugin that could make this possible:

The idea would be to send a msg to an admin that entered the server. The message(s) would tell them that they have admin rights here and they can use sm_admin to bring up the admin menu.

The point is that I would like to send these messages to the admins only, so only they see them and that they would be sent only once, when they enter the server.

This the only one i found but it would spam the message with certain intervals and i cant control it so that the ads would be send only when admin join.
https://forums.alliedmods.net/showth...hlight=adverts
ServingLife is offline
atom0s
Senior Member
Join Date: Jul 2009
Old 08-17-2010 , 10:54   Re: Ads for Admins only when they enter server?
Reply With Quote #2

Something like this should work:

PHP Code:
#pragma semicolon 1
#include <sourcemod>

public Plugin:myinfo =
{
    
name        "Simple Admin Message",
    
author      "atom0s",
    
description "Display a message to admins when they connect.",
    
version     "1.0.0",
    
url         "N/A"
};

public 
OnPluginStart( )
{
    
CreateConVar"simpleadminmsg_version""1.0.0""Simple Admin Message version."FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);
}

public 
OnClientPostAdminCheckclient )
{
    new 
AdminId:aid GetUserAdminclient );
    if( 
aid != INVALID_ADMIN_ID )
    {
        
PrintToChatclient"Welcome admin!" );
        
PrintToChatclient"Please use sm_admin to open the admin menu!" );
    }

atom0s is offline
ServingLife
Junior Member
Join Date: Aug 2010
Old 08-17-2010 , 12:39   Re: Ads for Admins only when they enter server?
Reply With Quote #3

Tnx. How would one change that code so that it waits around 10sec after the admin has connected and then prints that text, with color red/blue etc..?
ServingLife is offline
Cliffhanger
SourceMod Donor
Join Date: May 2010
Location: Arizona
Old 08-17-2010 , 18:56   Re: Ads for Admins only when they enter server?
Reply With Quote #4

I believe this would add a 10 second timer, as for color i'm not too sure
Quote:
Originally Posted by atom0s View Post
Something like this should work:
PHP Code:
#pragma semicolon 1
#include <sourcemod>

public Plugin:myinfo =
{
    
name        "Simple Admin Message",
    
author      "atom0s",
    
description "Display a message to admins when they connect.",
    
version     "1.0.0",
    
url         "N/A"
};

public 
OnPluginStart( )
{
    
CreateConVar"simpleadminmsg_version""1.0.0""Simple Admin Message version."FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);
}

public 
OnClientPostAdminCheckclient )
{
    new 
AdminId:aid GetUserAdminclient );
    if( 
aid != INVALID_ADMIN_ID )
    {
        
CreateTimer(10printMessageclient);
    }
}

public 
Action:printMessage(Handle:timerany:client) {
        
PrintToChatclient"Welcome admin!" );
        
PrintToChatclient"Please use sm_admin to open the admin menu!" );

__________________



Last edited by Cliffhanger; 08-17-2010 at 19:04.
Cliffhanger is offline
Thunder CS
Member
Join Date: Nov 2009
Location: Austria
Old 09-25-2010 , 15:04   Re: Ads for Admins only when they enter server?
Reply With Quote #5

Could u Update this that it's print's to the Hud and Replace Welcome admin to Welcome Adminname?
And it should display for users with the B-Flag admins with only reservations flag see this massage to..
__________________
sry for my bad english :>

Last edited by Thunder CS; 09-25-2010 at 15:08.
Thunder CS is offline
ummja
Senior Member
Join Date: Sep 2010
Old 09-26-2010 , 19:24   Re: Ads for Admins only when they enter server?
Reply With Quote #6

Nothing makes breaking the rules easier than a giant message in the middle of the screen telling you an Administrator has joined.
ummja is offline
Xsinthis
Senior Member
Join Date: Oct 2008
Location: Canadia, eh?
Old 09-26-2010 , 22:18   Re: Ads for Admins only when they enter server?
Reply With Quote #7

Quote:
Originally Posted by Thunder CS View Post
Could u Update this that it's print's to the Hud and Replace Welcome admin to Welcome Adminname?
And it should display for users with the B-Flag admins with only reservations flag see this massage to..
You can't display two message on the HUD at the same time afaik, so you could chose to put welcome on the hud, and instructions in the chat

Quote:
Originally Posted by ummja View Post
Nothing makes breaking the rules easier than a giant message in the middle of the screen telling you an Administrator has joined.
This only prints to the joining admin
__________________
Xsinthis is offline
Cliffhanger
SourceMod Donor
Join Date: May 2010
Location: Arizona
Old 09-27-2010 , 06:15   Re: Ads for Admins only when they enter server?
Reply With Quote #8

Quote:
Originally Posted by Xsinthis View Post
You can't display two message on the HUD at the same time afaik, so you could chose to put welcome on the hud, and instructions in the chat
Or you could set it to alternate between the two for x seconds.
__________________


Cliffhanger is offline
Xsinthis
Senior Member
Join Date: Oct 2008
Location: Canadia, eh?
Old 09-27-2010 , 15:35   Re: Ads for Admins only when they enter server?
Reply With Quote #9

Quote:
Originally Posted by Cliffhanger View Post
Or you could set it to alternate between the two for x seconds.
touche good sir, touche
__________________
Xsinthis 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 13:16.


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