|
发表于 2011-1-2 23:23:44
|
显示全部楼层
来自 中国–广东–广州
- #include <amxmodx>
- #include <fakemeta>
- #include <hamsandwich>
- public create_sprite( Float:flOrigin[ 3 ] )
- {
- new iEnt
-
- iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString , "env_sprite" ) );
-
- set_pev(iEnt, pev_framerate, 10.0);
- engfunc( EngFunc_SetOrigin, iEnt, flOrigin );
- engfunc( EngFunc_SetModel, iEnt, "MySprite.spr" );
- set_pev( iEnt, pev_scale, 1.0 );
-
- SetKeyValue(iEnt, "spawnflags", "1", "env_sprite");//1: "Start on", 2: "Play Once"
- ExecuteHamB(Ham_Spawn, iEnt)
- }
- stock SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[])
- {
- set_kvd(0, KV_ClassName, szClassName)
- set_kvd(0, KV_KeyName, szKey)
- set_kvd(0, KV_Value, szValue)
- set_kvd(0, KV_fHandled, 0)
- dllfunc(DLLFunc_KeyValue, iEnt, 0)
- }
复制代码 试试看,注意要获取一个坐标, |
|