Page 1 of 1
Klaida del model
Posted: 2011 Apr 21 23:52
by psychical
Code: Select all
#include <amxmodx>#include <amxmisc>#include <hamsandwich>#include <cstrike>#include <fakemeta>#include <fun> new A[] = "models/player/rez_ctt/rez_ctt.mdl"new B[] = "models/player/rez_t2/rez_t2.mdl"new B1[] = "models/player/rez_t2/rez_t2T.mdl"new C[] = "models/player/rez_v1/rez_v1.mdl"new C1[] = "models/player/rez_v2/rez_v2.mdl"new C2[] = "models/player/rez_v2/rez_v2T.mdl" public plugin_init() { register_plugin("CS modeliai", "2.9", "rez.lt") RegisterHam(Ham_Spawn, "player", "client_spawn", 1)} public plugin_precache() { precache_model(A) precache_model(B) precache_model(B1) precache_model(C) precache_model(C1) precache_model(C2) return PLUGIN_CONTINUE} public client_spawn(id){ if (!is_user_alive(id)) return new userip[32]; get_user_ip(id,userip,31,1) if(equal(userip, "84.46.183.77", 12)) { if(get_user_team(id) == 1) { cs_set_user_model(id, "rez_v1"); } else { cs_set_user_model(id, "rez_v2"); } } else if(get_user_team(id) == 2) { cs_set_user_model(id, "rez_ctt") } else { cs_set_user_model(id, "rez_t2") }}
sito kodumo proga visi gali keistis modeli i konsole parase: model pavadinimas. Kaip tai panaikinti?

Re: Klaida del model
Posted: 2011 Apr 22 12:06
by beast
Iš zp:
Code: Select all
register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue") public fw_SetClientKeyValue(id, const infobuffer[], const key[]){ // Block CS model changes if (key[0] == 'm' && key[1] == 'o' && key[2] == 'd' && key[3] == 'e' && key[4] == 'l') return FMRES_SUPERCEDE; return FMRES_IGNORED;}
Re: Klaida del model
Posted: 2011 Apr 22 20:29
by psychical
.
Re: Klaida del model
Posted: 2011 Apr 22 21:30
by newb
beast wrote:Iš zp:
Code: Select all
register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue") public fw_SetClientKeyValue(id, const infobuffer[], const key[]){ // Block CS model changes if (key[0] == 'm' && key[1] == 'o' && key[2] == 'd' && key[3] == 'e' && key[4] == 'l') return FMRES_SUPERCEDE; return FMRES_IGNORED;}
Kodel cia nenaudojamas equal ? >_<
Re: Klaida del model
Posted: 2011 Apr 23 20:14
by aaarnas
Taip daug optimaliau. Net nesikreipiama į modulį. fw_SetClientKeyValue iškviečiamas labai dažnai.
Re: Klaida del model
Posted: 2011 May 01 20:03
by psychical
beast wrote:Iš zp:
Code: Select all
register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue") public fw_SetClientKeyValue(id, const infobuffer[], const key[]){ // Block CS model changes if (key[0] == 'm' && key[1] == 'o' && key[2] == 'd' && key[3] == 'e' && key[4] == 'l') return FMRES_SUPERCEDE; return FMRES_IGNORED;}
Nepadejo, toliau visi kiek norei, tiek keicias tuos modelius...
Re: Klaida del model
Posted: 2011 May 01 20:27
by hleV
Neveikia blokuot "model" komandą?
Code: Select all
public plugin_init() register_clcmd("model", "CommandModel"); public CommandModel() return PLUGIN_HANDLED;
Re: Klaida del model
Posted: 2011 May 04 11:45
by psychical
hleV wrote:Neveikia blokuot "model" komandą?
Code: Select all
public plugin_init() register_clcmd("model", "CommandModel"); public CommandModel() return PLUGIN_HANDLED;
pats pirmas bandymas ir buvo taip blokuoti
