Raised This Month: $ Target: $400
 0% 

Specific ads for admin only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
preetham
Member
Join Date: Sep 2012
Location: India
Old 01-06-2014 , 03:02   Specific ads for admin only
Reply With Quote #1

Hello moders.

I need a plugin that advertises on chat column which only admins can see... just like ad_manager.

In the admanager plugin, every once can see ads. suggest me or code a plugin that show advertisements only for admins.. ty in adv
preetham is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 01-06-2014 , 06:51   Re: Specific ads for admin only
Reply With Quote #2

In ad_manager.sma, go to line 271 and change the following:
PHP Code:
//Display the message to everyone
        
new plist[32], playernumplayer;
        
        
get_players(plistplayernum"c");
    
        for(new 
0playernumi++)
        {
            
player plist[i];
            
            
message_begin(MSG_ONEgmsgSayText, {0,0,0}, player);
            
write_byte(player);
            
write_string(message);
            
message_end();
        } 
->
PHP Code:
//Display the message to everyone
        
new plist[32], playernumplayer;
        
        
get_players(plistplayernum"c");
    
        for(new 
0playernumi++)
        {
            
player plist[i];

            if( !
is_user_adminplayer ) ) continue;
            
            
message_begin(MSG_ONEgmsgSayText, {0,0,0}, player);
            
write_byte(player);
            
write_string(message);
            
message_end();
        } 
Then compile and you have what you want.
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]

Last edited by tonykaram1993; 01-06-2014 at 07:20.
tonykaram1993 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-06-2014 , 06:57   Re: Specific ads for admin only
Reply With Quote #3

@tonykaram1993, that will do the opposite of what he asked. You need to continue if not admin. So, you can simply put a ! in front of is_user_admin(player).
__________________
fysiks is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 01-06-2014 , 07:20   Re: Specific ads for admin only
Reply With Quote #4

Ah yes. You are correct indeed.
Stupid '!'
Fixed the above post.
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]

Last edited by tonykaram1993; 01-06-2014 at 07:20.
tonykaram1993 is offline
preetham
Member
Join Date: Sep 2012
Location: India
Old 01-07-2014 , 22:24   Re: Specific ads for admin only
Reply With Quote #5

Quote:
Originally Posted by tonykaram1993 View Post
Ah yes. You are correct indeed.
Stupid '!'
Fixed the above post.
TY very much for help mate
preetham 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 20:39.


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