AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Specific ads for admin only (https://forums.alliedmods.net/showthread.php?t=232871)

preetham 01-06-2014 03:02

Specific ads for admin only
 
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 :)

tonykaram1993 01-06-2014 06:51

Re: Specific ads for admin only
 
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.

fysiks 01-06-2014 06:57

Re: Specific ads for admin only
 
@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).

tonykaram1993 01-06-2014 07:20

Re: Specific ads for admin only
 
Ah yes. You are correct indeed.
Stupid '!' :D
Fixed the above post.

preetham 01-07-2014 22:24

Re: Specific ads for admin only
 
Quote:

Originally Posted by tonykaram1993 (Post 2081927)
Ah yes. You are correct indeed.
Stupid '!' :D
Fixed the above post.

TY very much for help mate :)


All times are GMT -4. The time now is 20:39.

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