Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Bind on head?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-04-2017 , 18:28   Re: [ H3LP ] Bind on head?
Reply With Quote #10

Ok Depresie, I do a code but have one bugs. I dont know much work with entitys, but lets go.

Code:
#include <amxmodx> #include <engine> #include <fakemeta> #include <hamsandwich> #include <cs_ham_bots_api> new const ENTITY_MODEL[] = "models/bag.mdl"; public plugin_init() {     register_plugin("Plugin", "Version", "Author");     RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1);     RegisterHamBots(Ham_Spawn, "fw_PlayerSpawn_Post", 1);     register_forward(FM_Touch, "forward_touch"); } public plugin_precache() {     precache_model(ENTITY_MODEL); } public fw_PlayerSpawn_Post(id) {     if (!is_user_alive(id))         return;     new entity, Float:origin[3];     entity = create_entity("info_target");     entity_get_vector(id, EV_VEC_origin, origin);     set_pev(entity, pev_body, 1);     entity_set_model(entity, ENTITY_MODEL);     origin[2] += 10;     entity_set_origin(entity, origin);     set_pev(entity, pev_owner, id);     entity_set_string(entity, EV_SZ_classname, "entity_head");     entity_set_int(entity, EV_INT_solid, 2); } public forward_touch(toucher, touched) {     if (is_user_alive(toucher))     {         client_print(toucher, print_chat, "Touch");         dllfunc(DLLFunc_ClientKill, toucher);     } }

Now the problems of this code. First, obviously that code is killing the toucher and dont the owner of the entity. Second, I think if exists other entity in the game and a player touch he, I think will execute the "entity_head" class. You can help me to fix that? And, any optimization?

Sorry for my English.
__________________








CrazY. is offline
 



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 17:48.


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