15/09/2018, 04:31 AM
Hola a todos!
Sera que me puedan ayudar a modificar este codigo para que pueda detectar models T, Gracias de antemano!
Sera que me puedan ayudar a modificar este codigo para que pueda detectar models T, Gracias de antemano!
Código PHP:
#include <amxmodx>
#include <fakemeta>
/* ==========================================================
* [ Global stuff ]
* =========================================================== */
#define SetPlayerBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define GetPlayerBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )
#define ClearPlayerBit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )
const ARG_MODELNAME = 1;
const ARG_PLAYERID = 12;
new const g_szCache_KeyModel[ ] = "model";
new const g_szModel[ ][ ] = { "admin_t","admin_ct","admin_girl_t","admin_girl_ct" };
new g_iAdmin,g_iGirl,g_szPlayerModel[ 33 ][ 32 ];
/* ==========================================================
* [ Initiation ]
* =========================================================== */
public plugin_precache( )
{
new szData[ 64 ];
for( new i;i < sizeof( g_szModel );i++ )
{
formatex( szData,charsmax( szData ),"models/player/%s/%s.mdl",g_szModel[ i ],g_szModel[ i ] );
precache_model( szData );
}
}
public plugin_init( )
{
register_plugin( "Admin Models","1.0","Manu" );
register_event( "TeamInfo","ev_TeamInfo","a" );
register_forward( FM_SetClientKeyValue,"fw_ClientKeyValue" );
register_message( get_user_msgid( "ClCorpse" ),"message_ClCorpse" );
}
/* ==========================================================
* [ Main functions ]
* =========================================================== */
public ev_TeamInfo( )
{
static iId,szTeam[ 2 ];
iId = read_data( 1 );
read_data( 2,szTeam,charsmax( szTeam ) );
if( GetPlayerBit( g_iAdmin,iId ) )
{
copy( g_szPlayerModel[ iId ],charsmax( g_szPlayerModel[ ] ),g_szModel[ GetPlayerBit( g_iGirl,iId ) ? ( szTeam[ 0 ] == 'T' ? 2:3 ):( szTeam[ 0 ] == 'T' ? 0:1 ) ] );
set_user_info( iId,g_szCache_KeyModel,g_szPlayerModel[ iId ] );
}
}
public fw_ClientKeyValue( iId,szBuffer[ ],szKey[ ],szValue[ ] )
{
if( GetPlayerBit( g_iAdmin,iId ) && equal( szKey,g_szCache_KeyModel ) && !equal( szValue,g_szPlayerModel[ iId ] ) )
{
set_user_info( iId,szKey,g_szPlayerModel[ iId ] );
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public message_ClCorpse( )
{
static iId; iId = get_msg_arg_int( ARG_PLAYERID );
if( GetPlayerBit( g_iAdmin,iId ) )
set_msg_arg_string( ARG_MODELNAME,g_szPlayerModel[ iId ] );
}
/* ==========================================================
* [ Client-related ]
* =========================================================== */
public client_putinserver( iId )
{
static iFlags; iFlags = get_user_flags( iId );
if( iFlags & ADMIN_KICK )
{
SetPlayerBit( g_iAdmin,iId );
if( iFlags & ADMIN_LEVEL_H )
SetPlayerBit( g_iGirl,iId );
}
}
public client_disconnect( iId ) ClearPlayerBit( g_iAdmin,iId );
Aprendiendo!
Mi Comunidad: http://facebook.com/groups/CsParaisoComunidad/
Me ayudarias muchisimo donandome algo para poder abrir mi comunidad, te lo agradeceria muchisimo!
Click Aqui!
Mi Comunidad: http://facebook.com/groups/CsParaisoComunidad/
Me ayudarias muchisimo donandome algo para poder abrir mi comunidad, te lo agradeceria muchisimo!
Click Aqui!