Relvade modelite muutmine
Lehekülg 1, lehekülgi kokku 1 • Share
- Tonight
- Liitus : 19/02/2012
Postitusi : 18000
• Kood:
- Kood:
#include <amxmodx>
#include <engine>
#include <fakemeta>
new VIEW_MODEL[] = "models/v_<nimi>.mdl"
new PLAYER_MODEL[] = "models/p_<nimi>.mdl"
new WORLD_MODEL[] = "models/w_<nimi>.mdl"
new OLDWORLD_MODEL[] = "models/w_<nimi>.mdl" // vana model, mida muuta soovid
public plugin_init()
{
register_plugin("Custom Model", "1.0", "Cheap_Suit")
register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
register_forward(FM_SetModel, "fw_SetModel")
}
public plugin_precache()
{
precache_model(VIEW_MODEL)
precache_model(PLAYER_MODEL)
precache_model(WORLD_MODEL)
}
public Event_CurWeapon(id)
{
new weaponID = read_data(2)
// relva nimi, mida muudad (teiste puhul plugin skipib)
if(weaponID != CSW_nimi)
return PLUGIN_CONTINUE
entity_set_string(id, EV_SZ_viewmodel, VIEW_MODEL)
entity_set_string(id, EV_SZ_weaponmodel, PLAYER_MODEL)
return PLUGIN_CONTINUE
}
public fw_SetModel(entity, model[])
{
if(!is_valid_ent(entity))
return FMRES_IGNORED
if(!equali(model, OLDWORLD_MODEL))
return FMRES_IGNORED
new className[33]
entity_get_string(entity, EV_SZ_classname, className, 32)
// dropitud relvad mapi relvad c4 + granaadid
if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
{
entity_set_model(entity, WORLD_MODEL)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
Kui modelil puudub uus world model, siis kasuta defaulti. Näide:
new WORLD_MODEL[] = "models/w_knife.mdl"
new WORLD_MODEL[] = "models/w_knife.mdl"
• Relvade ID nimekiri:
- Kood:
#define CSW_P228 1
#define CSW_SCOUT 3
#define CSW_HEGRENADE 4
#define CSW_XM1014 5
#define CSW_C4 6
#define CSW_MAC10 7
#define CSW_AUG 8
#define CSW_SMOKEGRENADE 9
#define CSW_ELITE 10
#define CSW_FIVESEVEN 11
#define CSW_UMP45 12
#define CSW_SG550 13
#define CSW_GALI 14
#define CSW_GALIL 14
#define CSW_FAMAS 15
#define CSW_USP 16
#define CSW_GLOCK18 17
#define CSW_AWP 18
#define CSW_MP5NAVY 19
#define CSW_M249 20
#define CSW_M3 21
#define CSW_M4A1 22
#define CSW_TMP 23
#define CSW_G3SG1 24
#define CSW_FLASHBANG 25
#define CSW_DEAGLE 26
#define CSW_SG552 27
#define CSW_AK47 28
#define CSW_KNIFE 29
#define CSW_P90 30
- Rare Skillzz
- Liitus : 01/04/2016
Postitusi : 457
Tänud @Tonight Otsisin pidevalt seda, uurisin erinevatest foorumitest, nii kui ka googlest. Leidsin ainult tühja, siit leiab pidevalt midagi positiivset.
Soovid vestluses osaleda?
Selleks logi sisse või tee endale kasutaja.
Lehekülg 1, lehekülgi kokku 1
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele