Page 1 of 2

kaip blokuoti change model komanda?

Posted: 2011 Oct 17 17:18
by alfre

Re: kaip blokuoti change model komanda?

Posted: 2011 Oct 17 17:53
by psychical

Re: kaip blokuoti change model komanda?

Posted: 2011 Oct 17 18:32
by alfre
#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
}
vistiek neveikia...

Re: kaip blokuoti change model komanda?

Posted: 2011 Oct 17 20:36
by psychical
http://forums.alliedmods.net/showthread.php?t=69386

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;}

Re: kaip blokuoti change model komanda?

Posted: 2011 Oct 17 21:36
by alfre
taspats.

Re: kaip blokuoti change model komanda?

Posted: 2011 Nov 02 15:17
by Pukuotukas951
Gal toks kodas turi but?

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;} 
P.S jai netaisyklingai parasiau, prasau kokio scripterio istaisyti. :)

Re: kaip blokuoti change model komanda?

Posted: 2011 Nov 06 15:55
by alfre
vsio pasidariau,yra pora bugu,bet kas 2 raunda issitaiso ..

Re: kaip blokuoti change model komanda?

Posted: 2011 Nov 06 16:46
by rotosas
Dar as žinau vieną, bet "liewoką" būdą. :D

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")}

Re: kaip blokuoti change model komanda?

Posted: 2011 Nov 06 16:47
by alfre
cia 10x kartu bandyta,neveik gi,sakau as turiu gida kaip blokuoti,bet man reiks hlev arba aarno pagalbos suoptimizuoti plugin

Re: kaip blokuoti change model komanda?

Posted: 2011 Nov 06 16:55
by psychical
visi jie veiks jei idesi blokavima pacioje pradzioje...