Raised This Month: $ Target: $400
 0% 

Change string in compiled plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
capozblack
Member
Join Date: Mar 2011
Location: Portugal
Old 05-14-2011 , 09:45   Re: Change string in compiled plugin
Reply With Quote #5

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
}
__________________
capozblack is offline
Send a message via MSN to capozblack
 



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 04:25.


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