Raised This Month: $ Target: $400
 0% 

get health from classname?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cigojlo
Senior Member
Join Date: May 2013
Location: Serbia / Belgrade
Old 09-06-2013 , 05:38   get health from classname?
Reply With Quote #1

I want to get health from lasermine plugin but idk how pls help here is part when owner of plugin set health of lasermine in this line set_user_health(i_Ent,get_pcvar_num(g_LHEALTH )); and i want to get_user_health from lasermine to edit this plugin, pls someone?
PHP Code:
public Spawnid )
{
    
id -= TASK_PLANT
    
// motor
    
new i_Ent engfunc(EngFunc_CreateNamedEntity,g_EntMine);
    if(!
i_Ent)
    {
        
client_print(id,print_chat,"[ZP] Can't Create Entity");
        return 
PLUGIN_HANDLED_MAIN;
    }
    
set_pev(i_Ent,pev_classname,ENT_CLASS_NAME);

    
engfunc(EngFunc_SetModel,i_Ent,ENT_MODELS);

    
set_pev(i_Ent,pev_solid,SOLID_NOT);
    
set_pev(i_Ent,pev_movetype,MOVETYPE_FLY);

    
set_pev(i_Ent,pev_frame,0);
    
set_pev(i_Ent,pev_body,3);
    
set_pev(i_Ent,pev_sequence,TRIPMINE_WORLD);
    
set_pev(i_Ent,pev_framerate,0);
    
    
set_pev(i_Ent,pev_takedamage,DAMAGE_YES);
    
    
set_pev(i_Ent,pev_dmg,100.0);
    
set_user_health(i_Ent,get_pcvar_num(g_LHEALTH)); 
__________________
Quote:
Originally Posted by ghinghis View Post
the fuking TOP.SMA cannot be compiled moron !!!!!

Last edited by Cigojlo; 09-06-2013 at 05:39.
Cigojlo is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 09-06-2013 , 09:00   Re: get health from classname?
Reply With Quote #2

set_user_health only works for players, not for non-player entitys.

To set/get health to/from a non-player entity use pev_health (fakemeta way)
__________________
simanovich is offline
Cigojlo
Senior Member
Join Date: May 2013
Location: Serbia / Belgrade
Old 09-06-2013 , 12:57   Re: get health from classname?
Reply With Quote #3

thanks i'll try ;;)
__________________
Quote:
Originally Posted by ghinghis View Post
the fuking TOP.SMA cannot be compiled moron !!!!!
Cigojlo is offline
colossus
Member
Join Date: Sep 2013
Old 09-07-2013 , 19:34   Re: get health from classname?
Reply With Quote #4

Try:

Code:
set_pev(i_Ent, pev_health, get_pcvar_float(g_LHEALTH)); // Set entity health with fakemeta

Last edited by colossus; 09-07-2013 at 19:34.
colossus is offline
Reply


Thread Tools
Display Modes

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 19:08.


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