|
发表于 2012-6-12 11:40:47
|
显示全部楼层
来自 中国–陕西–咸阳
本帖最后由 726691010 于 2012-6-12 11:42 编辑
还是关于每局间隔40秒发O4的问题,我找到了个源码但在游戏里不起什么作用,有时只是开局送个雷,如果死亡了再开局就不送了好像,所以还是来麻烦您给改改……
这个忙你可一定要帮帮我……
01. #include <amxmodx>
02. #include <amxmisc>
03. #include <fakemeta>
04.
05. new g_giveTime[33];
06.
07. public plugin_init()
08. register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
09.
10. public fw_PlayerPreThink(id)
11. {
12. if (!is_user_alive (id))
13. {
14. g_giveTime[id] = 0.0;
15. return;
16. }
17.
18. if (g_giveTime[id] == 0.0)
19. g_giveTime[id] = get_gametime ()+ 40.0;
20.
21. if (g_giveTime[id] > get_gametime ())
22. return;
23.
24. g_giveTime[id] = get_gametime ()+ 40.0;
25. fm_give_item(id,"weapon_hegrenade");
26. }
27.
28. stock fm_give_item(id, const item[])
29. {
30. static ent
31. ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
32. if (!pev_valid(ent)) return;
33.
34. static Float:originF[3]
35. pev(id, pev_origin, originF)
36. set_pev(ent, pev_origin, originF)
37. set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
38. dllfunc(DLLFunc_Spawn, ent)
39.
40. static save
41. save = pev(ent, pev_solid)
42. dllfunc(DLLFunc_Touch, ent, id)
43. if (pev(ent, pev_solid) != save)
44. return;
45.
46. engfunc(EngFunc_RemoveEntity, ent)
47. } |
|