Raised This Month: $ Target: $400
 0% 

Float array and get_user_hitpoint


Post New Thread Reply   
 
Thread Tools Display Modes
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
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-16-2011 , 18:29   Re: Float array and get_user_hitpoint
Reply With Quote #2

PHP Code:
origin3[id] = neworigin 
You have the assignment backwards.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 04-16-2011 , 19:19   Re: Float array and get_user_hitpoint
Reply With Quote #3

hm
PHP Code:
origin3[3] = neworigin 
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-16-2011 , 19:32   Re: Float array and get_user_hitpoint
Reply With Quote #4

...
PHP Code:
neworigin origin3[id
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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:12.


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