Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetPlayerAnimationIndex #64

Open
Disinterpreter opened this issue Jun 28, 2020 · 4 comments
Open

GetPlayerAnimationIndex #64

Disinterpreter opened this issue Jun 28, 2020 · 4 comments
Labels
compatibility Compatibility with latest version of SAMP depends on blue The feature might depend on MTA:SA source code function SAMP functions

Comments

@Disinterpreter
Copy link
Member

Disinterpreter commented Jun 28, 2020

Function name
GetPlayerAnimationIndex(playerid)

Describe the function
Returns the index of any running applied animations.

Equivalent in MTA
https://wiki.multitheftauto.com/wiki/GetPedAnimation

Additional information
https://team.sa-mp.com/wiki/GetPlayerAnimationIndex.html

The array which contains BLOCK:ANIMATION = indexid(of SAMP)
defines.lua.txt

@Disinterpreter Disinterpreter added function SAMP functions compatibility Compatibility with latest version of SAMP depends on blue The feature might depend on MTA:SA source code labels Jun 28, 2020
@colistro123
Copy link
Collaborator

wow nice work, please commit if you have this down :D

@Disinterpreter
Copy link
Member Author

Disinterpreter commented Jun 28, 2020

wow nice work, please commit if you have this down :D

When someone makes server side of this function. I will make it here.

Or if you find a solution of realizing of this function. You can commit it.

@colistro123
Copy link
Collaborator

colistro123 commented Jun 30, 2020

wow nice work, please commit if you have this down :D

When someone makes server side of this function. I will make it here.

Or if you find a solution of realizing of this function. You can commit it.

My idea was to parse the array based on the current animation, but this would be slow if the function were to be called in a timer continuously. It seems that MTA has a client function AssocGroupCopyAnimationHandler that handles animation ids (according to sa android dumps, this function CAnimBlendAssocGroup::CopyAnimation gets called every time an animation needs to be blended), perhaps those are the actual indexes (never had a chance to see how samp does it exactly)

https://github.com/multitheftauto/mtasa-blue/blob/7399bf620b7d5846a87642a4f154d8414a58f4a5/Client/mods/deathmatch/logic/CClientGame.cpp#L4104

If this were the case, perhaps adding a shared native to get the current animation would be a possibility, but would probably require to also send the index to the server via an RPC or on foot sync/whatever mta uses for it.

@Disinterpreter
Copy link
Member Author

Disinterpreter commented Jul 1, 2020

wow nice work, please commit if you have this down :D

When someone makes server side of this function. I will make it here.
Or if you find a solution of realizing of this function. You can commit it.

My idea was to parse the array based on the current animation, but this would be slow if the function were to be called in a timer continuously. It seems that MTA has a client function AssocGroupCopyAnimationHandler that handles animation ids (according to sa android dumps, this function CAnimBlendAssocGroup::CopyAnimation gets called every time an animation needs to be blended), perhaps those are the actual indexes (never had a chance to see how samp does it exactly)

https://github.com/multitheftauto/mtasa-blue/blob/7399bf620b7d5846a87642a4f154d8414a58f4a5/Client/mods/deathmatch/logic/CClientGame.cpp#L4104

If this were the case, perhaps adding a shared native to get the current animation would be a possibility, but would probably require to also send the index to the server via an RPC or on foot sync/whatever mta uses for it.

Oh... I think we have carte blanche for all issues with blue by @qaisjp :) If you want to request any feature in blue. You can make an issue in Blue and link it with an amx issue.

Feel free when you make an issues or PR in blue repo. (There is only one problem. All PR will be merge only after 1.5.8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with latest version of SAMP depends on blue The feature might depend on MTA:SA source code function SAMP functions
Projects
None yet
Development

No branches or pull requests

2 participants