Raised This Month: $ Target: $400
 0% 

Client_Cmd Problem:


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Crizzatu
Member
Join Date: May 2012
Old 04-23-2013 , 03:30   Client_Cmd Problem:
Reply With Quote #1

Code:
public ClearChat(id)
	{
	
	if(!is_user_admin(id))
		return 1;
	
	new AdminName[32];
	get_user_name(id, AdminName, sizeof AdminName - 1);
	client_print_green(0, "           ADMINUL %s a curatat chatu!           ", AdminName);
	client_print_green(0,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	client_print_green(0,"         ;(Motiv:Reclama sau Vulgarisme)        ");
	client_print_green(0,"              ---=JB.Freakz.Ro=---             "); 
	client_print_green(0,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	
	client_cmd(0, "spk misc/antend.wav");
	client_cmd(0, "clear");
	return 1;
}
This plugin is for ClearChat ! [advertisements or injury]

How can that when whrite /clearchat clean chat only PLAYERS ! Are not deleted chat and for Admin's?

Sorry! For my Language .... Is not the best...
Crizzatu is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-23-2013 , 08:03   Re: Client_Cmd Problem:
Reply With Quote #2

return 1;

In amxconst

PHP Code:
#define PLUGIN_CONTINUE        0    /* Results returned by public functions */
#define PLUGIN_HANDLED        1    /* stop other plugins */
#define PLUGIN_HANDLED_MAIN    2    /* to use in client_command(), continue all plugins but stop the command */ 
So >

return 1 >> return PLUGIN_HANDLED;

PHP Code:
if(!is_user_admin(id))
        return 
1
TO

PHP Code:
if(!is_user_admin(id))
        return 
PLUGIN_HANDLED
Its is delete the chat from all persos, including for Admins..

You want to clear chat for all players except for Admins?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Crizzatu
Member
Join Date: May 2012
Old 04-23-2013 , 11:01   Re: Client_Cmd Problem:
Reply With Quote #3

Yes.. I want clear chat for all players except for admins .....
Crizzatu is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-23-2013 , 12:33   Re: Client_Cmd Problem:
Reply With Quote #4

One second..

EDIT (NOT TESTED):

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    
register_plugin("Clear Chat",AMXX_vERSION_STR,"SmileY");
    
    
register_concmd("amx_chat_clear","cmdClearChat",ADMIN_RESERVATION,"- Clear all chat from users");
}

public 
cmdClearChat(id,level,cid)
{
    if(!
cmd_access(id,level,cid,1)) return PLUGIN_HANDLED;
    
    new 
iPlayers[32],iNum,Players;
    
get_players(iPlayers,iNum,"ch");
    
    new 
szName[32];
    
get_user_name(id,szName,charsmax(szName));
    
    for(new 
i;iNum;i++)
    {
        
Players iPlayers[i];
        
        if(
access(Players,ADMIN_RESERVATION)) continue;
        
// ADMIN_RESERVATION FLAG WILL REMOVE THE ADMIN FROM LOOP
        
        
client_print_green(Players,"           ADMINUL %s a curatat chatu!           ",szName);
        
client_print_green(Players,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        
client_print_green(Players,"         ;(Motiv:Reclama sau Vulgarisme)        ");
        
client_print_green(Players,"              ---=JB.Freakz.Ro=---             "); 
        
client_print_green(Players,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        
        
client_cmd(Players,"speak misc/antend.wav;wait;clear");
    }
    return 
PLUGIN_HANDLED;

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 04-23-2013 at 15:15. Reason: Code v2
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Crizzatu
Member
Join Date: May 2012
Old 04-23-2013 , 14:50   Re: Client_Cmd Problem:
Reply With Quote #5

Now only the who writes is clear chat ! I need clear chat for ALL PLAYER [ FLAG Z ] except ADMIN'S [ADMIN_REZERVATION]

Thx for helping me
Crizzatu is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-23-2013 , 15:13   Re: Client_Cmd Problem:
Reply With Quote #6

For reservation Slots

PHP Code:
register_concmd("amx_chat_clear","cmdClearChat",ADMIN_CHAT,"- Clear all chat from users"); 
to

PHP Code:
register_concmd("amx_chat_clear","cmdClearChat",ADMIN_RESERVATION,"- Clear all chat from users"); 
You testing the plugin? Its clear for all players the chat ? and for admin?

I didn't understand

Ps. See the code above
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 04-23-2013 at 15:15. Reason: Ps. See the code above
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Crizzatu
Member
Join Date: May 2012
Old 04-23-2013 , 15:29   Re: Client_Cmd Problem:
Reply With Quote #7

Is GOOD ! THX MAN !
Crizzatu is offline
Reply


Thread Tools
Display Modes

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


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