Problem Player Models Plugin from OciXCrom

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Problem Player Models Plugin from OciXCrom

Мнение от Infamous2018 » 26 Май 2018, 19:54

Hello, i have a Problem with that PLugin maybe. MAybe anyone can help me. I compiled with 1.8.3 compiler without Errors. I added them to the Server. As i connected i downloaded them. But the Skins dont work. Can it have to do with an Team Join Auto Plugin or maybe any other Ideas?

Код за потвърждение: Избери целия код

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

#define MODEL_DELAY 0.5

enum _:ModelsInfo
{
	Flag,
	CTModel[32],
	TModel[32]
}

new const g_eModels[][ModelsInfo] =
{
	// <Admin flag> <CT skin> <T skin>
	{ ADMIN_LEVEL_A, "owner_ct", "owner_t" },
	{ ADMIN_LEVEL_B, "admin_ct", "admin_t" }
}

new Trie:g_tModels

public plugin_init()
{
	register_plugin("Multiple Player Models", "1.0", "OciXCrom")
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
}

public plugin_end()
	TrieDestroy(g_tModels)

public plugin_precache()
{
	g_tModels = TrieCreate()
	
	for(new i; i < sizeof(g_eModels); i++)
	{
		precache_player_model(g_eModels[i][CTModel])
		precache_player_model(g_eModels[i][TModel])
	}
}

public OnPlayerSpawn(id)
	set_task(MODEL_DELAY, "SetModel", id)
	
public SetModel(id)
{
	if(is_user_alive(id))
	{
		static bool:bMatch, iFlags, i
		bMatch = false
		
		for(iFlags = get_user_flags(id), i = 0; i < sizeof(g_eModels); i++)
		{
			if(iFlags & g_eModels[i][Flag])
			{
				switch(cs_get_user_team(id))
				{
					case CS_TEAM_CT: cs_set_user_model(id, g_eModels[i][CTModel])
					case CS_TEAM_T: cs_set_user_model(id, g_eModels[i][TModel])
				}
				
				client_print(id, print_chat, "* Your received the model %s", g_eModels[i][cs_get_user_team(id) == CS_TEAM_CT ? CTModel : TModel])
				bMatch = true
				break
			}
		}
		
		if(!bMatch)
		{
			static szModel[32]
			cs_get_user_model(id, szModel, charsmax(szModel))
			
			if(TrieKeyExists(g_tModels, szModel))
				cs_reset_user_model(id)
		}
	}
}

precache_player_model(szModel[])
{
	TrieSetCell(g_tModels, szModel, 1)
	
	static szFile[128]
	formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", szModel, szModel)
	precache_model(szFile)
	replace(szFile, charsmax(szFile), ".mdl", "T.mdl")
	
	if(file_exists(szFile))
		precache_model(szFile)
}
Последно промяна от Infamous2018 на 27 Май 2018, 22:05, променено общо 2 пъти.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Problem Player Models Plugin from OciXCrom

Мнение от OciXCrom » 26 Май 2018, 22:54

Try it like this. I added chat logs on spawn to tell you if the model is being added or not. If you see the chat message, some other plugin is blocking this one.

Код за потвърждение: Избери целия код

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

enum _:ModelsInfo
{
	Flag,
	CTModel[32],
	TModel[32]
}

new const g_eModels[][ModelsInfo] =
{
	// <Admin flag> <CT skin> <T skin>
	{ ADMIN_LEVEL_A, "owner_ct", "owner_t" },
	{ ADMIN_LEVEL_B, "admin_ct", "admin_t" }
}

new Trie:g_tModels

public plugin_init()
{
	register_plugin("Multiple Player Models", "1.0", "OciXCrom")
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
}

public plugin_end()
	TrieDestroy(g_tModels)

public plugin_precache()
{
	g_tModels = TrieCreate()
	
	for(new i; i < sizeof(g_eModels); i++)
	{
		precache_player_model(g_eModels[i][CTModel])
		precache_player_model(g_eModels[i][TModel])
	}
}

public OnPlayerSpawn(id)
{
	if(is_user_alive(id))
	{
		static bool:bMatch, iFlags, i
		bMatch = false
		
		for(iFlags = get_user_flags(id), i = 0; i < sizeof(g_eModels); i++)
		{
			if(iFlags & g_eModels[i][Flag])
			{
				switch(cs_get_user_team(id))
				{
					case CS_TEAM_CT: cs_set_user_model(id, g_eModels[i][CTModel])
					case CS_TEAM_T: cs_set_user_model(id, g_eModels[i][TModel])
				}
				
				client_print(id, print_chat, "* Your received the model %s", g_eModels[i][cs_get_user_team(id) == CS_TEAM_CT ? CTModel : TModel])
				bMatch = true
				break
			}
		}
		
		if(!bMatch)
		{
			static szModel[32]
			cs_get_user_model(id, szModel, charsmax(szModel))
			
			if(TrieKeyExists(g_tModels, szModel))
				cs_reset_user_model(id)
		}
	}
}

