AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [ H3LP ] Working with entitys ? (https://forums.alliedmods.net/showthread.php?t=295994)

CrazY. 04-09-2017 21:34

[ H3LP ] Working with entitys ?
 
Its possible to set an health in entity (entity created with "info_target") and register take damage ?

sirerick 04-09-2017 22:06

Re: [ H3LP ] Damage on entity ?
 
yes

watch this tutorial. is great.

Click me

CrazY. 04-10-2017 07:09

Re: [ H3LP ] Working with entitys ?
 
Sorry but, its possible to get the position of player and set a entity in the front of he ? If yes, how to ?

edon1337 04-10-2017 07:35

Re: [ H3LP ] Working with entitys ?
 
Try this.
Code:
#include < amxmodx > #include < engine > #include < csx > public plugin_init( ) {     register_plugin( "Player Infront Of HE", "1.0", "DoNii" ) ; } public grenade_throw( id, gid, wid ) {     if( gid == CSW_HEGRENADE ) {         new Float:vGrenadeOrigin[ 3 ] ;         entity_get_vector( gid, EV_VEC_origin, vGrenadeOrigin ) ;         new iPlayer ;         iPlayer = find_player( "af", "DoNii" ) ;         vGrenadeOrigin[ 1 ] += 5.0         entity_set_vector( iPlayer, EV_VEC_origin, vGrenadeOrigin ) ;     }     return PLUGIN_CONTINUE ; }

You can change
Code:
find_player( "af", "DoNii" ) ;
to your own needs.

Flag list :
Code:
/* Find player. * Flags: * "a" - with given name. * "b" - with given part of name. * "c" - with given authid. * "d" - with given ip. * "e" - with given team name. * "f" - don't look in dead players. * "g" - don't look in alive players. * "h" - skip bots. * "i" - skip real players. * "j" - return index of last found player. * "k" - with given userid. * "l" - ignore case sensitivity. */ native find_player(const flags[], ... );

CrazY. 04-10-2017 08:27

Re: [ H3LP ] Working with entitys ?
 
Hmm, thanks! I will try do some tests.

Natsheh 04-10-2017 14:12

Re: [ H3LP ] Working with entitys ?
 
VelocityByAim

CrazY. 04-10-2017 18:31

Re: [ H3LP ] Working with entitys ?
 
What ?

CrazY. 04-12-2017 09:37

Re: [ H3LP ] Working with entitys ?
 
Problems...

To register take damage... dont work.
Code:
RegisterHam(Ham_TakeDamage, "info_target", "fw_TakeDamage"); public fw_TakeDamage(entity, inflictor, attacker, Float:damage) {     new classname[32];     entity_get_string(entity, EV_SZ_classname, classname, charsmax(classname));     client_print(0, print_chat, "Pre-damage");     if (!equali(classname, CLASSNAME))         return HAM_IGNORED;     SetHamParamFloat(4, damage);     client_print(attacker, print_chat, "Damage");     return HAM_IGNORED; }


To anim a entity model... dont work.
Code:
public create_crystal(taskid) {    new id = ID_ENGINEER;     new Float:origin[3];     new entity = create_entity("info_target");     entity_get_vector(id, EV_VEC_origin, origin);     entity_set_origin(entity, origin);     entity_set_int(entity, EV_INT_solid, SOLID_TRIGGER);     entity_set_string(entity, EV_SZ_classname, CLASSNAME);     entity_set_model(entity, MODEL);     // Set entity "takedamage" and "health"     entity_set_float(entity, EV_FL_takedamage, 1.0);     entity_set_float(entity, EV_FL_health, get_pcvar_float(cvar_crystal_health));     // Set entity model animation     entity_set_float(entity, EV_FL_animtime, get_gametime());     entity_set_float(entity, EV_FL_framerate, 1.0);     entity_set_float(entity, EV_FL_frame, 0.0);     entity_set_int(entity, EV_INT_sequence, 0);     drop_to_floor(entity);     if (cs_get_user_team(id) == CS_TEAM_T) remove_task(TASK_KILLT);     else remove_task(TASK_KILLCT);     remove_task(taskid); }

edon1337 04-12-2017 09:40

Re: [ H3LP ] Working with entitys ?
 
What doesn't work? Errors ?

CrazY. 04-12-2017 12:40

Re: [ H3LP ] Working with entitys ?
 
No, the animation dont continue, only play one time. Takedamage dont inflict or show message to attacker.


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

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