Raised This Month: $ Target: $400
 0% 

hook consol command to my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tinlab
Member
Join Date: Oct 2006
Location: malaysia
Old 12-01-2006 , 23:32   hook consol command to my plugin
Reply With Quote #1

ok i need some help with this. i can some one please tell me how to hook the consol command to my code? i want to hook this
Code:
register_concmd("amx_setHE","function_called",ADMIN_ALL,"describe the command")
to my code which is this.
Code:
for( new j = 0 ; j < 10 ; ++j)
	{
		new iEntWeapon=create_entity( "info_target" ) ;

		entity_set_string( iEntWeapon, EV_SZ_classname, "weaponbox" );

		entity_set_int( iEntWeapon, EV_INT_movetype, MOVETYPE_FOLLOW );

		entity_set_int( iEntWeapon, EV_INT_solid, SOLID_NOT );

		entity_set_edict( iEntWeapon, EV_ENT_aiment, iEntOwner );

		entity_set_model( iEntWeapon, "models/p_hegrenade.mdl" );

	}
after i hook that i need to get something that connects the entities touch damage to the rest of the code.
Code:
plugin_init()
 
register_touch("my_ent" , "player","function_called_from");
 
public function_called_from()
{
	do 69.75
}
can anyone help me out here? +karma to the people that helps out!
__________________
TehCeaser - Two - Thee slashes then a stab? Or 2 stabs, or perhaps all slashes? You decide.
The Specialist -Be the first one to stab , then the 2nd stab comes easy
TehCeaser - What if you can't pull the first stab off o.O
The Specialist - Then you shoot him in the head .
TehCeaser - word
tinlab is offline
Send a message via AIM to tinlab Send a message via MSN to tinlab
The Specialist
BANNED
Join Date: Nov 2006
Old 12-02-2006 , 00:43   Re: hook consol command to my plugin
Reply With Quote #2

Code:
public plugin_init() {           register_concmd("what_they_type","function_it_calls");           register_touch("my_ent" , "player","function_called_from"); } public function_it_calls() {     for( new j = 0 ; j < 10 ; ++j)     {         new iEntWeapon=create_entity( "info_target" ) ;           entity_set_string( iEntWeapon, EV_SZ_classname, "weaponbox" );           entity_set_int( iEntWeapon, EV_INT_movetype, MOVETYPE_FOLLOW );           entity_set_int( iEntWeapon, EV_INT_solid, SOLID_NOT );           entity_set_edict( iEntWeapon, EV_ENT_aiment, iEntOwner );           entity_set_model( iEntWeapon, "models/p_hegrenade.mdl" );  } public function_called_from() {     do 69.75 }

Walla!
The Specialist is offline
Send a message via AIM to The Specialist
tinlab
Member
Join Date: Oct 2006
Location: malaysia
Old 12-02-2006 , 02:16   Re: hook consol command to my plugin
Reply With Quote #3

Quote:
Originally Posted by The Specialist View Post

Walla!
haha thanks man ur the best
__________________
TehCeaser - Two - Thee slashes then a stab? Or 2 stabs, or perhaps all slashes? You decide.
The Specialist -Be the first one to stab , then the 2nd stab comes easy
TehCeaser - What if you can't pull the first stab off o.O
The Specialist - Then you shoot him in the head .
TehCeaser - word
tinlab is offline
Send a message via AIM to tinlab Send a message via MSN to tinlab
The Specialist
BANNED
Join Date: Nov 2006
Old 12-02-2006 , 02:45   Re: hook consol command to my plugin
Reply With Quote #4

Also i seriously suggest you hault your work on this . from the way you coded this i can tell you dont grasp the fundamentlas of programming. You have functions not closed , registers randomly in the middle of the script. And your trying to code a pretty advanced script . I dont condone this . start small. learn the basics.

read these tutorials first
http://wiki.amxmodx.org/index.php/Ca...28AMX_Mod_X%29
start with the basic pawn tutorial then work your way up.
http://www.compuphase.com/pawn/pawn.htm#DOWNLOAD_DOCS
http://djeyl.net/forum/index.php?showtopic=17495
http://amxmodx.org/doc/

read these first . Im willing to help people learn but if you dont want to learn then dont bother me
The Specialist is offline
Send a message via AIM to The Specialist
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 15:22.


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