kaip blokuoti change model komanda?

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
alfre
Gana aktyvus vartotojas
Posts: 259
Joined: 2011 May 13 14:01
Skype: alfredasxl996
Contact:

kaip blokuoti change model komanda?

Post by alfre »



alfre
Gana aktyvus vartotojas
Posts: 259
Joined: 2011 May 13 14:01
Skype: alfredasxl996
Contact:

Re: kaip blokuoti change model komanda?

Post 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...

User avatar
psychical
Viršininkas
Posts: 2094
Joined: 2011 Mar 12 22:19
Skype: tautvydas11
Location: Linksmakalnis
Contact:

Re: kaip blokuoti change model komanda?

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

alfre
Gana aktyvus vartotojas
Posts: 259
Joined: 2011 May 13 14:01
Skype: alfredasxl996
Contact:

Re: kaip blokuoti change model komanda?

Post by alfre »

taspats.

Pukuotukas951
Gana aktyvus vartotojas
Posts: 445
Joined: 2011 Aug 27 09:29

Re: kaip blokuoti change model komanda?

Post 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. :)

alfre
Gana aktyvus vartotojas
Posts: 259
Joined: 2011 May 13 14:01
Skype: alfredasxl996
Contact:

Re: kaip blokuoti change model komanda?

Post by alfre »

vsio pasidariau,yra pora bugu,bet kas 2 raunda issitaiso ..

User avatar
rotosas
Gana aktyvus vartotojas
Posts: 225
Joined: 2011 Mar 19 18:56
Skype: rotosas
Location: Vilnius

Re: kaip blokuoti change model komanda?

Post 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")}
Last edited by rotosas on 2011 Nov 06 16:48, edited 1 time in total.
Image
Image
Jei padėjau, nepagailėk ir nepatingėk paspaust +KARMA. :)

alfre
Gana aktyvus vartotojas
Posts: 259
Joined: 2011 May 13 14:01
Skype: alfredasxl996
Contact:

Re: kaip blokuoti change model komanda?

Post by alfre »

cia 10x kartu bandyta,neveik gi,sakau as turiu gida kaip blokuoti,bet man reiks hlev arba aarno pagalbos suoptimizuoti plugin


Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests