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)

LordKowen 06-07-2012 15:36

Re: [CS] Player Models API 1.0
 
Quote:

Originally Posted by MeRcyLeZZ (Post 1505306)
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.

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 :D), 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 ;)

Arkshine 06-07-2012 15:44

Re: [CS] Player Models API 1.2
 
Are you sure the problem was not related to the team changes ? The way of Players Models is the same as CS uses, so I doubt the problem is about the model, but more the team change where it's knows to generate such errors on massive change.

LordKowen 06-07-2012 15:59

Re: [CS] Player Models API 1.2
 
Quote:

Originally Posted by Arkshine (Post 1724478)
Are you sure the problem was not related to the team changes ? The way of Players Models is the same as CS uses, so I doubt the problem is about the model, but more the team change where it's knows to generate such errors on massive change.

Yes, sure. The problem came when players change his models on team change, when my server had about 24-26 players or more, some players got kicked. So I think the delay on massive model change solves this problem.

Maybe I havent understood the question of your argument. If so, I apologize.

Arkshine 06-07-2012 16:12

Re: [CS] Player Models API 1.2
 
No, what I meant is : model change and team change are two different matters, and both, if using the conventional way (the cs_ natives) to do a massive change, will result in such error. That's why PlayerModel plugin or CS Team Changer module, exist. For me, that's not a model problem if you were using the conventional way to change team massively.

LordKowen 06-07-2012 23:44

Re: [CS] Player Models API 1.2
 
Quote:

Originally Posted by Arkshine (Post 1724491)
No, what I meant is : model change and team change are two different matters, and both, if using the conventional way (the cs_ natives) to do a massive change, will result in such error. That's why PlayerModel plugin or CS Team Changer module, exist. For me, that's not a model problem if you were using the conventional way to change team massively.

Oh, now I get it !!!

Connor's 'Players Models' plugin uses fakemeta instead cs_ native, so you say the problem of SVC_BAD errors is due to other things (e.g. massive team change), and a delay between every model change on massive change isn't needed for prevent that problem. I'm a bit skeptical of that claim, but I'll research about that (if I have any other oportunity in the future, because need enough people ingame for test).

Just now I remembered that Connor's Furien Mod didn't incoporate a change-team when Furiens lose... so, the Furiens aren't always stay on Terrorist team. I had to do a plugin for change-team. Just now I open it to see if I used cs_ natives... and... yes.

(This code go into a function called when CT or TT wins, by a 'SendAudio' event)

Code:


new iPlayers[MAX_PLAYERS], iNum, id

get_players(iPlayers, iNum)

for(new i; i<iNum; i++) {

        id = iPlayers[i]

        switch( cs_get_user_team(id) )
        {
            case CS_TEAM_T:
            {
                cs_set_user_team(id, CS_TEAM_CT, CS_CT_GIGN)
            }
            case CS_TEAM_CT:
            {
                cs_set_user_team(id, CS_TEAM_T, CS_T_LEET)
            }
        }
    }

Are you saying that if I used fakemeta (or other), maybe I would have solved much errors? or is strictly necessary the 'CS Team Changer' module?

Anyway, to stop that SVC_BAD errors, my temporal solution was use custom models only for Furiens (terrorist team) on 'Player Models' plugin, and since I made my own 'Player Model' plugin with Mercylezz guide, I never saw more systematic SVC_BAD kicks when the server fills up. I had problems with other plugins using cs_ natives, and I used fm_ to solve it (or hamsanwich), but I never think a simply team-change can be the cause of that errors (so I not let the plugin in debug mode after I have seen it works well). Anyway, thanks for the info Arkshine, I'll use that module on future servers, optimizing and prevent is always good thing.

But the fact is that with Mercylezz method, you can prevent SVC_BAD kicks when you have a server with much players, and ALL changes his team at the same time (with conventional method or not), and therefore all players changes to another custom model. And there is the ONLY solution I was found, because 'CS Team Changer module' didn't exists until August 2011... precisely the date when my community was dissolved and all servers closed... too late solution for me.

