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 = 0; konj<15; konj++)
{
randomx = random_num(-180, 180);
randomy = random_num(-180, 180);
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 Float: LocVec[3];
IVecFVec(radlocation, LocVec);
new Float: EndVec[3];
IVecFVec(endlocation, EndVec);
new Float: VeloVec[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_solid, SOLID_TRIGGER);
entity_set_int(g_bombe[konj], EV_INT_movetype, MOVETYPE_BOUNCE);
entity_set_edict(g_bombe[konj], EV_ENT_owner, id);
entity_set_model(g_bombe[konj], "models/rpgrocket.mdl");
entity_set_size(g_bombe[konj], Float:{- 16.0, - 16.0, 0.0 }, Float:{ 16.0, 16.0, 12.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?