Raised This Month: $90 Target: $400
 22% 

[CS] Player Models API 1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 07-05-2011 , 06:23   [CS] Player Models API 1.2
Reply With Quote #1

[CS] Player Models API


This is basically an API intended to replace <cstrike> player model changing natives, based off my previous tutorial ([TUT-CS] Changing player models and lowering svc_bad). I did this mainly for scripters that don't really care about the specifics, and just want something that works out of the box.

Details:
  • Allows easily setting and restoring custom player models in CS and CZ (models last until player disconnects or are manually reset)
  • Built-in SVC_BAD prevention
  • Support for custom hitboxes (model index offset setting)
  • You still need to precache player models in your plugin!
Natives:
Code:
/**  * Sets a custom player model.  *  * @param id            Player index.  * @param model   Custom model's short name.  */ native cs_set_player_model(id, const model[]) /**  * Restores CS default model for player.  *  * @param id        Player index.  */ native cs_reset_player_model(id)
Usage:

Download files below into your scripting folder, then do: #include <cs_player_models_api> in your plugin to be able to use the natives.
Attached Files
File Type: inc cs_player_models_api.inc (575 Bytes, 4647 views)
File Type: sma Get Plugin or Get Source (cs_player_models_api.sma - 6939 views - 6.3 KB)
__________________

Last edited by MeRcyLeZZ; 08-06-2011 at 22:15. Reason: v1.2: Fixed server crash when resetting lots of player models at once
MeRcyLeZZ is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Old 07-05-2011 , 06:50   Re: [CS] Player Models API 1.0
Reply With Quote #2

Ow man.. what is this?
[IMG]http://img840.**************/img840/8460/logocj.jpg[/IMG]
i wanna view the picture. Please upload into another image hosting.

By the way thanks for sharing this API. Connor also make a similar API like this. But it doesn't support model hitboxes.
__________________
Hi, 7 years ago i run nosteam servers and i support nosteam community. So please ban me. Thank you legitmodders.
yokomo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-05-2011 , 07:06   Re: [CS] Player Models API 1.0
Reply With Quote #3

AFAIK, http://forums.alliedmods.net/showthread.php?t=106094 and http://forums.alliedmods.net/showthread.php?p=716927 work fine.
__________________
Arkshine is offline
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 07-05-2011 , 17:00   Re: [CS] Player Models API 1.0
Reply With Quote #4

Cool. I just made this for the svc_bad problems mostly, so this can be used in like a generic zombie mod plugin to change all player models at once and it will take care of delays and everything automatically.
__________________
MeRcyLeZZ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-05-2011 , 17:09   Re: [CS] Player Models API 1.0
Reply With Quote #5

AFAIK you don't need delay or I've missed something. In CS, there is no delay. The plugins linked above exist to solve the svc_bad problem and to replace the cstrike native (someone should propose a patch to rewrite the native so it will easier for all). It uses the CS way.
I don't have looked really at your code, so my point is : what is really the difference between the existing API/plugin and yours ?
__________________
Arkshine is offline
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 07-06-2011 , 22:09   Re: [CS] Player Models API 1.0
Reply With Quote #6

Quote:
Originally Posted by Arkshine View Post
AFAIK you don't need delay or I've missed something.
You mean VALVe patched CS to prevent svc_bad? Well I did my testing back in 2008, on a 32 slots server which was constantly full, and changing all player models instantly after round start would give svc_bad kicks like 90% of the time. Also, this only happened online, testing locally with bots wouldn't cause any kicks.

Quote:
Originally Posted by Arkshine View Post
I don't have looked really at your code, so my point is : what is really the difference between the existing API/plugin and yours ?
Code is pretty much the same as Connor's, except for the delays to change models.
__________________

Last edited by MeRcyLeZZ; 07-07-2011 at 00:55.
MeRcyLeZZ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-07-2011 , 05:02   Re: [CS] Player Models API 1.1
Reply With Quote #7

Quote:
changing all player models instantly
Using the cs_set_user_model native, right ? If you don't use that, you don't need delay.
__________________
Arkshine is offline
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 07-07-2011 , 17:16   Re: [CS] Player Models API 1.1
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
Using the cs_set_user_model native, right ? If you don't use that, you don't need delay.
No, it was using the SetClientKeyValue block method and set_user_info() to change models.
__________________
MeRcyLeZZ is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 07-12-2011 , 22:24   Re: [CS] Player Models API 1.1
Reply With Quote #9

wonderful work, thanks for that.
__________________

padilha007 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-13-2011 , 03:54   Re: [CS] Player Models API 1.1
Reply With Quote #10

Quote:
Originally Posted by MeRcyLeZZ View Post
No, it was using the SetClientKeyValue block method and set_user_info() to change models.
Still, can you tell me how forcing an update at roundstart when you hook already SetClientKeyValue is useful ?
__________________
Arkshine is offline
Old 11-25-2011, 11:55
rasik
This message has been deleted by ConnorMcLeod. Reason: OT, this is not ZP thread
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 18:56.


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