Raised This Month: $ Target: $400
 0% 

[CS] Player Models API 1.2


Post New Thread Reply   
 
Thread Tools Display Modes
cr0w
Senior Member
Join Date: Mar 2014
Location: middle east
Old 09-26-2014 , 04:08   Re: [CS] Player Models API 1.2
Reply With Quote #21

can some one tell me more about Player Model API ?

how doin this plugin
__________________
the city is no fun
there is no sun
and its so dark
cr0w is offline
Send a message via Yahoo to cr0w Send a message via Skype™ to cr0w
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 09-26-2014 , 04:30   Re: [CS] Player Models API 1.2
Reply With Quote #22

Precache your custom model, then use the native.
Example:
PHP Code:
precache_model("models/player/cr0w/cr0w.mdl")
cs_set_player_model(id"cr0w"
RateX is offline
waza123a
Member
Join Date: Mar 2010
Old 04-12-2015 , 05:39   Re: [CS] Player Models API 1.2
Reply With Quote #23

thanks, very useful !

This method fixes the bug when you set model with function cs_set_user_model()
and then user can manually in console change his model to any with this command: model gordon
__________________
Life is good, sometimes...
waza123a is offline
happy_2012
Senior Member
Join Date: Aug 2012
Old 06-12-2015 , 16:55   Re: [CS] Player Models API 1.2
Reply With Quote #24

I used to have a server running this API ( It was a zombie plague server ), I modified this function and used engfunc() native to set user a new information so I have replaced it with already used native set_user_info(). Also, I edited some functions, and totally fixed the problem.

The problem was that the players are enforced to download bad model files that does not exist in the server and eventually crash player's CS and require the server to crash.

If you would grant me the permission to post the new version, I would do it, otherwise I will not and I will keep it private on my server.
__________________
Discord contacts:
I rarely look at private messages here, but I am very active on Discord!

Last edited by happy_2012; 06-12-2015 at 16:56.
happy_2012 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-05-2015 , 14:38   Re: [CS] Player Models API 1.2
Reply With Quote #25

You don't need permission happy_2012. Since author is inactive, if you have a fixed version, you should post it.
__________________
Arkshine is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 07-05-2015 , 18:20   Re: [CS] Player Models API 1.2
Reply With Quote #26

why such thing can't be implemented in amxmodx? I mean that if you will start changing player models aggressively (like >=24 modelchanges at the same time) clients might start getting svc_bad errors. There's nothing wrong with cs_set_user_model, it just need to be somehow adjusted to remove problems with svc_bad.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-05-2015 , 18:42   Re: [CS] Player Models API 1.2
Reply With Quote #27

It's what I'm actually doing, will probably go with game way.
__________________
Arkshine is offline
happy_2012
Senior Member
Join Date: Aug 2012
Old 07-14-2015 , 19:14   Re: [CS] Player Models API 1.2
Reply With Quote #28

Change Logs:
- Moved from using 'set_user_info()' native to 'engfunc()' native.
- Updated'fw_SetClientKeyValue' functionality.
- In addition to 'fw_SetClientKeyValue' I also used 'fw_ClientUserInfoChanged' forward.

I would like to tell why did I actually update this API. I was using Zombie Plague 5.0 which obviously use this API in most of it's plugins, and sub-plugins, and for some reasons, it was forcing players to download non-existing files which cause them to leave the server and sometimes leave the whole game, I looked in many codes that change player models, and to be precise, I looked into Base Builder 6.5 by Tirant, he was using a different native 'engfunc()' not the 'set_user_info()' so I tried changing it, and I have noticed that he is using 'fw_ClientUserInfoChanged' forward, and a different code in the 'fw_SetClientKeyValue', I tried modifying this API like the code in Tirant's BB Plugin, and it actually worked.

And now here I am sharing it for everyone, I also changed the version from "1.2" to "1.3", though it is not a core change, but I believe that this version fixed the problem!

Kind Regards,
happy_2012
Attached Files
File Type: sma Get Plugin or Get Source (cs_player_models_api.sma - 946 views - 7.3 KB)
__________________
Discord contacts:
I rarely look at private messages here, but I am very active on Discord!
happy_2012 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-14-2015 , 21:39   Re: [CS] Player Models API 1.2
Reply With Quote #29

Would love to hear feedbacks from other users that is using you new update. ;)
zmd94 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-15-2015 , 03:03   Re: [CS] Player Models API 1.2
Reply With Quote #30

Actually, I fixed the natives related to setting a model, which is going to be merged soon : https://github.com/alliedmodders/amxmodx/pull/255
Essentially, the issue is an engine bug which doesn't check for overflow, so solution is to send each update to the next frame.
This is actually similar to the above API except it sets right away the model for maximizing backward compatibility but force postponing engine update to next frame.

If you want to see how it's done, it's basically this file and this one.

EDIT: Merged!
__________________

Last edited by Arkshine; 07-15-2015 at 16:40.
Arkshine is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:02.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode