AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hook consol command to my plugin (https://forums.alliedmods.net/showthread.php?t=47997)

tinlab 12-01-2006 23:32

hook consol command to my plugin
 
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! :up:

The Specialist 12-02-2006 00:43

Re: hook consol command to my plugin
 
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!

tinlab 12-02-2006 02:16

Re: hook consol command to my plugin
 
Quote:

Originally Posted by The Specialist (Post 409698)

Walla!

haha thanks man ur the best

The Specialist 12-02-2006 02:45

Re: hook consol command to my plugin
 
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 :nono: . 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 :nono:


All times are GMT -4. The time now is 06:49.

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