Raised This Month: $ Target: $400
 0% 

[Help] Simple - register_clcmd("buy" , "cmdKill")


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-20-2015 , 16:41   [Help] Simple - register_clcmd("buy" , "cmdKill")
Reply With Quote #1

PHP Code:
#include amxmodx
#include amxmisc
#include cstrike
#include colorchat
#include fakemeta
#include engine

#define PLUGIN_NAME "My plugin"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "None"




public plugin_init() {

    
register_plugin    (         PLUGIN_NAME         ,    PLUGIN_VERSION            ,      PLUGIN_AUTHOR          )
    
    
register_clcmd(      "buy"         ,       "cmdKill" )
    
}

public 
cmdKill(id){
    
    
//testing if work before using get_user_aiming but no chance
   
ColorChat(id,GREEN,"[TEST] ^1Working!");


When i change "buy" to anyone else like "testme" works but buy doesnt work , why?
I have seen on different pawn lessons that this is possible but it doesnt work to me.

Last edited by siriusmd99; 07-20-2015 at 16:42.
siriusmd99 is offline
Decak
Senior Member
Join Date: Sep 2012
Old 07-20-2015 , 18:06   Re: [Help] Simple - register_clcmd("buy" , "cmdKill")
Reply With Quote #2

Explain what you want to do, I don't understand you.
Decak is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-20-2015 , 18:11   Re: [Help] Simple - register_clcmd("buy" , "cmdKill")
Reply With Quote #3

When i press b or type buy in console it doesnt write the message. Cmdkill is not called.
siriusmd99 is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 07-20-2015 , 19:15   Re: [Help] Simple - register_clcmd("buy" , "cmdKill")
Reply With Quote #4

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "0.Ox"
#define AUTHOR "Hades Ownage"

new const g_buy_commands[][] = 
{
    
"usp""glock""deagle""p228""elites",
    
"fn57""m3""xm1014""mp5""tmp",
    
"p90""mac10""ump45""ak47""galil",
    
"famas""sg552""m4a1""aug""scout",
    
"awp""g3sg1""sg550""m249""vest",
    
"vesthelm""flash""hegren""sgren""defuser",
    
"nvgs""shield""primammo""secammo""km45",
    
"9x19mm""nighthawk""228compact""fiveseven""12gauge",
    
"autoshotgun""mp""c90""cv47""defender",
    
"clarion""krieg552""bullpup""magnum""d3au1",
    
"krieg550""buy""buyequip""cl_autobuy""cl_rebuy",
    
"cl_setautobuy""cl_setrebuy""client_buy_open"
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    for ( new 
0sizeof g_buy_commands ); i++ )
        
register_clcmd(g_buy_commands[i], "clcmd_pub")
}

public 
clcmd_pubid ) {
    
    
// bla bla 
    


Last edited by hadesownage; 07-20-2015 at 19:16.
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-21-2015 , 02:39   Re: [Help] Simple - register_clcmd("buy" , "cmdKill")
Reply With Quote #5

I will explain. I have basebuilder server and there are not buy zones. I dont want to make buy menu , i want to make slay by aim when admin press "b" without binding a key. You wrote for loop for every weapon , i think it will slow down server because it registers about 20 commands,isnt it?
siriusmd99 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-21-2015 , 03:28   Re: [Help] Simple - register_clcmd("buy" , "cmdKill")
Reply With Quote #6

Quote:
Originally Posted by hadesownage View Post
Try this:
I tried more simple :
register_clcmd( "buy" , "cmdRemove" )
register_clcmd( "client_buy_open" , "cmdRemove" )

And it works when i am in buy zone and i press b but i want outside of buy zones.

Tried with your full script and doesnt work because i'm not in a buy zone. I dont have buy zones on basebuilder.

Last edited by siriusmd99; 07-21-2015 at 03:40.
siriusmd99 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-21-2015 , 03:45   Re: [Help] Simple - register_clcmd("buy" , "cmdKill")
Reply With Quote #7

Close the Topic . Solved . I have replaced buy with drop because on bb i can't drop weapon and this solved the problem.
siriusmd99 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 20:48.


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