AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Another tag mismatch again (https://forums.alliedmods.net/showthread.php?t=331144)

nG_getwreck 03-08-2021 00:22

Another tag mismatch again
 
Hello, I have tag mismatch error:

PHP Code:

Showcsoxhair(const id, const target) {
    new 
Float:origin[3], Float:hudpos[2];
    
get_user_origin(targetorigin); // This line causes tag mismatch error

    
if (!get_hudmessage_locs(idoriginhudpos))
        
set_hudmessage25500, -1.0, -1.020.20.20.020.02);
    else
        
set_hudmessage0100200hudpos[0], hudpos[1], 20.13.00.020.024);

    
ShowSyncHudMsgidg_iHudSync"\         /^n+^n/         \" );



Celena Luna 03-08-2021 02:55

Re: Another tag mismatch again
 
PHP Code:

new Float:origin[3], Float:hudpos[2];
get_user_origin(targetorigin); 

=>

PHP Code:

new origin[3], Float:hudpos[2];
get_user_origin(targetorigin); 

the origin get from get_user_origin is int, not float

for float, you can get from pev
PHP Code:

new Float:origin[3]
pev(idpev_originorigin

it does the same thing but one return float, other return int
p/s: pev can get origin from other entity as well but get_user_origin can only get from player

LondoN 03-08-2021 14:13

Re: Another tag mismatch again
 
Quote:

Originally Posted by Celena Luna (Post 2739669)
PHP Code:

new Float:origin[3], Float:hudpos[2];
get_user_origin(targetorigin); 

=>

PHP Code:

new origin[3], Float:hudpos[2];
get_user_origin(targetorigin); 

the origin get from get_user_origin is int, not float

for float, you can get from pev
PHP Code:

new Float:origin[3]
pev(idpev_originorigin

it does the same thing but one return float, other return int
p/s: pev can get origin from other entity as well but get_user_origin can only get from player

Code:

//Engine
//entity_get_vector(iIndex, iKey, Float:vRetVector[3])
new Float:origin[3]
entity_get_vector(entid, EV_VEC_ORIGIN, origin)

//Fakemeta
new Float:origin[3]
pev(entid, pev_origin, origin)

for float origins
and use fun for int origins

Celena Luna 03-08-2021 21:31

Re: Another tag mismatch again
 
Quote:

Originally Posted by LondoN (Post 2739751)
Code:

//Engine
//entity_get_vector(iIndex, iKey, Float:vRetVector[3])
new Float:origin[3]
entity_get_vector(entid, EV_VEC_ORIGIN, origin)

//Fakemeta
new Float:origin[3]
pev(entid, pev_origin, origin)

for float origins
and use fun for int origins

well, if you don't like using fakemeta, entity_get_vector also work


All times are GMT -4. The time now is 15:01.

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