Raised This Month: $ Target: $400
 0% 

Please HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Usama Ali
Member
Join Date: Apr 2020
Old 04-17-2022 , 21:51   Please HELP
Reply With Quote #1

so basically i have this plugin which changes skin according to steam id.. but the problem is i use zombie mod and when i chose the skin for Terrorist the skin remains the same after the infection starts. the skin does not change to zombie.


IF Any One Can Edit It And Give me a fix... i am using Zombie Plague 4.3
Fix5


plugin link : https://forums.alliedmods.net/showthread.php?t=106094

Last edited by Usama Ali; 04-17-2022 at 21:53.
Usama Ali is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-17-2022 , 22:14   Re: Please HELP
Reply With Quote #2

[
PHP Code:
/**
 * Overrides ZP player model with a different custom model.
 *
 * Note: This will last until player's next infection/humanization/respawn.
 *
 * Note: Don't call more often than absolutely needed.
 *
 * @param id        Player index.
 * @param newmodel    Model name.
 * @param modelindex    Modelindex (optional).
 */
native zp_override_user_model(id, const newmodel[], modelindex 0
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Usama Ali
Member
Join Date: Apr 2020
Old 04-17-2022 , 22:28   Re: Please HELP
Reply With Quote #3

Quote:
Originally Posted by Supremache View Post
[
PHP Code:
/**
 * Overrides ZP player model with a different custom model.
 *
 * Note: This will last until player's next infection/humanization/respawn.
 *
 * Note: Don't call more often than absolutely needed.
 *
 * @param id        Player index.
 * @param newmodel    Model name.
 * @param modelindex    Modelindex (optional).
 */
native zp_override_user_model(id, const newmodel[], modelindex 0
Hey i did what you said wont work or maybe i dont understand.

here my sma file can you edit this please..
Attached Files
File Type: sma Get Plugin or Get Source (zombie_escape.sma - 66 views - 342.7 KB)
File Type: sma Get Plugin or Get Source (players_models.sma - 35 views - 4.4 KB)
Usama Ali is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-18-2022 , 01:11   Re: Please HELP
Reply With Quote #4

I created this plugin now but haven't tested it, so give it a try.

1. Create confing file with name "CustomModels.ini"
2. Create a custom model for players "SteamID" "Model" "Flags"
Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <zombieplague> new const Version[ ] = "1.0.0"; #if !defined MAX_PLAYERS     const MAX_PLAYERS = 32 #endif #if !defined MAX_AUTHID_LENGTH     const MAX_AUTHID_LENGTH = 64 #endif enum _:PlayerModels {     Player_SteamID[ MAX_AUTHID_LENGTH ],     Player_Model[ 64 ],     Player_Flags } new Trie:g_tModels, eData[ PlayerModels ], g_szSteamID[ MAX_PLAYERS + 1 ][ MAX_AUTHID_LENGTH ]; public plugin_init( ) {     register_plugin( "ZP: Custom Models", Version, "Supremache" )     register_cvar( "CustomModels", Version, FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED )         g_tModels = TrieCreate( );         RegisterHam( Ham_Spawn, "player", "CBasePlayer_Spawn", 1 ); } public plugin_precache( ) {     ReloadFile( ); } public client_connect( id ) {     get_user_authid( id, g_szSteamID[ id ], charsmax( g_szSteamID[ ] ) ) } public CBasePlayer_Spawn( id ) {     if( !is_user_alive( id ) )     {         return;     }         if( TrieGetArray( g_tModels, g_szSteamID[ id ], eData, sizeof eData ) )     {         if( eData[ Player_Model ][ 0 ] != EOS && !zp_get_user_zombie( id ) && has_all_flags( id, eData[ Player_Flags ] ) )         {             zp_override_user_model( id, eData[ Player_Model ] );         }     } } ReloadFile( ) {     new g_szFile[ 128 ]         get_configsdir( g_szFile, charsmax( g_szFile ) );     add( g_szFile, charsmax( g_szFile ), "/CustomModels.ini" )         new iFile = fopen( g_szFile, "rt" );         if( iFile )     {         new szData[ 512 ], szFlags[ 22 ];                 while( fgets( iFile, szData, charsmax( szData ) ) )         {                 trim( szData );                         switch( szData[ 0 ] )             {                 case EOS, ';', '#', '/': continue;                 default:                 {                     szFlags[ 0 ] = ADMIN_ALL;                                         parse( szData, eData[ Player_SteamID ], charsmax( eData[ Player_SteamID ] ), eData[ Player_Model ], charsmax( eData[ Player_Model ] ), szFlags, charsmax( szFlags ) )                                         if( eData[ Player_SteamID ][ 0 ] )                     {                         precache_player_model( eData[ Player_Model ] );                         eData[ Player_Flags ] = read_flags( szFlags );                         TrieSetArray( g_tModels, eData[ Player_SteamID ], eData, sizeof eData );                     }                                         arrayset( eData, 0, sizeof( eData ) );                 }             }         }         fclose( iFile );     } } //Credits to OciXCrom precache_player_model(const szModel[], &id = 0) {     new model[128]     formatex(model, charsmax(model), "models/player/%s/%sT.mdl", szModel, szModel)     if(file_exists(model))     {         id = precache_generic(model)     }     static const extension[] = "T.mdl"     #pragma unused extension         copy(model[strlen(model) - charsmax(extension)], charsmax(model), ".mdl")         return precache_generic(model) }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 04-18-2022 at 09:49.
Supremache is offline
Usama Ali
Member
Join Date: Apr 2020
Old 04-18-2022 , 09:21   Re: Please HELP
Reply With Quote #5

Quote:
Originally Posted by Supremache View Post
I created this plugin now but haven't tested it, so give it a try.

1. Create confing file with name "CustomModels.ini"
2. Create a custom model for players "SteamID" "Model" "Flags"
Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> new const Version[ ] = "1.0.0"; #if !defined MAX_PLAYERS     const MAX_PLAYERS = 32 #endif #if !defined MAX_AUTHID_LENGTH     const MAX_AUTHID_LENGTH = 64 #endif enum _:PlayerModels {     Player_SteamID[ MAX_AUTHID_LENGTH ],     Player_Model[ 64 ],     Player_Flags } new Trie:g_tModels, eData[ PlayerModels ], g_szSteamID[ MAX_PLAYERS + 1 ][ MAX_AUTHID_LENGTH ]; public plugin_init( ) {     register_plugin( "ZP: Custom Models", Version, "Supremache" )     register_cvar( "CustomModels", Version, FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED )         g_tModels = TrieCreate( );         RegisterHam( Ham_Spawn, "player", "CBasePlayer_Spawn", 1 ); } public plugin_precache( ) {     ReloadFile( ); } public client_connect( id ) {     get_user_authid( id, g_szSteamID[ id ], charsmax( g_szSteamID[ ] ) ) } public CBasePlayer_Spawn( id ) {     if( !is_user_alive( id ) )     {         return;     }         if( TrieGetArray( g_tModels, g_szSteamID[ id ], eData, sizeof eData ) )     {         if( eData[ Player_Model ][ 0 ] != EOS && !zp_is_user_zombie( id ) && has_all_flags( id, eData[ Player_Flags ] ) )         {             zp_override_user_model( id, eData[ Player_Model ] );             break;         }     } } ReloadFile( ) {     new g_szFile[ 128 ]         get_configsdir( g_szFile, charsmax( g_szFile ) );     add( g_szFile, charsmax( g_szFile ), "/CustomModels.ini" )         new iFile = fopen( g_szFile, "rt" );         if( iFile )     {         new szData[ 512 ], szFlags[ 22 ];                 while( fgets( iFile, szData, charsmax( szData ) ) )         {                 trim( szData );                         switch( szData[ 0 ] )             {                 case EOS, ';', '#', '/': continue;                 default:                 {                     szFlags[ 0 ] = ADMIN_ALL;                                         parse( szData, eData[ Player_SteamID ], charsmax( eData[ Player_SteamID ] ), eData[ Player_Model ], charsmax( eData[ Player_Model ] ), szFlags, charsmax( szFlags ) )                                         if( eData[ Player_SteamID ][ 0 ] )                     {                         precache_player_model( eData[ Player_Model ] );                         eData[ Player_Flags ] = read_flags( szFlags );                         TrieSetArray( g_tModels, eData[ Player_SteamID ], eData, sizeof eData );                     }                                         arrayset( eData, 0, sizeof( eData ) );                 }             }         }         fclose( iFile );     } } //Credits to OciXCrom precache_player_model(const szModel[], &id = 0) {     new model[128]     formatex(model, charsmax(model), "models/player/%s/%sT.mdl", szModel, szModel)     if(file_exists(model))     {         id = precache_generic(model)     }     static const extension[] = "T.mdl"     #pragma unused extension         copy(model[strlen(model) - charsmax(extension)], charsmax(model), ".mdl")         return precache_generic(model) }
the plugin fails to compile even after i put #include <zombieplague...

The Following error occurs


Code:
custom_models.sma(53) : error 017: undefined symbol "zp_is_user_zombie" custom_models.sma(55) : error 017: undefined symbol "zp_override_user_model" custom_models.sma(56) : error 024: "break" or "continue" is out of context

Glad your helping..

Last edited by Usama Ali; 04-18-2022 at 09:22.
Usama Ali is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-18-2022 , 09:42   Re: Please HELP
Reply With Quote #6

Attach the include file of zp mod
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Usama Ali
Member
Join Date: Apr 2020
Old 04-18-2022 , 10:24   Re: Please HELP
Reply With Quote #7

Quote:
Originally Posted by Supremache View Post
Attach the include file of zp mod
The problem has been fixed on my another post..

Thanks For your time and help, means alot
Usama Ali is offline
Reply


Thread Tools
Display Modes

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 21:21.


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