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

Sm_Skinchooser


Post New Thread Reply   
 
Thread Tools Display Modes
Kxnrl
AlliedModders Donor
Join Date: May 2015
Old 05-31-2017 , 13:55   Re: Sm_Skinchooser
Reply With Quote #2571

Quote:
Originally Posted by sneaK View Post
Uhh... what's your source on that?

Nothing change in regards to that in yesterday's update at all from what I can tell.
Quote:
http://blog.counter-strike.net/index...egory/updates/
– Fixed a bug that caused the server to not animate Heavy Assault Suit players properly when using knives.
i just tested on my server.
b4 fixed, you can see this


PHP Code:
#include <sdktools>

char g_szDefaultModel[][] = 
{
    
"models/player/custom_player/legacy/tm_anarchist.mdl",
    
"models/player/custom_player/legacy/tm_pirate.mdl",
    
"models/player/custom_player/legacy/ctm_gign.mdl",
    
"models/player/custom_player/legacy/ctm_fbi.mdl"
};

public 
void OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawnEventHookMode_Pre);
}

public 
void OnConfigsExecuted() 
{
    
PrecacheDefaultModel();
}

public 
Action Event_PlayerSpawn(Handle event, const char[] namebool dontBroadcast)
{
    
int userid GetEventInt(event"userid");
    
int client GetClientOfUserId(userid);

    
// Set Default
    
SetDefaultSkin(clientGetClientTeam(client));
    
    
// Set Custom
    
SetEntPropString(clientProp_Send"m_szArmsModel""models/player/custom_player/maoling/vocaloid/hatsune_miku/cybertech/miku_arms.mdl");
    
CreateTimer(1.5Timer_ModelDelayuserid);

    
// Fix Spawn without any weapon.
    
GivePlayerItem(client"weapon_knife");
    
    return 
Plugin_Handled;
}

public 
Action Timer_ModelDelay(Handle timerint userid)
{
    
int client GetClientOfUserId(userid);
    
    if(!
IsClientInGame(client) || !IsPlayerAlive(client))
        return 
Plugin_Stop;
    
    
SetEntityModel(client"models/player/custom_player/maoling/vocaloid/hatsune_miku/cybertech/miku.mdl");

    return 
Plugin_Stop;
}

void SetDefaultSkin(int clientint team)
{
    
char m_szMoedl[128];
    
GetEntPropString(clientProp_Data"m_ModelName"m_szMoedl128);

    if(
team == 2)
    {
        
SetEntityModel(client, (StrContains(m_szMoedl"tm_anarchist") != -1) ? g_szDefaultModel[1] : g_szDefaultModel[0]);
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/weapons/t_arms.mdl");
    }
    else if(
team == 3)
    {
        
SetEntityModel(client, (StrContains(m_szMoedl"ctm_fbi") != -|| StrContains(m_szMoedl"ctm_sas") != -|| StrContains(m_szMoedl"ctm_swat") != -1) ? g_szDefaultModel[2] : g_szDefaultModel[3]);
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/weapons/ct_arms.mdl");
    }
}

