Senior Member
|
07-18-2007
, 23:29
Re: ScreenFade
|
#13
|
Quote:
Originally Posted by stupok69
I don't know what "Transparency code" is, but here's a function you can use to give weapons:
Code:
stock ts_giveweapon_custom(id, weaponid, clip, attachments)
{
new value[16]
if(weaponid > 37) return 0
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "ts_groundweapon"))
if(!pev_valid(ent)) return 0
formatex(value, 15, "%i", weaponid)
set_keyvalue(ent, "tsweaponid", value)
formatex(value, 15, "%i", clip)
set_keyvalue(ent, "wextraclip", value)
formatex(value, 15, "%i", attachments)
set_keyvalue(ent, "spawnflags", value)
return dllfunc(DLLFunc_Use, ent, id)
}
//Thank you Basic-Master
stock set_keyvalue(ent, key[], value[])
{
new classname[32]
pev(ent, pev_classname, classname, 31)
set_kvd(0, KV_ClassName, classname)
set_kvd(0, KV_KeyName, key)
set_kvd(0, KV_Value, value)
set_kvd(0, KV_fHandled, 0)
dllfunc(DLLFunc_KeyValue, ent, 0)
}
I just tried doing some message logging with Damaged Soul's plugin and I couldn't get ScreenFade to fire, maybe you guys should try.
|
Whoa, that code is almost exactly the same as what I had to spawn weapons. I had no luck with this but I will try yours.
Code:
/*
Weapon Spawns
*/
stock ts_spawnweapon(weaponid[],duration[],extraclip[],spawnflags[],Float:Origin[3]) {
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "ts_groundweapon"));
set_keyvalue(ent,"tsweaponid",weaponid);
set_keyvalue(ent,"wduration",duration);
set_keyvalue(ent,"wextraclip",extraclip);
set_keyvalue(ent,"spawnflags",spawnflags);
dllfunc(DLLFunc_Think,ent);
set_pev(ent,pev_origin,Origin);
return PLUGIN_HANDLED;
}
/*
Set Keyvalue - Coded by Basic-Master
*/
stock set_keyvalue(ent, key[], value[]) {
new classname[32]
pev(ent, pev_classname, classname, 31)
set_kvd(0, KV_ClassName, classname)
set_kvd(0, KV_KeyName, key)
set_kvd(0, KV_Value, value)
set_kvd(0, KV_fHandled, 0)
dllfunc(DLLFunc_KeyValue, ent, 0)
}
EDIT: Tried what you have. It claims it spawned the weapon but the weapon is not there.
Last edited by Minimum; 07-18-2007 at 23:43.
|
|