Raised This Month: $ Target: $400
 0% 

My command.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-27-2008 , 01:04   My command.
Reply With Quote #1

I always see plugin have command.But their command different with my command.

My command do not see at chat.How to make it can see at chat?

I will +karma who help me.
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 12-27-2008 , 02:05   Re: My command.
Reply With Quote #2

I'd help you if I understood what you were trying to say. O_o

Are you saying that you want your command to print something?

http://www.amxmodx.org/funcwiki.php?go=func&id=22
Spunky is offline
Send a message via AIM to Spunky
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-27-2008 , 03:55   Re: My command.
Reply With Quote #3

Ok,I give the code.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define VERSION "1.0"

new p_Onp_Limit;
new 
g_iRespawnCount33 ];

public 
plugin_init()
{
    
register_plugin"Manual Respawn"VERSION"Ianglowz | Dores" );
    
    
p_On register_cvar"mr_allow""1" );
    
p_Limit register_cvar"mr_limit""3" );
    
register_clcmd"say /respawn""Cmd_Respawn" );
    
    
register_event"HLTV""ev_newRound""a""1=0""2=0" );
}

public 
Cmd_Respawnid )
{
    if( !
get_pcvar_nump_On ) )
    {
        
client_printidprint_chat"Manual Respawn is off!" );
        return 
PLUGIN_HANDLED;
    }
    
    new 
limit;
    if( ++
g_iRespawnCountid ] > ( limit get_pcvar_nump_Limit ) ) )
    {
        
client_printidprint_chat"You have respawned yourself too much. Wait to new round." );
        return 
PLUGIN_HANDLED;
    }
    
    if( !
is_user_aliveid ) )
    {
        
ExecuteHamBHam_CS_RoundRespawnid );
        
client_printidprint_chat"Respawns left: %d", ( limit g_iRespawnCountid ] ) );
  
        
give_item(id,"weapon_mp5navy")
        
give_item(id,"ammo_9mm")
        
give_item(id,"ammo_9mm")    
  
    }
    
    else
    {
        
client_printidprint_chat"You must be dead." );
    }
    
    return 
PLUGIN_HANDLED;
}

public 
ev_newRound()
{
    for( new 
<= get_maxplayers() ; i++ )
    {
        
g_iRespawnCount] = 0;
    }
}

public 
client_disconnectid )
{
    
g_iRespawnCountid ] = 0;

When I say /respwan,
It will show like this:

Respawn left:2

I see at one plugin,it show like this.Example that was my plugin.

ianglowz:/respawn
Respawn left at ianglowz:2

I want like this because many people don't that my server has respawn plugin.
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-27-2008 , 04:18   Re: My command.
Reply With Quote #4

Change "return PLUGIN_HANDLED" to "return PLUGIN_CONTINUE"
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-27-2008 , 04:31   Re: My command.
Reply With Quote #5

Which return must be changed?

PHP Code:
public Cmd_Respawnid )
{
    if( !
get_pcvar_nump_On ) )
    {
        
client_printidprint_chat"Manual Respawn is off!" );
        return 
PLUGIN_HANDLED;
    }
    
    new 
limit;
    if( ++
g_iRespawnCountid ] > ( limit get_pcvar_nump_Limit ) ) )
    {
        
client_printidprint_chat"You have respawned yourself too much. Wait to new round." );
        return 
PLUGIN_HANDLED;
    }
    
    if( !
is_user_aliveid ) )
    {
        
ExecuteHamBHam_CS_RoundRespawnid );
        
client_printidprint_chat"Respawns left: %d", ( limit g_iRespawnCountid ] ) );
  
        
give_item(id,"weapon_mp5navy")
        
give_item(id,"ammo_9mm")
        
give_item(id,"ammo_9mm")    
  
    }
    
    else
    {
        
client_printidprint_chat"You must be dead." );
    }
    
    return 
PLUGIN_HANDLED;

This "return PLUGIN_HANDLED"?
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-27-2008 , 04:36   Re: My command.
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define VERSION "1.0"

new p_Onp_Limit;
new 
g_iRespawnCount33 ];

public 
plugin_init()
{
    
register_plugin"Manual Respawn"VERSION"Ianglowz | Dores" );
    
    
p_On register_cvar"mr_allow""1" );
    
p_Limit register_cvar"mr_limit""1" );
    
register_clcmd"say /respawn""Cmd_Respawn" );
    
    
register_event"HLTV""ev_newRound""a""1=0""2=0" );
}

public 
Cmd_Respawnid )
{
    if( !
get_pcvar_nump_On ) )
    {
        
client_printidprint_chat"Manual Respawn is off!" );
        return 
PLUGIN_HANDLED;
    }
    
    new 
limit;
    if( ++
g_iRespawnCountid ] > ( limit get_pcvar_nump_Limit ) ) )
    {
        
client_printidprint_chat"You have respawned yourself too much. Wait to new round." );
        return 
PLUGIN_HANDLED;
    }
    
    if( !
is_user_aliveid ) )
    {
        new 
name[32]
        
get_user_name(id,name,31)    
        
ExecuteHamBHam_CS_RoundRespawnid );
        
client_printidprint_chat"%s use Manual Respawn.%d respawn left.", ( name,limit g_iRespawnCountid ] ) );
  
        
give_item(id,"weapon_mp5navy")
        
give_item(id,"ammo_9mm")
        
give_item(id,"ammo_9mm")

    }
    
    else
    {
        
client_printidprint_chat"You must be dead to acces Manual Respawn." );
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
ev_newRound()
{
    for( new 
<= get_maxplayers() ; i++ )
    {
        
g_iRespawnCount] = 0;
    }
}

public 
client_disconnectid )
{
    
g_iRespawnCountid ] = 0
Correct?
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 12-27-2008 , 04:42   Re: My command.
Reply With Quote #7

Stop double posting, and yes, that's correct. Although I don't see why you would return PLUGIN_CONTINUE. I return PLUGIN_HANDLED for all commands.
Spunky is offline
Send a message via AIM to Spunky
Old 12-27-2008, 04:54
ianglowz
This message has been deleted by ianglowz. Reason: UPS!
jim_yang
Veteran Member
Join Date: Aug 2006
Old 12-27-2008 , 04:56   Re: My command.
Reply With Quote #8

return plugin_continue in a say-style registered cmd will show the say text
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-27-2008 , 04:57   Re: My command.
Reply With Quote #9

Sorry about double post.
This from Scripting Tutorial.

Code:
Also, note PLUGIN_HANDLED. There are two main return values you should concern yourself with. PLUGIN_CONTINUE generally means "continue with normal operation", and PLUGIN_HANDLED means "block further operation". The differences are subtle but important. For example, when binding a command, you should never return PLUGIN_CONTINUE. But if you return PLUGIN_HANDLED while binding to the "say" command, it will block the player's text from ever appearing. You must be careful with which you choose in certain situations. However, most things are unaffected (such as tasks, events, and other things you will run into later on)
Like you can see.I want the text appear for everyone in my server.
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz is offline
ianglowz
Senior Member
Join Date: Nov 2008
Old 12-27-2008 , 05:06   Re: My command.
Reply With Quote #10

My plugin come more worst when put PLUGIN_CONTINUE.It don't say anything and don't give mp5navy.Just respawn.
__________________
~ +karma to me and leave your name. ~
~ If you -karma to me,please leave your name so I know you are pro scripter. ~
~ Helping anytime ~


ianglowz 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 12:52.


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