Raised This Month: $ Target: $400
 0% 

enable/disable chat command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 10-29-2013 , 09:54   Re: enable/disable chat command
Reply With Quote #3

Quote:
Originally Posted by DWIGHTpN View Post
PHP Code:
new bool:msg[33];
//or bitsum..
new const message[] = "bla...";

public 
plugin_init() {
      
set_task(1.0"MsgApp"0_0"b");
      
register_clcmd("say /info""clcmd_msg");
}

public 
MsgApp() {
      static 
players[32],iNum,player;
      
get_players(playersiNum"ch");
      for(new 
i;i<iNum;i++) {
          
player players[i];
          if( 
msg[player] ) {
               
set_dhudmessage(50,150,250, -1.0, -1.011.01.10.10.1true);
               
show_dhudmessage(playermessage);
          }
      }
}

public 
clcmd_msg(id){
       
msg[id] = msg[id] ? false true;
       return 
PLUGIN_CONTINUE;  // or handled if you want..

You want the message to remain permanently on hud or for 10,15 sec..?


It's possible with nvault, but i think is bad idea to save this...
How about message?
PHP Code:
msgid ] = msgid ] ? print_chatid"%L"LANG_SERVER"INFO_ON" true print_chatid"%L"LANG_SERVER"INFO_OFF" false
Is this will work?
PHP Code:
switch (msgid ] )
{
    case 
0:
    {
        
msgid ] = false;
print_chatid"%L"LANG_SERVER"INFO_OFF" )
    }
    
    case 
1:
    {
        
msgid ] = true;
print_chatid"%L"LANG_SERVER"INFO_ON" )
    }


Last edited by Debesėlis; 10-29-2013 at 10:06.
Debesėlis is offline
 



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:16.


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