Raised This Month: $ Target: $400
 0% 

Please HELP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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