|
发表于 2008-7-24 19:35:18
|
显示全部楼层
来自 中国–北京–北京–海淀区
回复: [求助]谁能帮帮手 写个只删除C4的插件
- int C_Spawn(edict_t *pent)
- {
- const char *szClass = STRING(pent->v.classname);
- if(szClass[0] == 'w' && szClass[1] == 'o' && szClass[5] == 's')
- {
- g_activated = false;
- g_players_num = 0;
- g_players_t = 0;
- g_players_ct = 0;
- g_bots_num = 0;
- g_task_time = gpGlobals->time;
- //"worldspawn" : do precache stuff here
- g_spr_smoke = PRECACHE_MODEL("sprites/smoke.spr");
- PRECACHE_SOUND("radio/ct_fireinhole.wav");
- PRECACHE_SOUND("ambience/crow.wav");
- PRECACHE_SOUND("misc/MassTeleportTarget.wav");
- PRECACHE_SOUND("misc/Levelupcaster.wav");
- PRECACHE_SOUND("misc/deaf_sound.wav");
- PRECACHE_SOUND("misc/headshot.wav");
- PRECACHE_SOUND("misc/humiliation.wav");
- PRECACHE_SOUND("misc/perfect.wav");
- PRECACHE_SOUND("misc/grenade.wav");
- char sound[23];
- for(int i = 1; i < SND_LEVEL; ++i)
- {
- sprintf(sound, "misc/%s.wav", g_sound_level[i]);
- PRECACHE_SOUND((char *)STRING(ALLOC_STRING(sound)));
- }
- PRECACHE_SOUND("misc/unstoppable.wav");
- RETURN_META_VALUE(MRES_IGNORED, 0);
- }
- if(szClass[0] == 'a' && szClass[1] == 'r')
- {
- //"armoury_entity"
- REMOVE_ENTITY(pent);
- RETURN_META_VALUE(MRES_SUPERCEDE, 0);
- }
- if(szClass[0] == 'h')
- {
- //"hostage_entity"
- REMOVE_ENTITY(pent);
- RETURN_META_VALUE(MRES_SUPERCEDE, 0);
- }
- if(szClass[0] == 'm' && szClass[8] == 's')
- {
- //"monster_scientist"
- REMOVE_ENTITY(pent);
- RETURN_META_VALUE(MRES_SUPERCEDE, 0);
- }
- if(szClass[5] == 'b' && szClass[6] == 'o')
- {
- //"func_bomb_target"
- //"info_bomb_target"
- REMOVE_ENTITY(pent);
- RETURN_META_VALUE(MRES_SUPERCEDE, 0);
- }
- if(szClass[5] == 'h' && szClass[6] == 'o' && szClass[7] == 's')
- {
- //"func_hostage_rescue"
- //"info_hostage_rescue"
- REMOVE_ENTITY(pent);
- RETURN_META_VALUE(MRES_SUPERCEDE, 0);
- }
- if(szClass[5] == 'v' && szClass[6] == 'i')
- {
- //"func_vip_safetyzone"
- //"info_vip_start"
- REMOVE_ENTITY(pent);
- RETURN_META_VALUE(MRES_SUPERCEDE, 0);
- }
- if(szClass[0] == 'f' && szClass[5] == 'e')
- {
- //"func_escapezone"
- REMOVE_ENTITY(pent);
- RETURN_META_VALUE(MRES_SUPERCEDE, 0);
- }
- RETURN_META_VALUE(MRES_IGNORED, 0);
- }
复制代码 写完了代码一段时间不碰就忘了,哎,懒得加注释的后果。。。 |
|