Raised This Month: $ Target: $400
 0% 

@ HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
totalcsscripting
BANNED
Join Date: Jul 2010
Old 08-16-2010 , 18:21   @ HELP
Reply With Quote #1

I have this simple function.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>


public plugin_init()
{
    
register_concmd("amx_vida","admin_vida",ADMIN_SLAY,"")
    return 
PLUGIN_CONTINUE
}
public 
admin_vida(id,level,cid) {
    if (!
cmd_access(id,level,cid,3))
    return 
PLUGIN_HANDLED
    
new arg[32], arg2[8], name2[32]
    
read_argv(1,arg,31)
    
read_argv(2,arg2,7)
    
get_user_name(id,name2,31)
    if (
arg[0]=='@'){
        new 
players[32], inum
        get_players
(players,inum,"ae",arg[1])
        if (
inum==0){
            return 
PLUGIN_HANDLED
        
}
        for(new 
a=0;a<inum;++a) {
            
client_print(idprint_chat"[TotalCS] Le cambiaste la vida a tu team!"
            
set_user_health(players[a], str_to_num(arg2))
        }
    }
    else {
        new 
player cmd_target(id,arg,7)
        if (!
player) return PLUGIN_HANDLED
        
        set_user_health
(playerstr_to_num(arg2))
        
client_print(idprint_chat"[TotalCS] Cambiaste tu vida!"
        new 
name[32]
        
get_user_name(player,name,31)

    }
    return 
PLUGIN_HANDLED

I can set helth to any player properly.
But when i try to set it to all:
amx_vida @ 200

Nothing Happens!!
totalcsscripting is offline
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 08-16-2010 , 18:31   Re: @ HELP
Reply With Quote #2

amx_vida @all 200 ;)
platzpatrone is offline
totalcsscripting
BANNED
Join Date: Jul 2010
Old 08-16-2010 , 18:35   Re: @ HELP
Reply With Quote #3

Quote:
Originally Posted by platzpatrone View Post
amx_vida @all 200 ;)
I already tried that and still doesn't work!!
totalcsscripting is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 08-16-2010 , 18:37   Re: @ HELP
Reply With Quote #4

Just use starting health
Isn't that better?
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
totalcsscripting
BANNED
Join Date: Jul 2010
Old 08-16-2010 , 18:44   Re: @ HELP
Reply With Quote #5

I need to solve this. Not other ideas. Thanks
totalcsscripting is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-16-2010 , 19:16   Re: @ HELP
Reply With Quote #6

Your code is not set to handle the @ALL arg. Here is a snippet from another plugin
PHP Code:
if( arg[0] == '@' )
    {
        new 
players[32], pnum
        
if( arg[1] == 'a' || arg[1] == 'A' )
        {
            
formatexarg31"everyone" )
            
get_playersplayerspnum"a" )
        }
        else if( 
arg[1] == 'c' || arg[1] == 'C' )
        {
            
formatexarg31"all CTs" )
            
get_playersplayerspnum"ae""CT" )
        }
        else if( 
arg[1] == 't' || arg[1] == 'T' )
        {
            
formatexarg31"all Ts" )
            
get_playersplayerspnum"ae""TERRORIST" )
        }
        else    return 
PLUGIN_HANDLED

        
if( !pnum ) return PLUGIN_HANDLED 
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
totalcsscripting
BANNED
Join Date: Jul 2010
Old 08-16-2010 , 19:42   Re: @ HELP
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
Your code is not set to handle the @ALL arg. Here is a snippet from another plugin
PHP Code:
if( arg[0] == '@' )
    {
        new 
players[32], pnum
        
if( arg[1] == 'a' || arg[1] == 'A' )
        {
            
formatexarg31"everyone" )
            
get_playersplayerspnum"a" )
        }
        else if( 
arg[1] == 'c' || arg[1] == 'C' )
        {
            
formatexarg31"all CTs" )
            
get_playersplayerspnum"ae""CT" )
        }
        else if( 
arg[1] == 't' || arg[1] == 'T' )
        {
            
formatexarg31"all Ts" )
            
get_playersplayerspnum"ae""TERRORIST" )
        }
        else    return 
PLUGIN_HANDLED

        
if( !pnum ) return PLUGIN_HANDLED 
Is there a way of only putting "@" and that the plugin recognise in what team you are and then sets what you want only in your team
totalcsscripting is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-16-2010 , 22:31   Re: @ HELP
Reply With Quote #8

Yes, if you code it to do that
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 21:52.


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