AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Float array and get_user_hitpoint (https://forums.alliedmods.net/showthread.php?t=155027)

OvidiuS 04-16-2011 15:05

Float array and get_user_hitpoint
 
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?

Exolent[jNr] 04-16-2011 18:29

Re: Float array and get_user_hitpoint
 
PHP Code:

origin3[id] = neworigin 

You have the assignment backwards.

OvidiuS 04-16-2011 19:19

Re: Float array and get_user_hitpoint
 
hm
PHP Code:

origin3[3] = neworigin 


Exolent[jNr] 04-16-2011 19:32

Re: Float array and get_user_hitpoint
 
...
PHP Code:

neworigin origin3[id



All times are GMT -4. The time now is 20:12.

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