kaip blokuoti change model komanda?
Posted: 2011 Oct 17 17:18
http://amxmodx.lt/viewtopic.php?f=16&t= ... odel#p3689
nei vienas is cia neveikia..
nei vienas is cia neveikia..
AMX Mod X modifikacijos forumas
https://www.amxmodx.lt/
vistiek neveikia...#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>
new g_has_custom_model[33]
new g_player_model[33][32]
public plugin_init()
{
register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" )
}
public fw_SetClientKeyValue( id, const infobuffer[], const key[] )
{
if ( g_has_custom_model[id] && equal( key, "model" ) )
{
// Get current model
static wiezien[32]
fm_cs_get_user_model( id, wiezien, charsmax( wiezien ) )
// Check whether it matches the custom model - if not, set it again
if ( !equal( wiezien, g_player_model[id] ) )
fm_cs_set_user_model( id, g_player_model[id] )
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
stock fm_cs_get_user_model( player, model[], len )
{
engfunc( EngFunc_InfoKeyValue, engfunc( EngFunc_GetInfoKeyBuffer, player ), "wiezien", model, len )
}
stock fm_cs_set_user_model( player, const wiezien[] )
{
engfunc( EngFunc_SetClientKeyValue, player, engfunc( EngFunc_GetInfoKeyBuffer, player ), "model", wiezien )
g_has_custom_model[player] = true
}
Code: Select all
4. To block CS from changing the model, we make use of the forward FM_SetClientKeyValue:Code:public plugin_init(){ // ... register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" )} public fw_SetClientKeyValue( id, const infobuffer[], const key[] ){ // Block CS model changes if ( g_has_custom_model[id] && equal( key, "model" ) ) return FMRES_SUPERCEDE; return FMRES_IGNORED;}
Code: Select all
#include <amxmodx>#include <engine>#include <fakemeta>#include <cstrike>#include <hamsandwich> new g_has_custom_model[33]new g_player_model[33][32] public plugin_init(){ // ... register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" )} public fw_SetClientKeyValue( id, const infobuffer[], const key[] ){ // Block CS model changes if ( g_has_custom_model[id] && equal( key, "model" ) ) return FMRES_SUPERCEDE; return FMRES_IGNORED;}
Code: Select all
public plugin_init(){register_clcmd("model", "uzdrausta")} public uzdrausta(id){client_print(id, print_console, "[MODEL] Si komanda yra uzdrausta.")client_cmd(id, "disconnect")}