precache_player_model(szModel[])
{
	TrieSetCell(g_tModels, szModel, 1)
	
	static szFile[128]
	formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", szModel, szModel)
	precache_model(szFile)
	replace(szFile, charsmax(szFile), ".mdl", "T.mdl")
	
	if(file_exists(szFile))
		precache_model(szFile)
}

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Problem Player Models Plugin from OciXCrom

Мнение от Infamous2018 » 26 Май 2018, 23:32

* Your received the model owner_ct^

I disabled ALL Plugins but the problem is still there.. it said i got the model but i didnt. :/

Добавено преди 19 минути 32 секунди:
There was a small bug in the code I provided. The order g_tModels = TrieCreate () must be moved to the beginning of the function plugin_precache (), otherwise it will throw a bug in the console and restart the model at Rebirth. I fixed it. Thank you, LoShIaA, for notifying me.

What about this? there is the problem maybe? I seen a post from you about this.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Problem Player Models Plugin from OciXCrom

Мнение от OciXCrom » 27 Май 2018, 15:05

As you can see that problem is already fixed. There's no way for the plugin not to work. You definitely have something else messing with it. Check your full plugins list and disable everything. Maybe you have multiple plugins.ini files - check them too.

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Problem Player Models Plugin from OciXCrom

Мнение от Infamous2018 » 27 Май 2018, 18:18

I did . The Only Seperate Plugin ini List is about:

floodban.amxx
Autobuyfix.amxx
BlockName.amxx
BlockUnknownCommand.amxx
fullupdate.amxx

So and i disabled all plugins.. Maybe the rehlds version dont support this Plugin.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Problem Player Models Plugin from OciXCrom

Мнение от OciXCrom » 27 Май 2018, 19:30

ReHLDS has nothing to do with it. Normal AMXX plugins work on ReHLDS too. If it doesn't, then it's a bug from their side that they need to fix, which I doubt is the case.

Do you by any chance have cl_minmodels set to 1?

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Problem Player Models Plugin from OciXCrom

Мнение от Infamous2018 » 27 Май 2018, 19:36

No i dont have this in any of cfg . I have

cl_filterstuffcmd 1

i should add cl_minmodels 1 to server.cfg?

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Problem Player Models Plugin from OciXCrom

Мнение от OciXCrom » 27 Май 2018, 19:56

No. Try it like this:

Код за потвърждение: Избери целия код

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

#define MODEL_DELAY 0.5

enum _:ModelsInfo
{
	Flag,
	CTModel[32],
	TModel[32]
}

new const g_eModels[][ModelsInfo] =
{
	// <Admin flag> <CT skin> <T skin>
	{ ADMIN_LEVEL_A, "owner_ct", "owner_t" },
	{ ADMIN_LEVEL_B, "admin_ct", "admin_t" }
}

new Trie:g_tModels

public plugin_init()
{
	register_plugin("Multiple Player Models", "1.0", "OciXCrom")
	RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
}

public plugin_end()
	TrieDestroy(g_tModels)

public plugin_precache()
{
	g_tModels = TrieCreate()
	
	for(new i; i < sizeof(g_eModels); i++)
	{
		precache_player_model(g_eModels[i][CTModel])
		precache_player_model(g_eModels[i][TModel])
	}
}

public OnPlayerSpawn(id)
	set_task(MODEL_DELAY, "SetModel", id)
	
public SetModel(id)
{
	if(is_user_alive(id))
	{
		static bool:bMatch, iFlags, i
		bMatch = false
		
		for(iFlags = get_user_flags(id), i = 0; i < sizeof(g_eModels); i++)
		{
			if(iFlags & g_eModels[i][Flag])
			{
				switch(cs_get_user_team(id))
				{
					case CS_TEAM_CT: cs_set_user_model(id, g_eModels[i][CTModel])
					case CS_TEAM_T: cs_set_user_model(id, g_eModels[i][TModel])
				}
				
				client_print(id, print_chat, "* Your received the model %s", g_eModels[i][cs_get_user_team(id) == CS_TEAM_CT ? CTModel : TModel])
				bMatch = true
				break
			}
		}
		
		if(!bMatch)
		{
			static szModel[32]
			cs_get_user_model(id, szModel, charsmax(szModel))
			
			if(TrieKeyExists(g_tModels, szModel))
				cs_reset_user_model(id)
		}
	}
}

precache_player_model(szModel[])
{
	TrieSetCell(g_tModels, szModel, 1)
	
	static szFile[128]
	formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", szModel, szModel)
	precache_model(szFile)
	replace(szFile, charsmax(szFile), ".mdl", "T.mdl")
	
	if(file_exists(szFile))
		precache_model(szFile)
}

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Problem Player Models Plugin from OciXCrom

Мнение от Infamous2018 » 27 Май 2018, 22:04

I tested but dont work. It say allready Üu recived model owner_ct . But its allready the standard model :/

I should give up about this =/

Добавено преди 2 часа 1 минута 8 секунди:
Ok i using now last rehlds + modules and now its working. You can close the thread. Thanks for try to help me

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 16 госта