AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [ H3LP ] Bind on head? (https://forums.alliedmods.net/showthread.php?t=295760)

CrazY. 04-03-2017 19:14

[ H3LP ] Bind on head?
 
Hey AlliedModders, I dont find any thing about this, then... Its possible to "bind" the player into the head of the victim when the player jump? Example: player jump, if he touch the head, after X seconds use DDL_Kill of fakemeta to kill the victim, and the player continue in the X/Y position in the head of the victim.

Well, I know that is hard but dont impossible.. Have much good programmers, any help are welcome.

fysiks 04-03-2017 21:47

Re: [ H3LP ] Bind on head?
 
What??? That makes no sense. You'll need to explain in much more detail to make any sense of that.

CrazY. 04-03-2017 22:44

Re: [ H3LP ] Bind on head?
 
Quote:

Originally Posted by fysiks (Post 2509168)
What??? That makes no sense. You'll need to explain in much more detail to make any sense of that.

http://youtube.com/watch?v=ROb1IPEUC-k (facehugger attack)

CrazY. 04-04-2017 06:14

Re: [ H3LP ] Bind on head?
 
Ok.. I think that is hard to do.. Any way to do a thing style the attack of facehugger from halflife ? (The AI Jump into the Gordon, and inflict damage).

Depresie 04-04-2017 10:24

Re: [ H3LP ] Bind on head?
 
Mhmm.. Well, i got an idea..

Create an invisible entity for each player, using prethink make it stick to the player's head, then register touch to detect if any other player touched that player's head entity, and if so, make the player who touched that entity stick to it's victims head by using prethink, then set a timer and execute ham kill

Use a two dimensional boolean arrays in order to transmit the required data from touch to prethink ( g_TouchedHead[33][33], where in the first cell you will store the attacker's index and in the second one the victim's index )

CrazY. 04-04-2017 10:30

Re: [ H3LP ] Bind on head?
 
Hmm.. well, thanks for the idea Depresie, I will try do some tests.

Depresie 04-04-2017 10:32

Re: [ H3LP ] Bind on head?
 
It may be a pain in the ass for you to get this done, but i don't have time to do it myself right now..

Just try to do it yourself, and feel free to post here the code and ask questions

CrazY. 04-04-2017 10:40

Re: [ H3LP ] Bind on head?
 
No problem bro, you already gived to me the code, but in format of logic. I have one doubt, when I create a entity I think its possible change the origin, but how to?

Depresie 04-04-2017 12:48

Re: [ H3LP ] Bind on head?
 
You change it's origin using either engine natives ( engfunc ) or fakemeta native set_pev(ent, pev_origin) etc

CrazY. 04-04-2017 18:28

Re: [ H3LP ] Bind on head?
 
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.


All times are GMT -4. The time now is 17:48.

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