Raised This Month: $ Target: $400
 0% 

Float array and get_user_hitpoint


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 04-16-2011 , 15:05   Float array and get_user_hitpoint
Reply With Quote #1

i have problem with tag mismatch
i know that get_user_hitpoint requires a float
but i created two dimensional array like this

PHP Code:
static Float:origin3[33][3]; 
now i get_user_hitpoint
PHP Code:
get_user_hitpoint(id,origin3[id]) 
then i need to copy that location and spawn entity (bombs) on it...

PHP Code:
public Bombarduj(id// miljenko pazi bombina
{
    if(
is_user_alive(id))
    {     
        new 
radlocation[3]; 
        new 
endlocation[3]; 
        new 
randomx
        new 
randomy;
        
        static 
Float:neworigin[3];
        
origin3[id] = neworigin
                
        
for(new konj 0konj<15konj++) 
        {    
            
randomx random_num(-180180); 
            
randomy random_num(-180180); 
                        
            
radlocation[0] = neworigin[0]+1*randomx
            
radlocation[1] = neworigin[1]+1*randomy
            
radlocation[2] = neworigin[2];
                 
            
endlocation[0] = radlocation[0]; 
            
endlocation[1] = radlocation[1];
            
endlocation[2] = radlocation[2] - 5
                 
            new 
FloatLocVec[3]; 
            
IVecFVec(radlocationLocVec); 
                        
            new 
FloatEndVec[3]; 
            
IVecFVec(endlocationEndVec); 
                 
            new 
FloatVeloVec[3]; 
            
VeloVec[0] = (EndVec[0] - LocVec[0])*1+1
            
VeloVec[1] = (EndVec[1] - LocVec[1])*1+1
            
VeloVec[2] = (EndVec[2] - LocVec[2])*1+1;
                        
            
g_bombe[konj] = create_entity("info_target");
                        
            
entity_set_string(g_bombe[konj], EV_SZ_classname"Bomb");
            
entity_set_int(g_bombe[konj], EV_INT_solidSOLID_TRIGGER);
            
entity_set_int(g_bombe[konj], EV_INT_movetypeMOVETYPE_BOUNCE);
            
entity_set_edict(g_bombe[konj], EV_ENT_ownerid); 
            
entity_set_model(g_bombe[konj], "models/rpgrocket.mdl");
            
entity_set_size(g_bombe[konj], Float:{- 16.0, - 16.00.0 }, Float:{ 16.016.012.0 });
            
entity_set_origin(g_bombe[konj], LocVec);
        }
    }

but here is the problem
if i set neworigin[3] as float i get tag mismatch here
PHP Code:
radlocation[0] = neworigin[0]+1*randomx
radlocation[1] = neworigin[1]+1*randomy
radlocation[2] = neworigin[2]; 
any one have idea how to spawn entity on location which i got using get_user_hitpoint
fysiks helped me a lot, and told me that
Quote:
All variables in an equation (+ - * / =) need to have the same tag.
but how to achive that in this case?
OvidiuS is offline
Send a message via Skype™ to OvidiuS
 



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:12.


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