void PrecacheDefaultModel()
{
    for(
int x 0sizeof(g_szDefaultModel); ++x)
        
PrecacheModel(g_szDefaultModel[x]);

    
PrecacheModel("models/weapons/t_arms.mdl");
    
PrecacheModel("models/weapons/ct_arms.mdl");
    
    
// Precahce Your Custom Model and Arms.
    
PrecacheModel("models/player/custom_player/maoling/vocaloid/hatsune_miku/cybertech/miku.mdl");
    
PrecacheModel("models/player/custom_player/maoling/vocaloid/hatsune_miku/cybertech/miku_arms.mdl");

__________________

Last edited by Kxnrl; 05-31-2017 at 14:13.
Kxnrl is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 05-31-2017 , 14:07   Re: Sm_Skinchooser
Reply With Quote #2572

Interesting, I wonder if the fix was more blanketed to models other than the t/ct defaults, including Heavy Assault Suit.

Video doesn't work, but I get the concept.
__________________
sneaK is offline
Kxnrl
AlliedModders Donor
Join Date: May 2015
Old 05-31-2017 , 14:27   Re: Sm_Skinchooser
Reply With Quote #2573

Quote:
Originally Posted by sneaK View Post
Interesting, I wonder if the fix was more blanketed to models other than the t/ct defaults, including Heavy Assault Suit.

Video doesn't work, but I get the concept.
fix video.

OnSpawn Event set default, set arms, create timer to set model.

work well.
__________________
Kxnrl is offline
Kxnrl
AlliedModders Donor
Join Date: May 2015
Old 05-31-2017 , 14:36   Re: Sm_Skinchooser
Reply With Quote #2574

before fixed :



and




after:

__________________
Kxnrl is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 05-31-2017 , 14:36   Re: Sm_Skinchooser
Reply With Quote #2575

i don't think it fixes the hitred problem those youtube video was talking about
it only fixes the hitbox problem for custom models
8guawong is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 05-31-2017 , 16:01   Re: Sm_Skinchooser
Reply With Quote #2576

I would like to be able to specify the flag necessary for each skin. I have a category named "purchased", and in there I have 3 different skins that's supposed to have 3 different flags needed.
Is there a way to do this instead of creating several categories? It gets kind of messy in the config.

Something like this would be good:
Code:
	"Purchased"
	{
		"Admin" "t"
		"Team1"
		{
			"Evil Snowman"
			{
				"path" "models/player/custom_player/kodua/snowman/snowman.mdl"
			}
		}

		"Team2"
		{
			"Prison guard"
			{
				"path" "models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl"
			}
		}

		"Admin" "s"
		"Team1"
		{
			"Santa"
			{
				"path" "models/player/custom_player/legacy/santa/santa.mdl"
			}
		}

		"Team2"
		{
			"Santa"
			{
				"path" "models/player/custom_player/legacy/santa/santa.mdl"
			}
		}

		"Admin" "r"
		"Team1"
		{
			"Prisoner"
			{
				"path" "models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2.mdl"
			}
		}

		"Team2"
		{
			"Batman"
			{
				"path" "models/player/custom_player/kuristaja/ak/batman/batmanv2.mdl"
			}
		}
	}
condolent is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 05-31-2017 , 16:19   Re: Sm_Skinchooser
Reply With Quote #2577

Baaaah.....Valve didn't fixed anything about the hitboxes , the Problem exists since they added 2015 the new skeleton ,animations and also the hitboxes. They didn't care about bugs they produce for customized stuff only if it effects their own inventory , so I think this bug will exists many years.....
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<

Last edited by andi67; 05-31-2017 at 16:21.
andi67 is offline
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 06-01-2017 , 03:53   Re: Sm_Skinchooser
Reply With Quote #2578

Also, how do I use the forceskin file to add arms aswell?
condolent is offline
Muscle Brazil
Senior Member
Join Date: Apr 2009
Location: Brazil
Old 06-07-2017 , 18:13   Re: Sm_Skinchooser
Reply With Quote #2579

I'm paying 5 csgo keys for anyone who helps me install this plugin on my server.

my steam add me coment my profile reason

http://steamcommunity.com/id/xad1x/
Muscle Brazil is offline
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 06-14-2017 , 20:40   Re: Sm_Skinchooser
Reply With Quote #2580

Alright so as mentionned before I needed to implement a sm_unskin command, working with SteamIDs, for the reason below:
- when someone had access to a skin and no longer has, if he/she kindly does not want to click "none" at menu popup (or by typing !models) but that the skin is still available on server, this player could keep his/her skin for years... until I unload the plugin, remove the player manually in data/skinchooser_playermodels.ini, change map, and reload the plugin.

So, with this command, I can edit models assignment, through the console, rcon, whatever.

Hope this can help others, if not, yay I didn't need to post.

Code:
public OnPluginStart()
{
    RegAdminCmd("sm_unskin", Command_UNSKIN, ADMFLAG_RCON, "sm_unskin <steamid>");
}

public Action Command_UNSKIN(int client, int args)
{
	if (args < 1)
	{
		ReplyToCommand(client, "[SM] Usage: sm_unskin <steamid>");
		return Plugin_Handled;
	}

	char arg[50];
	GetCmdArgString(arg, sizeof(arg));

	if (KvJumpToKey(playermodelskv,arg,false))
	{
		KvSetString(playermodelskv, "Team1", "");
		KvSetString(playermodelskv, "Team1Group", "");
		KvSetString(playermodelskv, "Team2", "");
		KvSetString(playermodelskv, "Team2Group", "");
		KvRewind(playermodelskv);
		ReplyToCommand(client, "Player removed from skins file");
		return Plugin_Handled;
	}

	else
	{
		ReplyToCommand(client, "Player not found");
		return Plugin_Handled;
	}
}
A map change is still needed for the file (data/skinchooser_playermodels.ini) to be saved. Also, I couldn't delete the whole SteamID string properly (cuz I'm kinda noob) so there's a 'track' of player's SteamID in the file... but hey, it works.

++
__________________

*** *** ***
-My plugins-

Last edited by St00ne; 06-14-2017 at 20:51.
St00ne 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 00:26.


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