Raised This Month: $51 Target: $400
 12% 

Small entity help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-09-2018 , 12:38   Small entity help
Reply With Quote #1

im troubling with entity parts of the code...idea is: on command make entity_number++
while creating these entities, it gives me correct names (enum used)...first, second, third...but the problem is: when i touch for example second entity, it is showing i touched the last one (third for example)...anyway to fix it?

PHP Code:
entity_get_vector(id,EV_VEC_origin,origin
    
    new 
ent create_entity("info_target"
    
    
entity_set_origin(ent,origin); 
    
    
entity_number++
    
    
formatexmodel_namecharsmaxmodel_name ), "demo_model%d"entity_number )
    
entity_set_string(ent,EV_SZ_classnamemodel_name);//maybe here is the problem?
    
entity_set_model(ent,g_Model);
    
    
entity_set_int(ent,EV_INT_solid1
    
    new 
Float:maxs[3] = {100.0,100.0,36.0
    new 
Float:mins[3] = {-100.0,-100.0,-36.0
    
entity_set_size(ent,mins,maxs
    
    
set_pev(entpev_rendermodekRenderTransAlpha)
    
    
drop_to_floor(ent
    
    new 
targetName[35]
    
entity_get_string(entEV_SZ_classnametargetNamecharsmax(targetName))
    
    new 
model_id;
    if(
TrieGetCell(g_modelstargetNamemodel_id))
    {
        switch(
model_id)
        {
            case 
npc_1number_ent "First"
            
case npc_2number_ent "Second"
            
case npc_3number_ent "Third" 
        
}
    }
    
    
    return 
1
and a msg when im touching it:

PHP Code:
show_dhudmessageid"Position: %s"number_ent

Last edited by JocAnis; 04-09-2018 at 20:18.
JocAnis is offline
Reply



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 20:34.


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