rehlds / ReAPI

AMXModX module providing APIs for ReHLDS, ReGameDLL, and Metamod plugins (e.g., ReUnion, ReVoice).
GNU General Public License v3.0
160 stars 105 forks source link

PlayerMove get_pmove(pm_origin) not returning anything? #119

Closed greymood09 closed 6 years ago

greymood09 commented 6 years ago

Getting player origin in RG_PM_Move hookchain using the following,

public PM_Move(const PlayerMove:ppmove, const server) 
{
    // Offset by 1, why?
    //new const id = get_pmove(pm_player_index)+1;

    new Float:flPlayerBodyOrigin[3];
    get_pmove(PlayerMove:pm_origin, flPlayerBodyOrigin);
    log_amx("%.3f", flPlayerBodyOrigin[0]);
}

returns empty float vectors into the array, is this a bug or am I doing anything wrong?

Edit: ReHLDS ver. 3.4.0.654-dev ReGameDLL ver. 5.7.0.312 ReAPI ver. 5.6.0.157

etojuice commented 6 years ago

get_pmove(pm_origin, origin, 0);

etojuice commented 6 years ago

get_pmove(pm_origin, origin, 0); @s1lentq is there any particular reason why we have to retrieve arrays like this?

greymood09 commented 6 years ago

I suppose third parameter doesn't default to 0, in AMXX get_user_origin(index, array, mode) has 5 modes, I'll assume this is the same for reapi, though it'd be nice to raise an error if it's missing. Tested and updated my answer below, this is incorrect.

etojuice commented 6 years ago

@thedoorisstuck You confuse yourself.

greymood09 commented 6 years ago

@thedoorisstuck You confuse yourself.

Thank you, very insightful. get_pmove(pm_origin, origin, 1); Will return view angle in degrees.