Raised This Month: $ Target: $400
 0% 

Help edit ad_manager.amxx (make advertise only for dead and spec)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 07-17-2011 , 10:22   Help edit ad_manager.amxx (make advertise only for dead and spec)
Reply With Quote #1

Hello all.


I want to make ad_manager show advertise only for dead and spectators.

I did this thing, but i fail and chat is disabled for players, who dead. What`s my mistake?

PHP Code:
public displayAd(params[])

Code:
	if(!is_user_alive(id))
        return PLUGIN_HANDLED;
PHP Code:
    //Get the string that is going to be displayed
    
new message[128];
    
getString(STOREparams[1], message127params[0], params[1]);
    
    
//If its enabled by cvar and id is set, display to person who triggered message only
    
if(get_cvar_num("ad_react_all") == && params[2] != 0)
    {
        
message_begin(MSG_ONEgmsgSayText, {0,0,0}, params[2]);
        
write_byte(params[2]);
        
write_string(message);
        
message_end();
    
    } else
    {
        
//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();
        }
    }
    
    return 
PLUGIN_HANDLED;


Thanks in advance.
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
 



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 00:52.


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