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

Release Skins (1.1-alpha)


Post New Thread Reply   
 
Thread Tools Display Modes
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 06-10-2015 , 10:08   Re: Skins (1.1-alpha)
Reply With Quote #201

Quote:
Originally Posted by hu3br View Post
Is possible to made for equip skin per team, like have equipped two skins in same time, one for ct another for t?
there is a version buried in this thread...
you better read the whole thread before make a new post...
__________________
coding & free software
shanapu is offline
NickischLP
Senior Member
Join Date: Jun 2013
Location: Germany
Old 06-16-2015 , 13:10   Re: Skins (1.1-alpha)
Reply With Quote #202

Quote:
Originally Posted by NeonHeights View Post
Is there any way to restrict certain skins to certain classes on tf2?
Would be cool
__________________
NickischLP is offline
Send a message via Skype™ to NickischLP
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 06-28-2015 , 15:04   Re: Skins (1.1-alpha)
Reply With Quote #203

The skin I've added works for me but seams like it does not work for most other.
Getting this error as well. Running CSGO Server with latest SM/MM:S builds on windows.

Quote:
L 06/28/2015 - 20:42:56: [SM] Native "GetArrayString" reported: Invalid index -28 (count: 31)
L 06/28/2015 - 20:42:56: [SM] Displaying call stack trace for plugin "store\store-skins.smx":
L 06/28/2015 - 20:42:56: [SM] [0] Line 144, C:\Users\Alon\Documents\GitHub\store-skins\scripting/include/\smartdm.inc:ownloader_AddFileToDownloadsTa ble()
L 06/28/2015 - 20:42:56: [SM] [1] Line 178, C:\Users\Alon\Documents\GitHub\store-skins\scripting\store-skins.sp::LoadItem()
__________________
CAOSK-ESPORTS.COM
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
boone2134
Junior Member
Join Date: Jan 2014
Old 07-06-2015 , 01:05   Re: Skins (1.1-alpha)
Reply With Quote #204

Quote:
Originally Posted by Schpraaankiii View Post
The skin I've added works for me but seams like it does not work for most other.
Getting this error as well. Running CSGO Server with latest SM/MM:S builds on windows.
I am getting errors similar to these...
Quote:
Plugin encountered error 15: Array index is out of bounds
Displaying call stack trace for plugin "store/store-skins.smx":
Line 171, /home/ubuntu/tf2server/tf2/tf/addons/sourcemod/scripting/include/smartdm.inc:ownloader_AddFileToDownloadsTab le()
Line 178, store-skins.sp::LoadItem()
boone2134 is offline
hu3br
Senior Member
Join Date: Apr 2015
Old 07-10-2015 , 13:37   Re: Skins (1.1-alpha)
Reply With Quote #205

Will be amazing if you put for have custom arms too like this

https://forums.alliedmods.net/showthread.php?t=262170
hu3br is offline
MrBrightSide
Member
Join Date: Jun 2011
Old 08-13-2015 , 14:38   Re: Skins (1.1-alpha)
Reply With Quote #206

Plugin works except when I add another skin via the web panel only the newest skin works, equipping another skin will just show you as the default skin for your team. any ideas on how to fix this? I did edit the code sightly, just so i can have the zombie server haves its own category so both Ts and CT can share the skins.

#edit
There a way to prevent someone from getting skin if they'er a zombie or at lease prevent Ts from getting skin once x amount of seconds into the round?

Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <store>
#include <smjansson>
#include <smartdm>

enum Skin
{
	String:SkinName[STORE_MAX_NAME_LENGTH],
	String:SkinModelPath[PLATFORM_MAX_PATH], 
	SkinTeams[5]
}

new g_skins[1024][Skin];
new g_skinCount = 0;

new Handle:g_skinNameIndex;

new String:g_game[32];

public Plugin:myinfo =
{
    name        = "[Store] Skins",
    author      = "alongub",
    description = "Skins component for [Store]",
    version     = "1.1-alpha",
    url         = "https://github.com/alongubkin/store"
};

/**
 * Plugin is loading.
 */
public OnPluginStart()
{
	LoadTranslations("store.phrases");
	
	HookEvent("player_spawn", Event_PlayerSpawn);
	Store_RegisterItemType("zm_csgo_skin", OnEquip, LoadItem);
	GetGameFolderName(g_game, sizeof(g_game));
}

/**
 * Map is starting
 */
public OnMapStart()
{
	for (new skin = 0; skin < g_skinCount; skin++)
	{
		if (strcmp(g_skins[skin][SkinModelPath], "") != 0 && (FileExists(g_skins[skin][SkinModelPath]) || FileExists(g_skins[skin][SkinModelPath], true)))
		{
			PrecacheModel(g_skins[skin][SkinModelPath]);
			Downloader_AddFileToDownloadsTable(g_skins[skin][SkinModelPath]);
		}
	}
}

/** 
 * Called when a new API library is loaded.
 */
public OnLibraryAdded(const String:name[])
{
	if (StrEqual(name, "store-inventory"))
	{
		Store_RegisterItemType("zm_csgo_skin", OnEquip, LoadItem);
	}
}

public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));

	if (!IsClientInGame(client))
		return Plugin_Continue;

	if (IsFakeClient(client))
		return Plugin_Continue;

	CreateTimer(1.0, Timer_Spawn, GetClientSerial(client));
	
	return Plugin_Continue;
}

public Action:Timer_Spawn(Handle:timer, any:serial)
{
	new client = GetClientFromSerial(serial);
	
	if (client == 0)
		return Plugin_Continue;
		
	Store_GetEquippedItemsByType(Store_GetClientAccountID(client), "zm_csgo_skin", Store_GetClientLoadout(client), OnGetPlayerSkin, serial);
	
	return Plugin_Continue;
}

