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

[SOLVED] cs_set_user_model native


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-09-2016 , 15:28   [SOLVED] cs_set_user_model native
Reply With Quote #1

When using the cs_set_user_model native it makes the pod bots spam the change name command and causes overflow

Also, the error output is not saved in the log files, it can be seen only via console

Didn't have the chance to test it with players as well, since my test server is hosted on my pc, but if i remember well, i once switched to the dev build on the public server and used the cstrike native for setting models, and i remember one time we were all getting overflowed

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "test"

new const pl_mdl[] = "leet"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
    
// Add your code here...
}

public 
plugin_precache()
{
    new 
model_path[128]
    
formatex(model_pathcharsmax(model_path), "models/player/%s/%s.mdl",  pl_mdlpl_mdl)
    
precache_model(model_path)
}

public 
fw_PlayerSpawn_Post(id)
{
    
cs_set_user_model(idpl_mdl)

Code:
L 08/09/2016 - 22:25:29: [CSTRIKE] Invalid player 13
L 08/09/2016 - 22:25:29: [AMXX] Displaying debug trace (plugin "testsc.amxx", version "1.0")
L 08/09/2016 - 22:25:29: [AMXX] Run time error 10: native error (native "cs_set_user_model")
L 08/09/2016 - 22:25:29: [AMXX]    [0] testsc.sma::fw_PlayerSpawn_Post (line 32)
__________________

Last edited by Depresie; 08-09-2016 at 15:32.
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-09-2016 , 15:40   Re: [BUG] cs_set_user_model native
Reply With Quote #2

Check if player is alive.
__________________
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-09-2016 , 15:54   Re: [BUG] cs_set_user_model native
Reply With Quote #3

Same, except for the run time errors
__________________
Depresie is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-09-2016 , 16:19   Re: [BUG] cs_set_user_model native
Reply With Quote #4

Well you're doing something wrong, because I tested your code and I didn't have any errors.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-09-2016 , 17:26   Re: [BUG] cs_set_user_model native
Reply With Quote #5

Clean server now with default plugins only, latest amx dev build, installed pod bot

Used this for testing, when the command is called bots are triggering the change name command

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "test"

new const pl_mdl[][] = 
{
    
"leet",
    
"gign",
    
"arctic"
}

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say change""fw_PlayerSpawn_Post")
    
    
// Add your code here...
}

public 
plugin_precache()
{
    new 
model_path[128]
    
    for(new 
0sizeof(pl_mdl); x++)
    {
        
formatex(model_pathcharsmax(model_path), "models/player/%s/%s.mdl",  pl_mdl[x], pl_mdl[x])
        
precache_model(model_path)
    }
}

public 
fw_PlayerSpawn_Post(caller)
{
    new 
iPlayers[32] , iNum Player;
    
get_playersiPlayers iNum "h" );
    
    for ( new 
iNum i++ )
    {    
        
Player iPlayers[i];
        
cs_set_user_model(Playerpl_mdl[random(sizeof(pl_mdl))])
    }
    

__________________

Last edited by Depresie; 08-09-2016 at 17:29.
Depresie is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 08-10-2016 , 09:59   Re: [BUG] cs_set_user_model native
Reply With Quote #6

I would highly recommend you use Mercyless's cs_player_models_api instead of the cstrike model natives..
safetymoose is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-10-2016 , 10:13   Re: [BUG] cs_set_user_model native
Reply With Quote #7

That API is causing some problems for me... that i couldn't fix

Also I think we should forget about APIs and look forward to fix these issues in the new AMX MOD X version
__________________
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-10-2016 , 13:19   Re: [BUG] cs_set_user_model native
Reply With Quote #8

Quote:
Originally Posted by safetymoose View Post
I would highly recommend you use Mercyless's cs_player_models_api instead of the cstrike model natives..
AMXX natives were fixed in 1.8.3 and if there are still issues they will be fixed too. No point in keep using such workaround when 1.8.3 is released.
__________________

Last edited by HamletEagle; 08-10-2016 at 13:23.
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-10-2016 , 14:40   Re: [BUG] cs_set_user_model native
Reply With Quote #9

Plus the more you use the new natives and features of amx 1.8.3 the more chance issues will pop up and get fixed, having a final release date coming sooner
__________________
Depresie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-10-2016 , 15:09   Re: [BUG] cs_set_user_model native
Reply With Quote #10

The native does nothing special. It sets only "model" key value on a client if not the same, block any attempt of overwriting, and postpone the update to the next frame. That it triggers name change on bot, I'm not sure to understand.

I've tried your plugin and what I'm supposed to see exactly?
__________________
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:49.


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