By the way, I didn't say that problem was due to Connor's 'Model Player' plugin. I know it's perfectly working (otherwise the plugin would not be approved). I never thought the problem was the plugin itself... I'm sorry if I implied that in my words. I simply thought would be something like HL or CS core doesn't support certain "massive" changes like this (change all teams+models on <X amount> players at same time). I deduced that because the 'Model Players' change the models when the game announces who's the winner team (not due to SendAudio event, but my custom plugin change teams one by one in that moment, so models change too). I think it's good idea to separate both functions, and ABOVE ALL, put a delay between each change (I had supposed that's the point what finally fixes the problem).

Do the change-model on round start is rather a aesthetics matter (at least on Zombie Plague I think it's much better at begin of the round, and in Furien mod you can still killing when the time is over or when the C4 explodes/deactivates in de_maps... can be confusing and much players attacks his teammates)... and you know... It's impossible to do the team change on event roundstart without killing them (well, it's possible but much difficult if you want to asign the team respawn zones, or team abilities, etc.)... so in both mods I preffer the Mercylezz method, but If it's possible without delay, much better!!! :D

P.S: Sorry for my mega-post, and for my poor english. I hope I explained well. It's only my opinion based on my experience. ;)

yokomo 06-08-2012 00:39

Re: [CS] Player Models API 1.2
 
Yup it's still need to add delay for model changes see http://forums.alliedmods.net/showpos...postcount=3902

LordKowen 06-08-2012 01:04

Re: [CS] Player Models API 1.2
 
http://i.imgur.com/evQbd.png

Reliable chan..............? YYAAAARRRRGGHHH!!!!

Leave this server, the power of JC compels you !!!

abybaddi009 09-25-2012 10:17

Re: [CS] Problem
 
1 Attachment(s)
I used this API to add models into the plugin, compiles fine, after loading it on server the status of the plugin is Bad load. Help please?

YamiKaitou 09-26-2012 07:44

Re: [CS] Player Models API 1.2
 
And what is the reason it is giving for the bad load?

PRoSToTeM@ 07-05-2014 12:19

Re: [CS] Player Models API 1.2
 
That API has bug with change models: player can set the model corresponding to the selected class (if the class is not selected, the class will be urban).
I use this code to test bug:
PHP Code:

#include <amxmodx>
#include <cs_player_models_api>

public client_putinserver(iClient) {
    
cs_set_player_model(iClient"vip");


What we need to do:
  1. Join team and select class (for example sas)
  2. Spawn
  3. Switch third person view. (for see your model)
  4. Write to the console: setinfo model sas (the selected class)
  5. PROFIT
You need hook ClientUserInfoChanged to fix that bug.

If player sets the key "model" in setinfo for the selected class, the game doesn't call SetClientKeyValue.

CBasePlayer::SetPlayerModel code (it called from ClientUserInfoChanged):
PHP Code:

void CBasePlayer::SetPlayerModel(BOOL HasC4)
{
    
char *infobuffer;
    
char *model;

    if (
m_iTeam == TEAM_CT)
    {
        switch (
m_iModelName)
        {
            default:
            case 
CLASS_URBANmodel "urban"; break;
            case 
CLASS_GSG9model "gsg9"; break;
            case 
CLASS_SASmodel "sas"; break;
            case 
CLASS_GIGNmodel "gign"; break;
            case 
CLASS_VIPmodel "vip"; break;
        }
    }
    else if (
m_iTeam == TEAM_TERRORIST)
    {
        switch (
m_iModelName)
        {
            default:
            case 
CLASS_TERRORmodel "terror"; break;
            case 
CLASS_LEETmodel "leet"; break;
            case 
CLASS_ARCTICmodel "arctic"; break;
            case 
CLASS_GUERILLAmodel "guerilla"; break;
        }
    }
    else
        
model "urban";

    
infobuffer g_engfuncs.pfnGetInfoKeyBuffer(edict());

    if (
strcmp(g_engfuncs.pfnInfoKeyValue(infobuffer"model"), model))
        
g_engfuncs.pfnSetClientKeyValue(entindex(), infobuffer"model"model);




All times are GMT -4. The time now is 07:49.

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