Raised This Month: $51 Target: $400
 12% 

[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, 7143 views)
File Type: sma Get Plugin or Get Source (cs_player_models_api.sma - 10880 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
Location: Malaysia
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.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
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
LordKowen
Member
Join Date: Sep 2009
Location: Spain
Old 06-07-2012 , 15:36   Re: [CS] Player Models API 1.0
Reply With Quote #7

Quote:
Originally Posted by MeRcyLeZZ View Post
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.
That's right... Mercylezz is right Arkshine. In my old Zombie Plague server I had some SVC_BAD kicks... some like "reliable channel overflowed" if I remember correctly. I had a sucessfull ZP server along two years (the first ZP server in Spain ), and I test it on differents dedicated servers. More powerfull dedicated needs less delay on model change, but the only real solution I'd found was decrease slots 32 to 28. But the way, there was not a common error on ZP.

In december 2010 I started a Furien mod server, and using Connors "Players Models" plugin I discovered the hell of SVC_BAD errors. Using only one custom model for CT and TT, always got kicks when server had 26 players... I dont remember exactly if 24 or 26, but the error was systematic when servers fills up, believe me.

Other communitys who haves Furien servers and use Player Models chose to decrease slots, or set custom models only on Furiens (Terrorist team), and not on CT, for avoid the players got kicked.

I'd solved the problem with the Mercylezz tutorial: http://forums.alliedmods.net/showthread.php?t=69386 making my own "player models" plugin. The only bad on round start, its sometimes 'Gordon Freeman' appears for an instant, shaking with terrible spasms... hahaha. But only few seconds before model changes again... Probably I made a mistake following the tutorial, but server works perfectly when filled with players, so I let it go.

P.S: Sorry for my bad english.

[ES] P.S: Mercylezz un placer verte de nuevo en acción capo ;)
__________________

Last edited by LordKowen; 06-07-2012 at 15:52.
LordKowen 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 #8

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 #9

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
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
Reply



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 05:52.


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