Raised This Month: $ Target: $400
 0% 

client_command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-05-2010 , 10:31   client_command
Reply With Quote #1

PHP Code:
public client_command(plr)
{
    if( !
is_user_alive(plr) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    new 
sCommand[10];
    
read_argv(0sCommand9);
    if( 
equali(sCommand"drop"0) && gLastRequest == true && gToss == false  )
    {
        
client_print_colorplrBlue"^4[Jailbreak] ^1You can't drop your weapon during a last request^4!" )
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

Am I missing something? If its a last request, and gToss isn't true, then it wont let you drop the weapon. But for some reason, even if gToss is true, it lets you drop the weapon..
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-05-2010 , 10:36   Re: client_command
Reply With Quote #2

register_clcmd "drop", "CmdDrop"; use this
__________________
xPaw is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-05-2010 , 10:38   Re: client_command
Reply With Quote #3

Quote:
Originally Posted by xPaw View Post
register_clcmd "drop", "CmdDrop"; use this
Bah.

PHP Code:
public cmdDrop(id)
{
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    if( 
gLastRequest == true && gToss == false  )
    {
        
client_print_coloridBlue"^4[Jailbreak] ^1You can't drop your weapon during a last request^4!" )
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

If I'm not mistaken.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
katna
Senior Member
Join Date: May 2010
Old 08-05-2010 , 16:23   Re: client_command
Reply With Quote #4

should work, buy you can use
PHP Code:
if(gLastRequest && !gToss// if gLastRequest == true and gToss == false 
katna is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 08-05-2010 , 16:30   Re: client_command
Reply With Quote #5

Quote:
Originally Posted by katna View Post
PHP Code:
if(gLastRequest && !gToss// if gLastRequest == true and gToss == false 
The exact same thing. That makes no difference whatsoever.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
katna
Senior Member
Join Date: May 2010
Old 08-05-2010 , 16:44   Re: client_command
Reply With Quote #6

Quote:
Originally Posted by DarkGod View Post
The exact same thing. That makes no difference whatsoever.
that the point. its just shorter.
katna is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 08-05-2010 , 16:46   Re: client_command
Reply With Quote #7

Quote:
Originally Posted by katna View Post
that the point. its just shorter.
Ever heard of readability?
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
pike
Junior Member
Join Date: Jun 2009
Old 09-10-2010 , 01:45   Re: client_command
Reply With Quote #8

help to catch an event a client did not send a command
Code:
cmd[i]
PHP Code:
public client_command(id
{
        new 
argv[32]
        
read_argv(0,argvsizeof(argv)-1)
        for (new 
0MAX_CMDi++)
        if (
equal(argv,cmd[i]))
    {
        
client_print(0print_chat,"Client sent a command %s"cmd[i])
        return 
PLUGIN_HANDLED
}
//  help
    
if  client did not send a command cmd[i] ...
// 

Last edited by pike; 09-10-2010 at 01:48.
pike is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-10-2010 , 03:39   Re: client_command
Reply With Quote #9

Quote:
Originally Posted by pike View Post
help to catch an event a client did not send a command
Code:
cmd[i]
PHP Code:
public client_command(id
{
        new 
argv[32]
        
read_argv(0,argvsizeof(argv)-1)
        for (new 
0MAX_CMDi++)
        if (
equal(argv,cmd[i]))
    {
        
client_print(0print_chat,"Client sent a command %s"cmd[i])
        return 
PLUGIN_HANDLED
}
//  help
    
if  client did not send a command cmd[i] ...
// 
Using tries would be much much more efficient.
__________________
fysiks 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 00:11.


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