public Store_OnClientLoadoutChanged(client)
{
	Store_GetEquippedItemsByType(Store_GetClientAccountID(client), "zm_csgo_skin", Store_GetClientLoadout(client), OnGetPlayerSkin, GetClientSerial(client));
}

public OnGetPlayerSkin(ids[], count, any:serial)
{
	new client = GetClientFromSerial(serial);

	if (client == 0)
		return;
		
	if (!IsClientInGame(client))
		return;
	
	if (!IsPlayerAlive(client))
		return;
	
	new team = GetClientTeam(client);
	for (new index = 0; index < count; index++)
	{
		decl String:itemName[STORE_MAX_NAME_LENGTH];
		Store_GetItemName(ids[index], itemName, sizeof(itemName));
		
		new skin = -1;
		if (!GetTrieValue(g_skinNameIndex, itemName, skin))
		{
			PrintToChat(client, "%s%t", STORE_PREFIX, "No item attributes");
			continue;
		}

		new bool:teamAllowed = false;
		for (new teamIndex = 0; teamIndex < 5; teamIndex++)
		{
			if (g_skins[skin][SkinTeams][teamIndex] == team)
			{
				teamAllowed = true;
				break;
			}
		}


		if (!teamAllowed)
		{
			continue;
		}

		if (StrEqual(g_game, "tf"))
		{
			SetVariantString(g_skins[skin][SkinModelPath]);
			AcceptEntityInput(client, "SetCustomModel");
			SetEntProp(client, Prop_Send, "m_bUseClassAnimations", 1);
		}
		else
		{
			SetEntityModel(client, g_skins[skin][SkinModelPath]);
		}
	}
}

public Store_OnReloadItems() 
{
	if (g_skinNameIndex != INVALID_HANDLE)
		CloseHandle(g_skinNameIndex);
		
	g_skinNameIndex = CreateTrie();
	g_skinCount = 0;
}

public LoadItem(const String:itemName[], const String:attrs[])
{
	strcopy(g_skins[g_skinCount][SkinName], STORE_MAX_NAME_LENGTH, itemName);

	SetTrieValue(g_skinNameIndex, g_skins[g_skinCount][SkinName], g_skinCount);

	new Handle:json = json_load(attrs);
	json_object_get_string(json, "model", g_skins[g_skinCount][SkinModelPath], PLATFORM_MAX_PATH);

	if (strcmp(g_skins[g_skinCount][SkinModelPath], "") != 0 && (FileExists(g_skins[g_skinCount][SkinModelPath]) || FileExists(g_skins[g_skinCount][SkinModelPath], true)))
	{
		PrecacheModel(g_skins[g_skinCount][SkinModelPath]);
		Downloader_AddFileToDownloadsTable(g_skins[g_skinCount][SkinModelPath]);
	}

	new Handle:teams = json_object_get(json, "teams");

	for (new i = 0, size = json_array_size(teams); i < size; i++)
		g_skins[g_skinCount][SkinTeams][i] = json_array_get_int(teams, i);

	CloseHandle(json);

	g_skinCount++;
}

public Store_ItemUseAction:OnEquip(client, itemId, bool:equipped)
{
	if (equipped)
		return Store_UnequipItem;
	
	PrintToChat(client, "%s%t", STORE_PREFIX, "Equipped item apply next spawn");
	return Store_EquipItem;
}
using the inc files from
https://forums.alliedmods.net/showthread.php?t=255418
and smjansson from
https://forums.alliedmods.net/showpo...6&postcount=49

Last edited by MrBrightSide; 08-14-2015 at 12:36.
MrBrightSide is offline
SOBgaming
Senior Member
Join Date: Jul 2015
Old 08-22-2015 , 11:14   Re: Skins (1.1-alpha)
Reply With Quote #207

Could you add an optional arm/sleeve skin line to you plugin like the following because many new skins use their own arm models:

Code:
//"Professional" 
//{ 
//    "skin"    "models/player/tm_professional_var1.mdl" 
//    "arms"    "models/weapons/t_arms_professional.mdl" 
//}


Source:

https://forums.alliedmods.net/showth...t=skin+chooser
__________________

Last edited by SOBgaming; 08-22-2015 at 11:15.
SOBgaming is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 09-13-2015 , 13:41   Re: Skins (1.1-alpha)
Reply With Quote #208

Quote:
Originally Posted by hu3br View Post
Will be amazing if you put for have custom arms too like this

https://forums.alliedmods.net/showthread.php?t=262170


Quote:
Originally Posted by SOBgaming View Post
Could you add an optional arm/sleeve skin line to you plugin like the following because many new skins use their own arm models:

Source:
https://forums.alliedmods.net/showth...t=skin+chooser
All of this. Would have a big increase for quality in this plugin.
__________________

Last edited by sneaK; 09-13-2015 at 13:44.
sneaK is offline
cam0
Senior Member
Join Date: Feb 2015
Old 09-18-2015 , 22:46   Re: Skins (1.1-alpha)
Reply With Quote #209

Quote:
Originally Posted by boone2134 View Post
I am getting errors similar to these...
I randomly started getting the same errors today, no clue what could have caused the sudden break.
cam0 is offline
SOBgaming
Senior Member
Join Date: Jul 2015
Old 09-19-2015 , 07:01   Re: Skins (1.1-alpha)
Reply With Quote #210

Quote:
Originally Posted by cam0 View Post
I randomly started getting the same errors today, no clue what could have caused the sudden break.
There are very few skins compatible with the new skeleton/animations. It might be the cause of your errors..
__________________
SOBgaming 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 08:41.


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