I created a plugin that changes the players to cts / trs but it is not always the same makes a random models.
Could be useful for you
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "Model Random"
#define VERSION "0.1"
#define AUTHOR "Capoz"
new const TrModel[][] = { "tr7", "tr5", "tr4" }
new const CtModel[][] = { "ct3", "ct1", "ct2" }
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam( Ham_Spawn, "player", "PlayerSpawn_Post", 1 )
register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" )
}
public plugin_precache() {
new TrPrecache[ 64 ], CtPrecache[ 64 ]
for( new i; i < sizeof( TrModel ); i++ ) {
format( TrPrecache, 63, "models/player/%s/%s.mdl", TrModel[ i ], TrModel[ i ] )
precache_model( TrPrecache );
}
for( new i; i < sizeof( CtModel ); i++ ) {
format( CtPrecache, 63, "models/player/%s/%s.mdl", CtModel[ i ], CtModel[ i ] )
precache_model( CtPrecache );
}
}
public fw_SetClientKeyValue( id, const infobuffer[], const key[] ) {
if( equal( key, "model" ) )
return FMRES_SUPERCEDE
return FMRES_IGNORED
}
public PlayerSpawn_Post( id ) {
if( !is_user_connected( id ) | !is_user_alive( id ) )
return HAM_IGNORED
switch( get_user_team( id ) ) {
case 1: set_user_info( id, "model", TrModel[ random( sizeof( TrModel )-1 ) ] )
case 2: set_user_info( id, "model", CtModel[ random( sizeof( CtModel )-1 ) ] )
}
return HAM_IGNORED
}
__________________
|