AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [CS] Player Models API 1.2 (https://forums.alliedmods.net/showthread.php?t=161255)

MeRcyLeZZ 07-05-2011 06:23

[CS] Player Models API 1.2
 
2 Attachment(s)
[CS] Player Models API

http://i.imgur.com/5Lu1j.jpg

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.

yokomo 07-05-2011 06:50

Re: [CS] Player Models API 1.0
 
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.

Arkshine 07-05-2011 07:06

Re: [CS] Player Models API 1.0
 
AFAIK, http://forums.alliedmods.net/showthread.php?t=106094 and http://forums.alliedmods.net/showthread.php?p=716927 work fine.

MeRcyLeZZ 07-05-2011 17:00

Re: [CS] Player Models API 1.0
 
Quote:

Originally Posted by Arkshine (Post 1504049)

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.

Arkshine 07-05-2011 17:09

Re: [CS] Player Models API 1.0
 
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 ?

MeRcyLeZZ 07-06-2011 22:09

Re: [CS] Player Models API 1.0
 
Quote:

Originally Posted by Arkshine (Post 1504443)
AFAIK you don't need delay or I've missed something.

You mean VALVe patched CS to prevent svc_bad? :lol: 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 (Post 1504443)
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.

Arkshine 07-07-2011 05:02

Re: [CS] Player Models API 1.1
 
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.

MeRcyLeZZ 07-07-2011 17:16

Re: [CS] Player Models API 1.1
 
Quote:

Originally Posted by Arkshine (Post 1505474)
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.

padilha007 07-12-2011 22:24

Re: [CS] Player Models API 1.1
 
wonderful work, thanks for that.

Arkshine 07-13-2011 03:54

Re: [CS] Player Models API 1.1
 
Quote:

Originally Posted by MeRcyLeZZ (Post 1505890)
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 ?


All times are GMT -4. The time now is 14:23.

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