Raised This Month: $ Target: $400
 0% 

How can I find a target?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Boyka Abi
BANNED
Join Date: May 2012
Old 05-18-2012 , 15:05   How can I find a target?
Reply With Quote #1

Hi people, as you can see im asking a really simple question. I wanna make a command like for example u say !kick (name) in the chat that user will get kicked, but I dont know how to find the target
Boyka Abi is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-18-2012 , 15:13   Re: How can I find a target?
Reply With Quote #2

find_target
__________________
<VeCo> is offline
Boyka Abi
BANNED
Join Date: May 2012
Old 05-18-2012 , 15:21   Re: How can I find a target?
Reply With Quote #3

Quote:
Originally Posted by <VeCo> View Post
find_target
I still dont get it, how will I find the target by typing it, for example in the chat: !kick (name)
Boyka Abi is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-18-2012 , 15:29   Re: How can I find a target?
Reply With Quote #4

Take a look at this. player menu
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-18-2012 , 15:33   Re: How can I find a target?
Reply With Quote #5

Read the second argument from the chat command (read_argv or read_args natives) and use that arg in the cmd_target native (accepts username and #userid).

My mistake : it's cmd_target, not find_target.
__________________

Last edited by <VeCo>; 05-18-2012 at 15:33.
<VeCo> is offline
Boyka Abi
BANNED
Join Date: May 2012
Old 05-18-2012 , 15:37   Re: How can I find a target?
Reply With Quote #6

I've tryed

PHP Code:
public Cmdsay(id)
{
    new 
message[194]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
    
    if (
containi(message"!slap") == 0)
    {
        
strbreak(message""0messagecharsmax(message))
        
        new 
arg[35]
        
strbreak(messageargcharsmax(arg), messagecharsmax(message))
        
        
trim(arg)
        
trim(message)
        
        if (
arg[0] && message[0])
        {
            new 
target cmd_target(idarg0)
            
            new 
name[32], name2[32]
            
get_user_name(idname31)
            
get_user_name(targetname231)
            
            if (
target)
            {
                
user_slap(target0)
                
ColorChat(0GREY"%s ^4%s^4 has slapped ^4%s"Prefixnamename2)
            }
            else if (!
target)
            {
                
ColorChat(idGREY"%s ^1Couldn't find player: %s"Prefixarg)
            }
        }
    }

Cant make this to work.
Boyka Abi is offline
Boyka Abi
BANNED
Join Date: May 2012
Old 05-18-2012 , 18:58   Re: How can I find a target?
Reply With Quote #7

Hmm nevermind, can anyone help me and tell me what im doing wrong in this code.

PHP Code:
public Cmdsay(id)
{
    new 
message[192]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
    
    if (
equal(message"!slap"))
    {
        new 
arg[65]
        
read_args(argcharsmax(arg))
        
parse(messageargcharsmax(arg))
        
        new 
target cmd_target(idarg)
        
        new 
name[32], name2[32]
        
get_user_name(idname31)
        
get_user_name(targetname231)
        
        if (
target)
        {
            
user_slap(target0)
            
ColorChat(0GREY"%s ^4%s^1 has slapped ^4%s"Prefixnamename2)
        }
    }
    return 
PLUGIN_CONTINUE

Boyka Abi is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-18-2012 , 19:42   Re: How can I find a target?
Reply With Quote #8

you should use read_argv() instead. It can detect which word have been typed as first, second, third, ...
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Boyka Abi
BANNED
Join Date: May 2012
Old 05-18-2012 , 20:01   Re: How can I find a target?
Reply With Quote #9

Already tryed that aint working either.
Boyka Abi is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-18-2012 , 22:00   Re: How can I find a target?
Reply With Quote #10

Post Deleted. I refuse to help banned members.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 05-20-2012 at 09:52.
hornet 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:26.


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