hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.08. 10:05



Jelenlévő felhasználók

Jelenleg 352 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 352 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: U surf
HozzászólásElküldve: 2013.06.17. 13:12 
Offline
Fanatikus
Avatar

Csatlakozott: 2013.04.10. 13:11
Hozzászólások: 161
Megköszönt másnak: 31 alkalommal
Megköszönték neki: 7 alkalommal
Sziasztok...

Ezt lefordítaná valaki? Nagyon hálás lennék...

SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2.  
  3. Copyleft 2007
  4.  
  5. USURF
  6. =====
  7.  
  8. Description
  9. This mod is designed to assist in the running of a surf server. It
  10. includes many features, such as surfing help, semiclip, checkpoints,
  11. "BOOM" button removal and many more features.
  12.  
  13. Was previously known as "Surf Management / Tools"
  14.  
  15. Changelog:
  16.  
  17. March 4, 2007 - v5.0 - Renamed and fixed major bugs
  18. March 13, 2007 - v5.1 - [FEATURE] Added timer
  19. [FEATURE] Added bunnyhop
  20. [FEATURE] Added team stack
  21. [FEATURE] Added godmode
  22. [BUG] Improved semiclip
  23. [BUG] Fixed crashing on Linux servers
  24. [BUG] Fixed crouching with checkpoints
  25. [BUG] Fixed respawn to send people back
  26. to their spawns rather than killing them
  27. March 16, 2007 - v5.2 - [FEATURE] Cleaned up the /surfhelp MOTD display
  28. [FEATURE] Added menu to /surfhelp
  29. [BUG] Fixed surf help showing more than once
  30. [BUG] Optimized surf help section
  31. [BUG] Added new commands to /surfhelp display
  32. [BUG] Removed some old semiclip code that was
  33. causing problems only for people on the same team
  34. [BUG] Fixed checkpoints and timers working on
  35. non-surf maps
  36.  
  37. Credits:
  38. XxAvalanchexX - Post about blocking knife hits
  39.  
  40. */
  41.  
  42. #include <amxmodx>
  43. #include <amxmisc>
  44. #include <fakemeta>
  45. #include <cstrike>
  46. #include <time>
  47.  
  48. #define TIMER_TASK 23981293
  49. #define TIMER_INTERVAL 1.0
  50.  
  51. new p_On
  52. new p_AutoCvars
  53. new p_Help
  54. new p_HelpInterval
  55. new p_Respawn
  56. new p_RemoveDropped
  57. new p_RemoveButton
  58. new p_NoGuns
  59. new p_SpawnDist
  60. new p_Semiclip
  61. new p_Cp
  62. new p_CpDelay
  63. new p_BunnyHop
  64. new p_BunnyHopAutoJump
  65. new p_Timer
  66. new p_X
  67. new p_Y
  68. new p_R
  69. new p_G
  70. new p_B
  71. new p_TeamStack
  72. new p_Godmode
  73.  
  74. new bool:g_SurfMap
  75.  
  76. new Float:g_Origin[33][3]
  77. new Float:g_Velocity[33][3]
  78. new Float:g_Angles[33][3]
  79. new Float:g_LastSave[33]
  80.  
  81. new g_Time[33]
  82. new g_Timing[33]
  83. new g_Timer[33]
  84.  
  85. new g_Menu[512]
  86.  
  87. new g_TimerMenu[] = "TimerMenu"
  88.  
  89. new g_TimerTask = TIMER_TASK
  90. new Float:g_TimerInterval = TIMER_INTERVAL
  91.  
  92. new g_HudObject
  93.  
  94. new g_SemiclipThinkerClassname[] = "usurf_semiclip"
  95. new g_SemiclipThinker
  96.  
  97. new g_Models[2][4] =
  98. {
  99. {_:CS_T_ARCTIC,_:CS_T_GUERILLA,_:CS_T_LEET,_:CS_T_TERROR},
  100. {_:CS_CT_GIGN,_:CS_CT_GSG9,_:CS_CT_SAS,_:CS_CT_URBAN}
  101. }
  102.  
  103. new g_SurfHelpMenu
  104.  
  105. public plugin_init()
  106. {
  107. new VERSION[] = "5.2"
  108.  
  109. register_plugin("uSurf",VERSION,"Hawk552")
  110. register_cvar("usurf_version", VERSION, FCVAR_SERVER)
  111.  
  112. new NewVersion[10]
  113. format(NewVersion,9,"usurf %s",VERSION)
  114. register_cvar("surf_base_version",NewVersion,FCVAR_SERVER)
  115.  
  116. // Global Commands / Cvars
  117. p_On = register_cvar("usurf_on","1")
  118.  
  119. //Auto Cvars
  120. p_AutoCvars = register_cvar("usurf_autocvars","1")
  121.  
  122. // Before we do ANYTHING, let's see if it's a surf map or not.
  123. CheckSurf()
  124.  
  125. if(get_pcvar_num(p_On))
  126. set_task(5.0,"ExecCvars")
  127.  
  128. // Surf Help
  129. register_clcmd("say /surfhelp","CmdSurfhelp")
  130. register_clcmd("say /help","CmdSurfhelp")
  131. p_Help = register_cvar("usurf_help","1")
  132. p_HelpInterval = register_cvar("usurf_help_interval","60.0")
  133. set_task(get_pcvar_float(p_HelpInterval),"ShowSurfHelp")
  134. g_SurfHelpMenu = menu_create("Surf Help","SurfHelpHandle")
  135. menu_additem(g_SurfHelpMenu,"Surfing Help")
  136. menu_additem(g_SurfHelpMenu,"uSurf Commands")
  137. menu_additem(g_SurfHelpMenu,"About uSurf")
  138.  
  139. // Checkpoints
  140. register_clcmd("say /checkpoint","CmdCheckpoint")
  141. register_clcmd("say /gocheck","CmdGoCheck")
  142. p_Cp = register_cvar("usurf_checkpoint","1")
  143. p_CpDelay = register_cvar("usurf_checkpoint_delay","20")
  144.  
  145. // extra stuff
  146. p_RemoveDropped = register_cvar("usurf_remove_dropped","1")
  147. p_RemoveButton = register_cvar("usurf_remove_button","1")
  148. p_NoGuns = register_cvar("usurf_noguns","0")
  149. p_SpawnDist = register_cvar("usurf_spawn_dist","500")
  150. p_Semiclip = register_cvar("usurf_semiclip","0")
  151. p_TeamStack = register_cvar("usurf_teamstack","0")
  152. p_Godmode = register_cvar("usurf_godmode","1")
  153.  
  154. // bunny hopping
  155. p_BunnyHop = register_cvar("usurf_bunnyhop","1")
  156. p_BunnyHopAutoJump = register_cvar("usurf_bunnyhop_autojump","1")
  157.  
  158. // timer
  159. p_Timer = register_cvar("usurf_timer","1")
  160. p_X = register_cvar("usurf_timer_x","0.8")
  161. p_Y = register_cvar("usurf_timer_y","-0.8")
  162. p_R = register_cvar("usurf_timer_r","0")
  163. p_G = register_cvar("usurf_timer_g","0")
  164. p_B = register_cvar("usurf_timer_b","255")
  165. register_clcmd("say /timer","CmdTimer")
  166. register_menucmd(register_menuid(g_TimerMenu),1023,"TimerHandle")
  167. register_menucmd(register_menuid("Team_Select",1),MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamHandle")
  168. register_clcmd("jointeam","TeamHandle")
  169. g_HudObject = CreateHudSyncObj()
  170. register_dictionary("time.txt")
  171.  
  172. register_forward(FM_SetModel,"ForwardSetModel")
  173. register_forward(FM_PlayerPreThink,"ForwardPlayerPreThink")
  174. register_forward(FM_Touch,"ForwardTouch")
  175. register_forward(FM_Think,"ForwardThink")
  176. register_forward(FM_TraceLine,"ForwardTraceLine",1)
  177. register_forward(FM_TraceHull,"ForwardTraceHull",1)
  178.  
  179. CheckSurf()
  180. CheckButton()
  181.  
  182. // Respawn
  183. p_Respawn = register_cvar("usurf_respawn","1")
  184. register_event("DeathMsg","EventDeathMsg","a")
  185. register_clcmd("say /respawn","CmdRespawn")
  186. set_task(1.0,"StandardTimer",_,_,_,"b")
  187.  
  188. new Ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))
  189. if(!Ent)
  190. return
  191.  
  192. set_pev(Ent,pev_classname,g_SemiclipThinkerClassname)
  193. new Float:Time
  194. global_get(glb_time,Time)
  195. set_pev(Ent,pev_nextthink,Time + 0.01)
  196. dllfunc(DLLFunc_Spawn,Ent)
  197.  
  198. g_SemiclipThinker = Ent
  199. }
  200.  
  201. public CheckSurf()
  202. {
  203. new MapName[32]
  204. get_mapname(MapName,31)
  205. if(containi(MapName,"surf") != -1 || containi(MapName,"wurf_") != -1 || equali(MapName,"tentical"))
  206. g_SurfMap = true
  207.  
  208. return PLUGIN_CONTINUE
  209. }
  210.  
  211. public ExecCvars()
  212. {
  213. if(get_pcvar_num(p_On) && get_pcvar_num(p_AutoCvars) && g_SurfMap)
  214. {
  215. new ConfigsDir[50],FileLocation[50]
  216. get_configsdir(ConfigsDir,49)
  217.  
  218. format(FileLocation,49,"%s/surf.cfg",ConfigsDir)
  219.  
  220. // I'm not going to update this, because the old file
  221. // natives are actually much easier to work with for
  222. // this purpose.
  223. if(file_exists(FileLocation))
  224. server_cmd("exec ^"%s^"",FileLocation)
  225. else
  226. {
  227. write_file(FileLocation,"sv_airaccelerate 100")
  228. write_file(FileLocation,"mp_freezetime 0")
  229. write_file(FileLocation,"amxx pause statsx.amxx")
  230. write_file(FileLocation,"amxx pause miscstats.amxx")
  231. write_file(FileLocation,"amxx pause stats_logging.amxx")
  232. // people seem to be stupid to fucking RTFM, so I really have to disable this by default
  233. write_file(FileLocation,"//humans_join_team ct // if you want all players on one team, use this")
  234. write_file(FileLocation,"echo Executing surf map config.",2)
  235. server_cmd("exec %s",FileLocation)
  236.  
  237. format(FileLocation,49,"%s/amxx.cfg",ConfigsDir)
  238. if(file_exists(FileLocation))
  239. {
  240. write_file(FileLocation,"// AUTO WRITTEN BY USURF")
  241. write_file(FileLocation,"^n^nhumans_join_team any")
  242. write_file(FileLocation,"sv_airaccelerate 10")
  243. }
  244. }
  245. }
  246. }
  247.  
  248. public client_disconnect(id)
  249. {
  250. g_Origin[id][0] = 0.0
  251.  
  252. g_Timing[id] = 0
  253. g_Time[id] = 0
  254. g_Timer[id] = 0
  255. g_LastSave[id] = 0.0
  256.  
  257. g_Origin[id] = Float:{0.0,0.0,0.0}
  258. }
  259.  
  260. public TeamHandle(id,Item)
  261. {
  262. // to prevent memory corruption
  263. new Key = Item
  264.  
  265. new Arg[2]
  266. read_argv(0,Arg,1)
  267.  
  268. if(Arg[0] == 'j')
  269. {
  270. read_argv(1,Arg,1)
  271. Key = str_to_num(Arg) - 1
  272. }
  273.  
  274. new TeamStack = get_pcvar_num(p_TeamStack)
  275. if(Key != 5 && Key != TeamStack - 1 && (TeamStack == _:CS_TEAM_T || TeamStack == _:CS_TEAM_CT))
  276. {
  277. client_print(id,print_center,"You must join the %s team.",TeamStack == 1 ? "Terrorist" : "Counter-Terrorist")
  278. engclient_cmd(id,"chooseteam")
  279.  
  280. return PLUGIN_HANDLED
  281. }
  282.  
  283. return PLUGIN_CONTINUE
  284. }
  285.  
  286. public CmdTimer(id)
  287. {
  288. if(!get_pcvar_num(p_Timer) || !get_pcvar_num(p_On) || !g_SurfMap)
  289. return
  290.  
  291. new Len = format(g_Menu,sizeof g_Menu - 1,"uSurf Timer Menu^n^n1. %s Timer^n",g_Timer[id] ? "Disable" : "Enable")
  292. if(g_Timer[id])
  293. Len += format(g_Menu[Len],sizeof g_Menu - Len - 1,"2. %s Timing^n3. Reset Timer^n",g_Timing[id] ? "Stop" : "Begin")
  294. format(g_Menu[Len],sizeof g_Menu - Len - 1,"^n0. Exit")
  295.  
  296. new Keys = g_Timer[id] ? MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_0 : MENU_KEY_1|MENU_KEY_0
  297.  
  298. show_menu(id,Keys,g_Menu,-1,g_TimerMenu)
  299. }
  300.  
  301. public TimerHandle(id,Key)
  302. {
  303. switch(Key)
  304. {
  305. case 0 :
  306. {
  307. g_Timer[id] = !g_Timer[id]
  308. if(!g_Timer[id])
  309. ShowSyncHudMsg(id,g_HudObject,"")
  310. }
  311. case 1 :
  312. {
  313. g_Timing[id] = !g_Timing[id]
  314. g_Timing[id] ? set_task(g_TimerInterval,"Timer",id + g_TimerTask) : remove_task(id + g_TimerTask)
  315. }
  316. case 2 :
  317. g_Time[id] = 0
  318. }
  319.  
  320. if(Key != 9)
  321. CmdTimer(id)
  322. }
  323.  
  324. public Timer(id)
  325. {
  326. g_Time[id - g_TimerTask] += floatround(g_TimerInterval)
  327.  
  328. set_task(g_TimerInterval,"Timer",id)
  329. }
  330.  
  331. public CmdSurfhelp(id)
  332. {
  333. if(!get_pcvar_num(p_On) || !get_pcvar_num(p_Help) || !g_SurfMap)
  334. return PLUGIN_CONTINUE
  335.  
  336. menu_display(id,g_SurfHelpMenu,0)
  337.  
  338. return PLUGIN_CONTINUE
  339. }
  340.  
  341. public SurfHelpHandle(id,Menu,Key)
  342. {
  343. static MOTD[4096], Title[16],Pos
  344.  
  345. switch(Key)
  346. {
  347. case 0 :
  348. {
  349. copy(Title,15,"Surf Help")
  350.  
  351. Pos = format(MOTD,sizeof MOTD - 1,"<style type=^"text/css^"><!--.sty1 {color: #CC9900;font-family: Arial, Helvetica, sans-serif;}--></style><body bgcolor=^"#000000^"><span class=^"sty1^"><strong><div align=^"center^">Surf Discipline</div></strong></span></p><table width=^"100%%^" border=^"1^"><table width=^"100%%^" border=^"1^">")
  352. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">To surf, jump or walk onto one of the curved walls (hereby referted to as 'ramps'). Then simply hold strafe (Default are the A and D keys). This will cause you to glide along the walls, or &quot;surf&quot;. </span></td></tr>")
  353. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">While surfing, never press up, down, or crouch; pressing those will cause you to slide off the wall and fall, which, in most surf maps, will cause you to get sent back to your spawn. </span></td></tr>")
  354. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">To change direction (in order to make it to the next ramp), press the button for the direction you wish to go before flying off of your current ramp.</span></td></tr>")
  355. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">Surfing takes pratice, so don't be discouraged if you don't get it right the first time.</span></td></tr>")
  356. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"</table><p align=^"center^"><span class=^"sty1^"><strong>Powered by uSurf</strong></span></p></body></html>")
  357. }
  358. case 1 :
  359. {
  360. copy(Title,15,"uSurf Commands")
  361.  
  362. Pos = format(MOTD,sizeof MOTD - 1,"<style type=^"text/css^"><!--.sty1 {color: #CC9900;font-family: Arial, Helvetica, sans-serif;}--></style>")
  363. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<body bgcolor=^"#000000^"><strong><span class=^"sty1^"><div align=^"center^"><p>uSurf Commands</strong></p></span></div><table width=^"100%%^" border=^"1^">")
  364. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /surfhelp</span></td><td><span class=^"sty1^">Brings up this window.</span>/td></tr>")
  365. if(get_pcvar_num(p_Respawn))
  366. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /respawn</span></td><td><span class=^"sty1^">Sends you back to your spawn, or, in the event of a malfunction, allows you to respawn yourself manually.</span></td></tr>")
  367. if(get_pcvar_num(p_Cp))
  368. {
  369. new Cvar = get_pcvar_num(p_CpDelay)
  370. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /checkpoint</span></td><td><span class=^"sty1^">Saves a checkpoint at your current location. Use &quot;say /gocheck&quot; to go to it. You can save or load a checkpoint every %d seconds.</span></td></tr>",Cvar)
  371. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /gocheck</span></td><td><span class=^"sty1^">Allows you to go to one of your saved checkpoints. You can save or load a checkpoint every %d seconds.</span></td></tr>",Cvar)
  372. }
  373. if(get_pcvar_num(p_Timer))
  374. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /timer</span></td><td><span class=^"sty1^">Brings up a menu with various timer options, allowing you to time various events.</span></td></tr>")
  375. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"</table><p align=^"center^"><span class=^"sty1^"><strong>Powered by uSurf</strong></span></p></body></html>")
  376. }
  377. case 2 :
  378. {
  379. copy(Title,15,"About uSurf")
  380.  
  381. Pos = format(MOTD,sizeof MOTD - 1,"<style type=^"text/css^"><!--.sty1 {color: #CC9900;font-family: Arial, Helvetica, sans-serif;}--></style>")
  382. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<body bgcolor=^"#000000^"><strong><span class=^"sty1^"><div align=^"center^">About uSurf</span></strong></div>")
  383. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<span class=^"sty1^"><p>This plugin is designed to manage surf servers. It is the successor to Surf Management / Tools.</p>")
  384. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<p>For more information or to download this plugin, go <a href=^"http://forums.alliedmods.net/showthread.php?t=16418^">here</a> (<a href=^"http://forums.alliedmods.net/showthread.php?t=16418^">http://forums.alliedmods.net/showthread.php?t=16418</a>)</p>")
  385. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"</span><p align=^"center^"><span class=^"sty1^"><strong>Powered by uSurf</strong></span></p></body></html")
  386. }
  387. default :
  388. return
  389. }
  390.  
  391. show_motd(id,MOTD,Title)
  392. menu_display(id,g_SurfHelpMenu,0)
  393. }
  394.  
  395. public ShowSurfHelp()
  396. {
  397. if(g_SurfMap && get_pcvar_num(p_Help) && get_pcvar_num(p_On))
  398. client_print(0,print_chat,"[USURF] Need help surfing? Say /surfhelp")
  399.  
  400. set_task(get_pcvar_float(p_HelpInterval),"ShowSurfHelp")
  401. }
  402.  
  403. public CmdCheckpoint(id)
  404. {
  405. if(!get_pcvar_num(p_Cp) || !get_pcvar_num(p_On) || !g_SurfMap)
  406. return PLUGIN_HANDLED
  407.  
  408. new Float:Time,Float:Delay = get_pcvar_float(p_CpDelay)
  409. global_get(glb_time,Time)
  410.  
  411. new Float:TimePassed = Time - g_LastSave[id]
  412.  
  413. if(TimePassed < Delay)
  414. {
  415. client_print(id,print_chat,"[USURF] You must wait %d seconds before saving again.",floatround(Delay - TimePassed))
  416. return PLUGIN_HANDLED
  417. }
  418.  
  419. pev(id,pev_origin,g_Origin[id])
  420. if(pev(id,pev_button) & IN_DUCK)
  421. g_Origin[id][2] += 24.0
  422. pev(id,pev_velocity,g_Velocity[id])
  423. pev(id,pev_angles,g_Angles[id])
  424. g_LastSave[id] = Time
  425.  
  426. client_print(id,print_chat,"[USURF] You have saved this checkpoint.")
  427.  
  428. return PLUGIN_HANDLED
  429. }
  430.  
  431. public CmdGoCheck(id)
  432. {
  433. if(!get_pcvar_num(p_Cp) || !get_pcvar_num(p_On) || !g_SurfMap)
  434. return PLUGIN_HANDLED
  435.  
  436. if(!g_Origin[id][0])
  437. {
  438. client_print(id,print_chat,"[USURF] You have not saved a checkpoint.")
  439. return PLUGIN_HANDLED
  440. }
  441.  
  442. new Float:Time,Float:Delay = get_pcvar_float(p_CpDelay)
  443. global_get(glb_time,Time)
  444.  
  445. new Float:TimePassed = Time - g_LastSave[id]
  446.  
  447. if(TimePassed < Delay)
  448. {
  449. client_print(id,print_chat,"[USURF] You must wait %d seconds before going to a checkpoint.",floatround(Delay - TimePassed))
  450. return PLUGIN_HANDLED
  451. }
  452.  
  453. engfunc(EngFunc_SetOrigin,id,g_Origin[id])
  454. set_pev(id,pev_velocity,g_Velocity[id])
  455. set_pev(id,pev_fixangle,1)
  456. set_pev(id,pev_angles,g_Angles[id])
  457. g_LastSave[id] = Time
  458.  
  459. client_print(id,print_chat,"[USURF] You have gone to your last checkpoint.")
  460.  
  461. return PLUGIN_HANDLED
  462. }
  463.  
  464. public CmdRespawn(id)
  465. {
  466. new CsTeams:Team = cs_get_user_team(id)
  467.  
  468. if(!get_pcvar_num(p_On))
  469. return client_print(id,print_chat,"[USURF] Sorry, the surf plugin is currently disabled.")
  470. else if(!get_pcvar_num(p_Respawn))
  471. return client_print(id,print_chat,"[USURF] Respawning is currently disabled.")
  472. else if(!g_SurfMap)
  473. return client_print(id,print_chat,"[USURF] This is not a surf map.")
  474.  
  475. if(Team == CS_TEAM_T || Team == CS_TEAM_CT)
  476. set_task(0.5,"Spawn",id)
  477. else
  478. return client_print(id,print_chat,"[USURF] You must be on a team to respawn.")
  479.  
  480. client_print(id,print_chat,is_user_alive(id) ? "[USURF] You have been sent back to your spawn." : "[USURF] You have been respawned.")
  481.  
  482. return PLUGIN_CONTINUE
  483. }
  484.  
  485. public StandardTimer()
  486. {
  487. if(!get_pcvar_num(p_On) || !g_SurfMap)
  488. return
  489.  
  490. static Players[32],Playersnum,Player,CsTeams:Team
  491.  
  492. new TeamStack = get_pcvar_num(p_TeamStack)
  493. if(TeamStack == _:CS_TEAM_CT || TeamStack == _:CS_TEAM_T)
  494. {
  495. get_players(Players,Playersnum)
  496.  
  497. for(new Count;Count < Playersnum;Count++)
  498. {
  499. Player = Players[Count]
  500.  
  501. Team = cs_get_user_team(Player)
  502. if(_:Team != TeamStack && (Team == CS_TEAM_T || Team == CS_TEAM_CT))
  503. cs_set_user_team(Player,CsTeams:TeamStack,CsInternalModel:g_Models[TeamStack - 1][random_num(0,3)])
  504. }
  505. }
  506.  
  507. if(!get_pcvar_num(p_Respawn))
  508. return
  509.  
  510. get_players(Players,Playersnum,"b")
  511.  
  512. for(new Count = 0;Count < Playersnum;Count++)
  513. {
  514. Player = Players[Count]
  515. Team = cs_get_user_team(Player)
  516.  
  517. if(Team == CS_TEAM_T || Team == CS_TEAM_CT)
  518. Spawn(Player)
  519. }
  520. }
  521.  
  522. public EventDeathMsg()
  523. {
  524. new id = read_data(2)
  525. set_task(0.5,"Spawn",id)
  526.  
  527. global_get(glb_time,g_LastSave[id])
  528. g_LastSave[id] -= get_pcvar_num(p_CpDelay)
  529. }
  530.  
  531. public Spawn(id)
  532. {
  533. new CsTeams:Team = cs_get_user_team(id)
  534.  
  535. if(is_user_connected(id) && (Team == CS_TEAM_T || Team == CS_TEAM_CT) && get_pcvar_num(p_On) && get_pcvar_num(p_Respawn) && g_SurfMap)
  536. {
  537. dllfunc(DLLFunc_Spawn,id)
  538. set_task(0.2,"GiveSuit",id)
  539. set_task(0.3,"GiveItems",id)
  540. }
  541. }
  542.  
  543. public GiveSuit(id)
  544. fm_give_item(id,"item_suit")
  545.  
  546. public GiveItems(id)
  547. {
  548. fm_give_item(id,"weapon_knife")
  549. fm_give_item(id,"weapon_scout")
  550. }
  551.  
  552. // no, VEN did not write this, I did (although I found out later that he wrote something like it)
  553. fm_give_item(id,Item[])
  554. {
  555. if(containi(Item,"item_") == -1 && containi(Item,"weapon_") == -1 && containi(Item,"ammo_") == -1 && containi(Item,"tf_weapon_") == -1)
  556. return
  557.  
  558. new Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, Item)),Float:vOrigin[3]
  559.  
  560. if(!pev_valid(Ent))
  561. return
  562.  
  563. pev(id,pev_origin,vOrigin)
  564. set_pev(Ent,pev_origin,vOrigin)
  565.  
  566. set_pev(Ent,pev_spawnflags,pev(Ent,pev_spawnflags)|(1<<30))
  567.  
  568. dllfunc(DLLFunc_Spawn,Ent)
  569.  
  570. new Solid = pev(Ent,pev_solid)
  571.  
  572. dllfunc(DLLFunc_Touch,Ent,id)
  573.  
  574. if(pev(Ent,pev_solid) == Solid)
  575. engfunc(EngFunc_RemoveEntity,Ent)
  576. }
  577.  
  578. CheckButton()
  579. if(get_pcvar_num(p_RemoveButton) && get_pcvar_num(p_On) && g_SurfMap)
  580. {
  581. new Ent,Value[] = "classname",ClassName[] = "env_explosion"
  582. while((Ent = engfunc(EngFunc_FindEntityByString,Ent,Value,ClassName)) != 0)
  583. if(pev_valid(Ent))
  584. set_pev(Ent,pev_flags,pev(Ent,pev_flags)|FL_KILLME)
  585. }
  586.  
  587. public ForwardPlayerPreThink(id)
  588. {
  589. if(!is_user_alive(id) || !get_pcvar_num(p_On) || !g_SurfMap)
  590. return
  591.  
  592. new NoGuns = get_pcvar_num(p_NoGuns)
  593.  
  594. if(NoGuns == 1)
  595. {
  596. new SpawnDistance = get_pcvar_num(p_SpawnDist)
  597.  
  598. static Float:vOrigin[3]
  599. pev(id,pev_origin,vOrigin)
  600.  
  601. new DeathMatch = engfunc(EngFunc_FindEntityByString,-1,"classname","info_player_deathmatch")
  602. new PlayerStart = engfunc(EngFunc_FindEntityByString,-1,"classname","info_player_start")
  603.  
  604. if(DeathMatch && PlayerStart)
  605. {
  606. static Float:vDeathMatch_Origin[3]
  607. pev(DeathMatch,pev_origin,vDeathMatch_Origin)
  608.  
  609. static Float:vPlayerStart_Origin[3]
  610. pev(PlayerStart,pev_origin,vPlayerStart_Origin)
  611.  
  612. new Float:DeathMatch_Distance = get_distance_f(vOrigin,vDeathMatch_Origin)
  613. new Float:PlayerStart_Distance = get_distance_f(vOrigin,vPlayerStart_Origin)
  614.  
  615. new Clip,Ammo,Weapon = get_user_weapon(id,Clip,Ammo)
  616.  
  617. if(DeathMatch_Distance < SpawnDistance || PlayerStart_Distance < SpawnDistance)
  618. {
  619. if(Weapon != CSW_KNIFE && Weapon != CSW_C4 && Weapon != CSW_HEGRENADE && Weapon != CSW_FLASHBANG && Weapon != CSW_SMOKEGRENADE)
  620. client_cmd(id,"drop")
  621. } // Argh, stupid thing doesn't understand this if I don't add the brackets.
  622. else if(DeathMatch_Distance > SpawnDistance || PlayerStart_Distance > SpawnDistance)
  623. if(!user_has_weapon(id,CSW_SCOUT))
  624. fm_give_item(id,"weapon_scout")
  625. }
  626. }
  627. else if(NoGuns == 2)
  628. {
  629. new Clip, Ammo, Weapon = get_user_weapon(id,Clip,Ammo)
  630.  
  631. if(Weapon != CSW_KNIFE && Weapon != CSW_C4 && Weapon != CSW_HEGRENADE && Weapon != CSW_FLASHBANG && Weapon != CSW_SMOKEGRENADE)
  632. client_cmd(id,"drop")
  633. }
  634. else if(NoGuns == 3)
  635. {
  636. new Clip, Ammo, Weapon = get_user_weapon(id,Clip,Ammo)
  637.  
  638. if(Weapon != CSW_KNIFE && Weapon != CSW_C4)
  639. {
  640. fm_strip_user_weapons(id)
  641. fm_give_item(id,"weapon_knife")
  642. }
  643. }
  644.  
  645. if(get_pcvar_num(p_BunnyHop))
  646. {
  647. set_pev(id,pev_fuser2,0.0)
  648.  
  649. if(get_pcvar_num(p_BunnyHopAutoJump) && pev(id,pev_button) & IN_JUMP)
  650. {
  651. new Flags = pev(id,pev_flags)
  652. if(!(Flags & FL_WATERJUMP) && pev(id,pev_waterlevel) < 2 && Flags & FL_ONGROUND)
  653. {
  654. new Float:Velocity[3]
  655. pev(id,pev_velocity,Velocity)
  656. Velocity[2] += 250.0
  657. set_pev(id,pev_velocity,Velocity)
  658.  
  659. set_pev(id,pev_gaitsequence,6)
  660. }
  661. }
  662. }
  663.  
  664. if(get_pcvar_num(p_Timer) && g_Timer[id])
  665. {
  666. static Time[33]
  667.  
  668. set_hudmessage(get_pcvar_num(p_R),get_pcvar_num(p_G),get_pcvar_num(p_B),get_pcvar_float(p_X),get_pcvar_float(p_Y),0,0.0,6.0,0.0,0.0,-1)
  669. get_time_length(id,g_Time[id],timeunit_seconds,Time,32)
  670. ShowSyncHudMsg(id,g_HudObject,"Timer: %s",Time)
  671. }
  672. }
  673.  
  674. public ForwardSetModel(id,Model[])
  675. {
  676. if(!pev_valid(id) || !g_SurfMap || !get_pcvar_num(p_On) || !strlen(Model) || !get_pcvar_num(p_RemoveDropped))
  677. return
  678.  
  679. static ClassName[33]
  680. pev(id,pev_classname,ClassName,32)
  681.  
  682. if(equali(ClassName,"weaponbox"))
  683. set_task(0.1,"RemoveGun",id)
  684. }
  685.  
  686. public RemoveGun(id)
  687. if(pev_valid(id))
  688. engfunc(EngFunc_RemoveEntity,id)
  689.  
  690. public ForwardTouch(Ptr,Ptd)
  691. {
  692. if(!pev_valid(Ptr) || !pev_valid(Ptd) || !g_SurfMap || !get_pcvar_num(p_On) || !get_pcvar_num(p_Respawn))
  693. return FMRES_IGNORED
  694.  
  695. new id
  696. if(is_user_alive(Ptr))
  697. id = Ptr
  698. else if(is_user_alive(Ptd))
  699. id = Ptd
  700.  
  701. if(!id)
  702. return FMRES_IGNORED
  703.  
  704. static Classname[33]
  705. pev(id == Ptr ? Ptd : Ptr,pev_classname,Classname,32)
  706. if(equali(Classname,"trigger_hurt"))
  707. {
  708. Spawn(id)
  709. return FMRES_SUPERCEDE
  710. }
  711.  
  712. return FMRES_IGNORED
  713. }
  714.  
  715. public ForwardThink(Ent)
  716. {
  717. if(Ent != g_SemiclipThinker || !g_SurfMap)
  718. return
  719.  
  720. if(get_pcvar_num(p_Semiclip) && get_pcvar_num(p_On))
  721. {
  722. static Players[32],Playersnum,Player
  723. get_players(Players,Playersnum)
  724.  
  725. for(new Count;Count < Playersnum;Count++)
  726. {
  727. Player = Players[Count]
  728. if(!is_user_alive(Player))
  729. continue
  730.  
  731. set_pev(Player,pev_solid,IsColliding(Player) ? SOLID_NOT : SOLID_BBOX)
  732. }
  733. }
  734.  
  735. new Float:Time
  736. global_get(glb_time,Time)
  737. set_pev(Ent,pev_nextthink,Time + 0.01)
  738. }
  739.  
  740. public ForwardTraceLine(Float:v1[3],Float:v2[3],EntToSkip,NoMonsters,TR)
  741. {
  742. if(!get_pcvar_num(p_Godmode) || !g_SurfMap || !get_pcvar_num(p_On))
  743. return FMRES_IGNORED
  744.  
  745. new id = get_tr(TR_pHit)
  746. if(!is_user_alive(id))
  747. return FMRES_IGNORED
  748.  
  749. new Attacker
  750. while((Attacker = engfunc(EngFunc_FindEntityInSphere,Attacker,v1,10.0)) != 0)
  751. if(Attacker < 33 && Attacker > 0)
  752. break
  753.  
  754. if(!is_user_alive(Attacker))
  755. return FMRES_IGNORED
  756.  
  757. new Button = pev(Attacker,pev_button)
  758. if(!(Button & IN_ATTACK) && !(Button & IN_ATTACK2))
  759. return FMRES_IGNORED
  760.  
  761. set_tr(TR_flFraction,1.0)
  762.  
  763. return FMRES_IGNORED
  764. }
  765.  
  766. public ForwardTraceHull(Float:v1[3],Float:v2[3],NoMonsters,Hull,EntToSkip,TR)
  767. {
  768. if(!g_SurfMap || !get_pcvar_num(p_On) || !get_pcvar_num(p_Godmode))
  769. return FMRES_IGNORED
  770.  
  771. new Button = pev(EntToSkip,pev_button)
  772. if(!(Button & IN_ATTACK) && !(Button & IN_ATTACK2))
  773. return FMRES_IGNORED
  774.  
  775. set_tr(TR_flFraction,1.0)
  776.  
  777. return FMRES_IGNORED
  778. }
  779.  
  780. // thanks to VEN for this stock from Fakemeta Utilities
  781. fm_strip_user_weapons(index) {
  782. new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip"))
  783. if (!pev_valid(ent))
  784. return 0
  785.  
  786. dllfunc(DLLFunc_Spawn, ent)
  787. dllfunc(DLLFunc_Use, ent, index)
  788.  
  789. engfunc(EngFunc_RemoveEntity, ent)
  790.  
  791. return 1
  792. }
  793.  
  794. IsColliding(id)
  795. {
  796. if(pev(id,pev_flags) & FL_ONGROUND || pev(id,pev_button) & IN_JUMP)
  797. return false
  798.  
  799. new Ent,Float:Origin[3]
  800. pev(id,pev_origin,Origin)
  801.  
  802. while((Ent = engfunc(EngFunc_FindEntityInSphere,Ent,Origin,36.0)) != 0)
  803. if(Ent > 0 && Ent <= 32 && is_user_alive(Ent) && Ent != id)
  804. return true
  805.  
  806. return false
  807. }
  808.  

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: U surf
HozzászólásElküldve: 2013.06.19. 19:50 
Offline
Veterán
Avatar

Csatlakozott: 2012.09.01. 22:19
Hozzászólások: 1697
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 302 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2.  
  3. Copyleft 2007
  4.  
  5. USURF
  6. =====
  7.  
  8. Description
  9. This mod is designed to assist in the running of a surf server. It
  10. includes many features, such as surfing help, semiclip, checkpoints,
  11. "BOOM" button removal and many more features.
  12.  
  13. Was previously known as "Surf Management / Tools"
  14.  
  15. Changelog:
  16.  
  17. March 4, 2007 - v5.0 - Renamed and fixed major bugs
  18. March 13, 2007 - v5.1 - [FEATURE] Added timer
  19. [FEATURE] Added bunnyhop
  20. [FEATURE] Added team stack
  21. [FEATURE] Added godmode
  22. [BUG] Improved semiclip
  23. [BUG] Fixed crashing on Linux servers
  24. [BUG] Fixed crouching with checkpoints
  25. [BUG] Fixed respawn to send people back
  26. to their spawns rather than killing them
  27. March 16, 2007 - v5.2 - [FEATURE] Cleaned up the /surfhelp MOTD display
  28. [FEATURE] Added menu to /surfhelp
  29. [BUG] Fixed surf help showing more than once
  30. [BUG] Optimized surf help section
  31. [BUG] Added new commands to /surfhelp display
  32. [BUG] Removed some old semiclip code that was
  33. causing problems only for people on the same team
  34. [BUG] Fixed checkpoints and timers working on
  35. non-surf maps
  36.  
  37. Credits:
  38. XxAvalanchexX - Post about blocking knife hits
  39.  
  40. */
  41.  
  42. #include <amxmodx>
  43. #include <amxmisc>
  44. #include <fakemeta>
  45. #include <cstrike>
  46. #include <time>
  47.  
  48. #define TIMER_TASK 23981293
  49. #define TIMER_INTERVAL 1.0
  50.  
  51. new p_On
  52. new p_AutoCvars
  53. new p_Help
  54. new p_HelpInterval
  55. new p_Respawn
  56. new p_RemoveDropped
  57. new p_RemoveButton
  58. new p_NoGuns
  59. new p_SpawnDist
  60. new p_Semiclip
  61. new p_Cp
  62. new p_CpDelay
  63. new p_BunnyHop
  64. new p_BunnyHopAutoJump
  65. new p_Timer
  66. new p_X
  67. new p_Y
  68. new p_R
  69. new p_G
  70. new p_B
  71. new p_TeamStack
  72. new p_Godmode
  73.  
  74. new bool:g_SurfMap
  75.  
  76. new Float:g_Origin[33][3]
  77. new Float:g_Velocity[33][3]
  78. new Float:g_Angles[33][3]
  79. new Float:g_LastSave[33]
  80.  
  81. new g_Time[33]
  82. new g_Timing[33]
  83. new g_Timer[33]
  84.  
  85. new g_Menu[512]
  86.  
  87. new g_TimerMenu[] = "TimerMenu"
  88.  
  89. new g_TimerTask = TIMER_TASK
  90. new Float:g_TimerInterval = TIMER_INTERVAL
  91.  
  92. new g_HudObject
  93.  
  94. new g_SemiclipThinkerClassname[] = "usurf_semiclip"
  95. new g_SemiclipThinker
  96.  
  97. new g_Models[2][4] =
  98. {
  99. {_:CS_T_ARCTIC,_:CS_T_GUERILLA,_:CS_T_LEET,_:CS_T_TERROR},
  100. {_:CS_CT_GIGN,_:CS_CT_GSG9,_:CS_CT_SAS,_:CS_CT_URBAN}
  101. }
  102.  
  103. new g_SurfHelpMenu
  104.  
  105. public plugin_init()
  106. {
  107. new VERSION[] = "5.2"
  108.  
  109. register_plugin("uSurf",VERSION,"Hawk552")
  110. register_cvar("usurf_version", VERSION, FCVAR_SERVER)
  111.  
  112. new NewVersion[10]
  113. format(NewVersion,9,"usurf %s",VERSION)
  114. register_cvar("surf_base_version",NewVersion,FCVAR_SERVER)
  115.  
  116. // Global Commands / Cvars
  117. p_On = register_cvar("usurf_on","1")
  118.  
  119. //Auto Cvars
  120. p_AutoCvars = register_cvar("usurf_autocvars","1")
  121.  
  122. // Before we do ANYTHING, let's see if it's a surf map or not.
  123. CheckSurf()
  124.  
  125. if(get_pcvar_num(p_On))
  126. set_task(5.0,"ExecCvars")
  127.  
  128. // Surf Help
  129. register_clcmd("say /surfhelp","CmdSurfhelp")
  130. register_clcmd("say /help","CmdSurfhelp")
  131. p_Help = register_cvar("usurf_help","1")
  132. p_HelpInterval = register_cvar("usurf_help_interval","60.0")
  133. set_task(get_pcvar_float(p_HelpInterval),"ShowSurfHelp")
  134. g_SurfHelpMenu = menu_create("Surf Help","SurfHelpHandle")
  135. menu_additem(g_SurfHelpMenu,"Surfing Help")
  136. menu_additem(g_SurfHelpMenu,"uSurf Commands")
  137. menu_additem(g_SurfHelpMenu,"About uSurf")
  138.  
  139. // Checkpoints
  140. register_clcmd("say /checkpoint","CmdCheckpoint")
  141. register_clcmd("say /gocheck","CmdGoCheck")
  142. p_Cp = register_cvar("usurf_checkpoint","1")
  143. p_CpDelay = register_cvar("usurf_checkpoint_delay","20")
  144.  
  145. // extra stuff
  146. p_RemoveDropped = register_cvar("usurf_remove_dropped","1")
  147. p_RemoveButton = register_cvar("usurf_remove_button","1")
  148. p_NoGuns = register_cvar("usurf_noguns","0")
  149. p_SpawnDist = register_cvar("usurf_spawn_dist","500")
  150. p_Semiclip = register_cvar("usurf_semiclip","0")
  151. p_TeamStack = register_cvar("usurf_teamstack","0")
  152. p_Godmode = register_cvar("usurf_godmode","1")
  153.  
  154. // bunny hopping
  155. p_BunnyHop = register_cvar("usurf_bunnyhop","1")
  156. p_BunnyHopAutoJump = register_cvar("usurf_bunnyhop_autojump","1")
  157.  
  158. // timer
  159. p_Timer = register_cvar("usurf_timer","1")
  160. p_X = register_cvar("usurf_timer_x","0.8")
  161. p_Y = register_cvar("usurf_timer_y","-0.8")
  162. p_R = register_cvar("usurf_timer_r","0")
  163. p_G = register_cvar("usurf_timer_g","0")
  164. p_B = register_cvar("usurf_timer_b","255")
  165. register_clcmd("say /timer","CmdTimer")
  166. register_menucmd(register_menuid(g_TimerMenu),1023,"TimerHandle")
  167. register_menucmd(register_menuid("Team_Select",1),MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"TeamHandle")
  168. register_clcmd("jointeam","TeamHandle")
  169. g_HudObject = CreateHudSyncObj()
  170. register_dictionary("time.txt")
  171.  
  172. register_forward(FM_SetModel,"ForwardSetModel")
  173. register_forward(FM_PlayerPreThink,"ForwardPlayerPreThink")
  174. register_forward(FM_Touch,"ForwardTouch")
  175. register_forward(FM_Think,"ForwardThink")
  176. register_forward(FM_TraceLine,"ForwardTraceLine",1)
  177. register_forward(FM_TraceHull,"ForwardTraceHull",1)
  178.  
  179. CheckSurf()
  180. CheckButton()
  181.  
  182. // Respawn
  183. p_Respawn = register_cvar("usurf_respawn","1")
  184. register_event("DeathMsg","EventDeathMsg","a")
  185. register_clcmd("say /respawn","CmdRespawn")
  186. set_task(1.0,"StandardTimer",_,_,_,"b")
  187.  
  188. new Ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))
  189. if(!Ent)
  190. return
  191.  
  192. set_pev(Ent,pev_classname,g_SemiclipThinkerClassname)
  193. new Float:Time
  194. global_get(glb_time,Time)
  195. set_pev(Ent,pev_nextthink,Time + 0.01)
  196. dllfunc(DLLFunc_Spawn,Ent)
  197.  
  198. g_SemiclipThinker = Ent
  199. }
  200.  
  201. public CheckSurf()
  202. {
  203. new MapName[32]
  204. get_mapname(MapName,31)
  205. if(containi(MapName,"surf") != -1 || containi(MapName,"wurf_") != -1 || equali(MapName,"tentical"))
  206. g_SurfMap = true
  207.  
  208. return PLUGIN_CONTINUE
  209. }
  210.  
  211. public ExecCvars()
  212. {
  213. if(get_pcvar_num(p_On) && get_pcvar_num(p_AutoCvars) && g_SurfMap)
  214. {
  215. new ConfigsDir[50],FileLocation[50]
  216. get_configsdir(ConfigsDir,49)
  217.  
  218. format(FileLocation,49,"%s/surf.cfg",ConfigsDir)
  219.  
  220. // I'm not going to update this, because the old file
  221. // natives are actually much easier to work with for
  222. // this purpose.
  223. if(file_exists(FileLocation))
  224. server_cmd("exec ^"%s^"",FileLocation)
  225. else
  226. {
  227. write_file(FileLocation,"sv_airaccelerate 100")
  228. write_file(FileLocation,"mp_freezetime 0")
  229. write_file(FileLocation,"amxx pause statsx.amxx")
  230. write_file(FileLocation,"amxx pause miscstats.amxx")
  231. write_file(FileLocation,"amxx pause stats_logging.amxx")
  232. // people seem to be stupid to fucking RTFM, so I really have to disable this by default
  233. write_file(FileLocation,"//humans_join_team ct // if you want all players on one team, use this")
  234. write_file(FileLocation,"echo Executing surf map config.",2)
  235. server_cmd("exec %s",FileLocation)
  236.  
  237. format(FileLocation,49,"%s/amxx.cfg",ConfigsDir)
  238. if(file_exists(FileLocation))
  239. {
  240. write_file(FileLocation,"// AUTO WRITTEN BY USURF")
  241. write_file(FileLocation,"^n^nhumans_join_team any")
  242. write_file(FileLocation,"sv_airaccelerate 10")
  243. }
  244. }
  245. }
  246. }
  247.  
  248. public client_disconnect(id)
  249. {
  250. g_Origin[id][0] = 0.0
  251.  
  252. g_Timing[id] = 0
  253. g_Time[id] = 0
  254. g_Timer[id] = 0
  255. g_LastSave[id] = 0.0
  256.  
  257. g_Origin[id] = Float:{0.0,0.0,0.0}
  258. }
  259.  
  260. public TeamHandle(id,Item)
  261. {
  262. // to prevent memory corruption
  263. new Key = Item
  264.  
  265. new Arg[2]
  266. read_argv(0,Arg,1)
  267.  
  268. if(Arg[0] == 'j')
  269. {
  270. read_argv(1,Arg,1)
  271. Key = str_to_num(Arg) - 1
  272. }
  273.  
  274. new TeamStack = get_pcvar_num(p_TeamStack)
  275. if(Key != 5 && Key != TeamStack - 1 && (TeamStack == _:CS_TEAM_T || TeamStack == _:CS_TEAM_CT))
  276. {
  277. client_print(id,print_center,"Csak a %s csapatba csatlakozhatsz.",TeamStack == 1 ? "Terrorista" : "Counter-Terrorista")
  278. engclient_cmd(id,"chooseteam")
  279.  
  280. return PLUGIN_HANDLED
  281. }
  282.  
  283. return PLUGIN_CONTINUE
  284. }
  285.  
  286. public CmdTimer(id)
  287. {
  288. if(!get_pcvar_num(p_Timer) || !get_pcvar_num(p_On) || !g_SurfMap)
  289. return
  290.  
  291. new Len = format(g_Menu,sizeof g_Menu - 1,"uSurf Idozito Menu^n^n1. %s Idozito^n",g_Timer[id] ? "Ki" : "Be")
  292. if(g_Timer[id])
  293. Len += format(g_Menu[Len],sizeof g_Menu - Len - 1,"2. %s Idozites^n3. Idozito Ujrainditas^n",g_Timing[id] ? "Megallitas" : "Folytatas")
  294. format(g_Menu[Len],sizeof g_Menu - Len - 1,"^n0. Kilepes")
  295.  
  296. new Keys = g_Timer[id] ? MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_0 : MENU_KEY_1|MENU_KEY_0
  297.  
  298. show_menu(id,Keys,g_Menu,-1,g_TimerMenu)
  299. }
  300.  
  301. public TimerHandle(id,Key)
  302. {
  303. switch(Key)
  304. {
  305. case 0 :
  306. {
  307. g_Timer[id] = !g_Timer[id]
  308. if(!g_Timer[id])
  309. ShowSyncHudMsg(id,g_HudObject,"")
  310. }
  311. case 1 :
  312. {
  313. g_Timing[id] = !g_Timing[id]
  314. g_Timing[id] ? set_task(g_TimerInterval,"Timer",id + g_TimerTask) : remove_task(id + g_TimerTask)
  315. }
  316. case 2 :
  317. g_Time[id] = 0
  318. }
  319.  
  320. if(Key != 9)
  321. CmdTimer(id)
  322. }
  323.  
  324. public Timer(id)
  325. {
  326. g_Time[id - g_TimerTask] += floatround(g_TimerInterval)
  327.  
  328. set_task(g_TimerInterval,"Timer",id)
  329. }
  330.  
  331. public CmdSurfhelp(id)
  332. {
  333. if(!get_pcvar_num(p_On) || !get_pcvar_num(p_Help) || !g_SurfMap)
  334. return PLUGIN_CONTINUE
  335.  
  336. menu_display(id,g_SurfHelpMenu,0)
  337.  
  338. return PLUGIN_CONTINUE
  339. }
  340.  
  341. public SurfHelpHandle(id,Menu,Key)
  342. {
  343. static MOTD[4096], Title[16],Pos
  344.  
  345. switch(Key)
  346. {
  347. case 0 :
  348. {
  349. copy(Title,15,"Surf Help")
  350.  
  351. Pos = format(MOTD,sizeof MOTD - 1,"<style type=^"text/css^"><!--.sty1 {color: #CC9900;font-family: Arial, Helvetica, sans-serif;}--></style><body bgcolor=^"#000000^"><span class=^"sty1^"><strong><div align=^"center^">Surf Discipline</div></strong></span></p><table width=^"100%%^" border=^"1^"><table width=^"100%%^" border=^"1^">")
  352. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">To surf, jump or walk onto one of the curved walls (hereby referted to as 'ramps'). Then simply hold strafe (Default are the A and D keys). This will cause you to glide along the walls, or &quot;surf&quot;. </span></td></tr>")
  353. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">While surfing, never press up, down, or crouch; pressing those will cause you to slide off the wall and fall, which, in most surf maps, will cause you to get sent back to your spawn. </span></td></tr>")
  354. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">To change direction (in order to make it to the next ramp), press the button for the direction you wish to go before flying off of your current ramp.</span></td></tr>")
  355. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">Surfing takes pratice, so don't be discouraged if you don't get it right the first time.</span></td></tr>")
  356. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"</table><p align=^"center^"><span class=^"sty1^"><strong>Powered by uSurf</strong></span></p></body></html>")
  357. }
  358. case 1 :
  359. {
  360. copy(Title,15,"uSurf Commands")
  361.  
  362. Pos = format(MOTD,sizeof MOTD - 1,"<style type=^"text/css^"><!--.sty1 {color: #CC9900;font-family: Arial, Helvetica, sans-serif;}--></style>")
  363. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<body bgcolor=^"#000000^"><strong><span class=^"sty1^"><div align=^"center^"><p>uSurf Commands</strong></p></span></div><table width=^"100%%^" border=^"1^">")
  364. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /surfhelp</span></td><td><span class=^"sty1^">Brings up this window.</span>/td></tr>")
  365. if(get_pcvar_num(p_Respawn))
  366. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /respawn</span></td><td><span class=^"sty1^">Sends you back to your spawn, or, in the event of a malfunction, allows you to respawn yourself manually.</span></td></tr>")
  367. if(get_pcvar_num(p_Cp))
  368. {
  369. new Cvar = get_pcvar_num(p_CpDelay)
  370. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /checkpoint</span></td><td><span class=^"sty1^">Saves a checkpoint at your current location. Use &quot;say /gocheck&quot; to go to it. You can save or load a checkpoint every %d seconds.</span></td></tr>",Cvar)
  371. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /gocheck</span></td><td><span class=^"sty1^">Allows you to go to one of your saved checkpoints. You can save or load a checkpoint every %d seconds.</span></td></tr>",Cvar)
  372. }
  373. if(get_pcvar_num(p_Timer))
  374. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<tr><td><span class=^"sty1^">say /timer</span></td><td><span class=^"sty1^">Brings up a menu with various timer options, allowing you to time various events.</span></td></tr>")
  375. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"</table><p align=^"center^"><span class=^"sty1^"><strong>Powered by uSurf</strong></span></p></body></html>")
  376. }
  377. case 2 :
  378. {
  379. copy(Title,15,"About uSurf")
  380.  
  381. Pos = format(MOTD,sizeof MOTD - 1,"<style type=^"text/css^"><!--.sty1 {color: #CC9900;font-family: Arial, Helvetica, sans-serif;}--></style>")
  382. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<body bgcolor=^"#000000^"><strong><span class=^"sty1^"><div align=^"center^">About uSurf</span></strong></div>")
  383. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<span class=^"sty1^"><p>This plugin is designed to manage surf servers. It is the successor to Surf Management / Tools.</p>")
  384. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"<p>For more information or to download this plugin, go <a href=^"http://forums.alliedmods.net/showthread.php?t=16418^">here</a> (<a href=^"http://forums.alliedmods.net/showthread.php?t=16418^">http://forums.alliedmods.net/showthread.php?t=16418</a>)</p>")
  385. Pos += format(MOTD[Pos],sizeof MOTD - 1 - Pos,"</span><p align=^"center^"><span class=^"sty1^"><strong>Powered by uSurf</strong></span></p></body></html")
  386. }
  387. default :
  388. return
  389. }
  390.  
  391. show_motd(id,MOTD,Title)
  392. menu_display(id,g_SurfHelpMenu,0)
  393. }
  394.  
  395. public ShowSurfHelp()
  396. {
  397. if(g_SurfMap && get_pcvar_num(p_Help) && get_pcvar_num(p_On))
  398. client_print(0,print_chat,"[USURF] Segitsegre van szukseged? Ird: /surfhelp")
  399.  
  400. set_task(get_pcvar_float(p_HelpInterval),"ShowSurfHelp")
  401. }
  402.  
  403. public CmdCheckpoint(id)
  404. {
  405. if(!get_pcvar_num(p_Cp) || !get_pcvar_num(p_On) || !g_SurfMap)
  406. return PLUGIN_HANDLED
  407.  
  408. new Float:Time,Float:Delay = get_pcvar_float(p_CpDelay)
  409. global_get(glb_time,Time)
  410.  
  411. new Float:TimePassed = Time - g_LastSave[id]
  412.  
  413. if(TimePassed < Delay)
  414. {
  415. client_print(id,print_chat,"[USURF] Varnod kell %d masodpercet a mentes elott..",floatround(Delay - TimePassed))
  416. return PLUGIN_HANDLED
  417. }
  418.  
  419. pev(id,pev_origin,g_Origin[id])
  420. if(pev(id,pev_button) & IN_DUCK)
  421. g_Origin[id][2] += 24.0
  422. pev(id,pev_velocity,g_Velocity[id])
  423. pev(id,pev_angles,g_Angles[id])
  424. g_LastSave[id] = Time
  425.  
  426. client_print(id,print_chat,"[USURF] Elmentetted a checkpontot.")
  427.  
  428. return PLUGIN_HANDLED
  429. }
  430.  
  431. public CmdGoCheck(id)
  432. {
  433. if(!get_pcvar_num(p_Cp) || !get_pcvar_num(p_On) || !g_SurfMap)
  434. return PLUGIN_HANDLED
  435.  
  436. if(!g_Origin[id][0])
  437. {
  438. client_print(id,print_chat,"[USURF] Nincs mentett checkpont-od.")
  439. return PLUGIN_HANDLED
  440. }
  441.  
  442. new Float:Time,Float:Delay = get_pcvar_float(p_CpDelay)
  443. global_get(glb_time,Time)
  444.  
  445. new Float:TimePassed = Time - g_LastSave[id]
  446.  
  447. if(TimePassed < Delay)
  448. {
  449. client_print(id,print_chat,"[USURF] Varnod kell %d masodpercet a kovetkezo checkpontig.",floatround(Delay - TimePassed))
  450. return PLUGIN_HANDLED
  451. }
  452.  
  453. engfunc(EngFunc_SetOrigin,id,g_Origin[id])
  454. set_pev(id,pev_velocity,g_Velocity[id])
  455. set_pev(id,pev_fixangle,1)
  456. set_pev(id,pev_angles,g_Angles[id])
  457. g_LastSave[id] = Time
  458.  
  459. client_print(id,print_chat,"[USURF] Elerkeztel az utolso checkpontodhoz.")
  460.  
  461. return PLUGIN_HANDLED
  462. }
  463.  
  464. public CmdRespawn(id)
  465. {
  466. new CsTeams:Team = cs_get_user_team(id)
  467.  
  468. if(!get_pcvar_num(p_On))
  469. return client_print(id,print_chat,"[USURF] Bocsi, a surf plugin jelenleg ki van kapcsolva.")
  470. else if(!get_pcvar_num(p_Respawn))
  471. return client_print(id,print_chat,"[USURF] Az ujraeledes jelenleg ki van kapcsolva.")
  472. else if(!g_SurfMap)
  473. return client_print(id,print_chat,"[USURF] Ez nem egy surf palya.")
  474.  
  475. if(Team == CS_TEAM_T || Team == CS_TEAM_CT)
  476. set_task(0.5,"Spawn",id)
  477. else
  478. return client_print(id,print_chat,"[USURF] Csapatban kell lenned, hogy ujra tudj eledni.")
  479.  
  480. client_print(id,print_chat,is_user_alive(id) ? "[USURF] Vissza lettel rakva a kezdohelyre." : "[USURF] Ujraeledtel.")
  481.  
  482. return PLUGIN_CONTINUE
  483. }
  484.  
  485. public StandardTimer()
  486. {
  487. if(!get_pcvar_num(p_On) || !g_SurfMap)
  488. return
  489.  
  490. static Players[32],Playersnum,Player,CsTeams:Team
  491.  
  492. new TeamStack = get_pcvar_num(p_TeamStack)
  493. if(TeamStack == _:CS_TEAM_CT || TeamStack == _:CS_TEAM_T)
  494. {
  495. get_players(Players,Playersnum)
  496.  
  497. for(new Count;Count < Playersnum;Count++)
  498. {
  499. Player = Players[Count]
  500.  
  501. Team = cs_get_user_team(Player)
  502. if(_:Team != TeamStack && (Team == CS_TEAM_T || Team == CS_TEAM_CT))
  503. cs_set_user_team(Player,CsTeams:TeamStack,CsInternalModel:g_Models[TeamStack - 1][random_num(0,3)])
  504. }
  505. }
  506.  
  507. if(!get_pcvar_num(p_Respawn))
  508. return
  509.  
  510. get_players(Players,Playersnum,"b")
  511.  
  512. for(new Count = 0;Count < Playersnum;Count++)
  513. {
  514. Player = Players[Count]
  515. Team = cs_get_user_team(Player)
  516.  
  517. if(Team == CS_TEAM_T || Team == CS_TEAM_CT)
  518. Spawn(Player)
  519. }
  520. }
  521.  
  522. public EventDeathMsg()
  523. {
  524. new id = read_data(2)
  525. set_task(0.5,"Spawn",id)
  526.  
  527. global_get(glb_time,g_LastSave[id])
  528. g_LastSave[id] -= get_pcvar_num(p_CpDelay)
  529. }
  530.  
  531. public Spawn(id)
  532. {
  533. new CsTeams:Team = cs_get_user_team(id)
  534.  
  535. if(is_user_connected(id) && (Team == CS_TEAM_T || Team == CS_TEAM_CT) && get_pcvar_num(p_On) && get_pcvar_num(p_Respawn) && g_SurfMap)
  536. {
  537. dllfunc(DLLFunc_Spawn,id)
  538. set_task(0.2,"GiveSuit",id)
  539. set_task(0.3,"GiveItems",id)
  540. }
  541. }
  542.  
  543. public GiveSuit(id)
  544. fm_give_item(id,"item_suit")
  545.  
  546. public GiveItems(id)
  547. {
  548. fm_give_item(id,"weapon_knife")
  549. fm_give_item(id,"weapon_scout")
  550. }
  551.  
  552. // no, VEN did not write this, I did (although I found out later that he wrote something like it)
  553. fm_give_item(id,Item[])
  554. {
  555. if(containi(Item,"item_") == -1 && containi(Item,"weapon_") == -1 && containi(Item,"ammo_") == -1 && containi(Item,"tf_weapon_") == -1)
  556. return
  557.  
  558. new Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, Item)),Float:vOrigin[3]
  559.  
  560. if(!pev_valid(Ent))
  561. return
  562.  
  563. pev(id,pev_origin,vOrigin)
  564. set_pev(Ent,pev_origin,vOrigin)
  565.  
  566. set_pev(Ent,pev_spawnflags,pev(Ent,pev_spawnflags)|(1<<30))
  567.  
  568. dllfunc(DLLFunc_Spawn,Ent)
  569.  
  570. new Solid = pev(Ent,pev_solid)
  571.  
  572. dllfunc(DLLFunc_Touch,Ent,id)
  573.  
  574. if(pev(Ent,pev_solid) == Solid)
  575. engfunc(EngFunc_RemoveEntity,Ent)
  576. }
  577.  
  578. CheckButton()
  579. if(get_pcvar_num(p_RemoveButton) && get_pcvar_num(p_On) && g_SurfMap)
  580. {
  581. new Ent,Value[] = "classname",ClassName[] = "env_explosion"
  582. while((Ent = engfunc(EngFunc_FindEntityByString,Ent,Value,ClassName)) != 0)
  583. if(pev_valid(Ent))
  584. set_pev(Ent,pev_flags,pev(Ent,pev_flags)|FL_KILLME)
  585. }
  586.  
  587. public ForwardPlayerPreThink(id)
  588. {
  589. if(!is_user_alive(id) || !get_pcvar_num(p_On) || !g_SurfMap)
  590. return
  591.  
  592. new NoGuns = get_pcvar_num(p_NoGuns)
  593.  
  594. if(NoGuns == 1)
  595. {
  596. new SpawnDistance = get_pcvar_num(p_SpawnDist)
  597.  
  598. static Float:vOrigin[3]
  599. pev(id,pev_origin,vOrigin)
  600.  
  601. new DeathMatch = engfunc(EngFunc_FindEntityByString,-1,"classname","info_player_deathmatch")
  602. new PlayerStart = engfunc(EngFunc_FindEntityByString,-1,"classname","info_player_start")
  603.  
  604. if(DeathMatch && PlayerStart)
  605. {
  606. static Float:vDeathMatch_Origin[3]
  607. pev(DeathMatch,pev_origin,vDeathMatch_Origin)
  608.  
  609. static Float:vPlayerStart_Origin[3]
  610. pev(PlayerStart,pev_origin,vPlayerStart_Origin)
  611.  
  612. new Float:DeathMatch_Distance = get_distance_f(vOrigin,vDeathMatch_Origin)
  613. new Float:PlayerStart_Distance = get_distance_f(vOrigin,vPlayerStart_Origin)
  614.  
  615. new Clip,Ammo,Weapon = get_user_weapon(id,Clip,Ammo)
  616.  
  617. if(DeathMatch_Distance < SpawnDistance || PlayerStart_Distance < SpawnDistance)
  618. {
  619. if(Weapon != CSW_KNIFE && Weapon != CSW_C4 && Weapon != CSW_HEGRENADE && Weapon != CSW_FLASHBANG && Weapon != CSW_SMOKEGRENADE)
  620. client_cmd(id,"drop")
  621. } // Argh, stupid thing doesn't understand this if I don't add the brackets.
  622. else if(DeathMatch_Distance > SpawnDistance || PlayerStart_Distance > SpawnDistance)
  623. if(!user_has_weapon(id,CSW_SCOUT))
  624. fm_give_item(id,"weapon_scout")
  625. }
  626. }
  627. else if(NoGuns == 2)
  628. {
  629. new Clip, Ammo, Weapon = get_user_weapon(id,Clip,Ammo)
  630.  
  631. if(Weapon != CSW_KNIFE && Weapon != CSW_C4 && Weapon != CSW_HEGRENADE && Weapon != CSW_FLASHBANG && Weapon != CSW_SMOKEGRENADE)
  632. client_cmd(id,"drop")
  633. }
  634. else if(NoGuns == 3)
  635. {
  636. new Clip, Ammo, Weapon = get_user_weapon(id,Clip,Ammo)
  637.  
  638. if(Weapon != CSW_KNIFE && Weapon != CSW_C4)
  639. {
  640. fm_strip_user_weapons(id)
  641. fm_give_item(id,"weapon_knife")
  642. }
  643. }
  644.  
  645. if(get_pcvar_num(p_BunnyHop))
  646. {
  647. set_pev(id,pev_fuser2,0.0)
  648.  
  649. if(get_pcvar_num(p_BunnyHopAutoJump) && pev(id,pev_button) & IN_JUMP)
  650. {
  651. new Flags = pev(id,pev_flags)
  652. if(!(Flags & FL_WATERJUMP) && pev(id,pev_waterlevel) < 2 && Flags & FL_ONGROUND)
  653. {
  654. new Float:Velocity[3]
  655. pev(id,pev_velocity,Velocity)
  656. Velocity[2] += 250.0
  657. set_pev(id,pev_velocity,Velocity)
  658.  
  659. set_pev(id,pev_gaitsequence,6)
  660. }
  661. }
  662. }
  663.  
  664. if(get_pcvar_num(p_Timer) && g_Timer[id])
  665. {
  666. static Time[33]
  667.  
  668. set_hudmessage(get_pcvar_num(p_R),get_pcvar_num(p_G),get_pcvar_num(p_B),get_pcvar_float(p_X),get_pcvar_float(p_Y),0,0.0,6.0,0.0,0.0,-1)
  669. get_time_length(id,g_Time[id],timeunit_seconds,Time,32)
  670. ShowSyncHudMsg(id,g_HudObject,"Timer: %s",Time)
  671. }
  672. }
  673.  
  674. public ForwardSetModel(id,Model[])
  675. {
  676. if(!pev_valid(id) || !g_SurfMap || !get_pcvar_num(p_On) || !strlen(Model) || !get_pcvar_num(p_RemoveDropped))
  677. return
  678.  
  679. static ClassName[33]
  680. pev(id,pev_classname,ClassName,32)
  681.  
  682. if(equali(ClassName,"weaponbox"))
  683. set_task(0.1,"RemoveGun",id)
  684. }
  685.  
  686. public RemoveGun(id)
  687. if(pev_valid(id))
  688. engfunc(EngFunc_RemoveEntity,id)
  689.  
  690. public ForwardTouch(Ptr,Ptd)
  691. {
  692. if(!pev_valid(Ptr) || !pev_valid(Ptd) || !g_SurfMap || !get_pcvar_num(p_On) || !get_pcvar_num(p_Respawn))
  693. return FMRES_IGNORED
  694.  
  695. new id
  696. if(is_user_alive(Ptr))
  697. id = Ptr
  698. else if(is_user_alive(Ptd))
  699. id = Ptd
  700.  
  701. if(!id)
  702. return FMRES_IGNORED
  703.  
  704. static Classname[33]
  705. pev(id == Ptr ? Ptd : Ptr,pev_classname,Classname,32)
  706. if(equali(Classname,"trigger_hurt"))
  707. {
  708. Spawn(id)
  709. return FMRES_SUPERCEDE
  710. }
  711.  
  712. return FMRES_IGNORED
  713. }
  714.  
  715. public ForwardThink(Ent)
  716. {
  717. if(Ent != g_SemiclipThinker || !g_SurfMap)
  718. return
  719.  
  720. if(get_pcvar_num(p_Semiclip) && get_pcvar_num(p_On))
  721. {
  722. static Players[32],Playersnum,Player
  723. get_players(Players,Playersnum)
  724.  
  725. for(new Count;Count < Playersnum;Count++)
  726. {
  727. Player = Players[Count]
  728. if(!is_user_alive(Player))
  729. continue
  730.  
  731. set_pev(Player,pev_solid,IsColliding(Player) ? SOLID_NOT : SOLID_BBOX)
  732. }
  733. }
  734.  
  735. new Float:Time
  736. global_get(glb_time,Time)
  737. set_pev(Ent,pev_nextthink,Time + 0.01)
  738. }
  739.  
  740. public ForwardTraceLine(Float:v1[3],Float:v2[3],EntToSkip,NoMonsters,TR)
  741. {
  742. if(!get_pcvar_num(p_Godmode) || !g_SurfMap || !get_pcvar_num(p_On))
  743. return FMRES_IGNORED
  744.  
  745. new id = get_tr(TR_pHit)
  746. if(!is_user_alive(id))
  747. return FMRES_IGNORED
  748.  
  749. new Attacker
  750. while((Attacker = engfunc(EngFunc_FindEntityInSphere,Attacker,v1,10.0)) != 0)
  751. if(Attacker < 33 && Attacker > 0)
  752. break
  753.  
  754. if(!is_user_alive(Attacker))
  755. return FMRES_IGNORED
  756.  
  757. new Button = pev(Attacker,pev_button)
  758. if(!(Button & IN_ATTACK) && !(Button & IN_ATTACK2))
  759. return FMRES_IGNORED
  760.  
  761. set_tr(TR_flFraction,1.0)
  762.  
  763. return FMRES_IGNORED
  764. }
  765.  
  766. public ForwardTraceHull(Float:v1[3],Float:v2[3],NoMonsters,Hull,EntToSkip,TR)
  767. {
  768. if(!g_SurfMap || !get_pcvar_num(p_On) || !get_pcvar_num(p_Godmode))
  769. return FMRES_IGNORED
  770.  
  771. new Button = pev(EntToSkip,pev_button)
  772. if(!(Button & IN_ATTACK) && !(Button & IN_ATTACK2))
  773. return FMRES_IGNORED
  774.  
  775. set_tr(TR_flFraction,1.0)
  776.  
  777. return FMRES_IGNORED
  778. }
  779.  
  780. // thanks to VEN for this stock from Fakemeta Utilities
  781. fm_strip_user_weapons(index) {
  782. new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip"))
  783. if (!pev_valid(ent))
  784. return 0
  785.  
  786. dllfunc(DLLFunc_Spawn, ent)
  787. dllfunc(DLLFunc_Use, ent, index)
  788.  
  789. engfunc(EngFunc_RemoveEntity, ent)
  790.  
  791. return 1
  792. }
  793.  
  794. IsColliding(id)
  795. {
  796. if(pev(id,pev_flags) & FL_ONGROUND || pev(id,pev_button) & IN_JUMP)
  797. return false
  798.  
  799. new Ent,Float:Origin[3]
  800. pev(id,pev_origin,Origin)
  801.  
  802. while((Ent = engfunc(EngFunc_FindEntityInSphere,Ent,Origin,36.0)) != 0)
  803. if(Ent > 0 && Ent <= 32 && is_user_alive(Ent) && Ent != id)
  804. return true
  805.  
  806. return false
  807. }
  808.  


nagyobb részét lefordítottam, a menüt és azokat amiket a chatbe ír, a segítséget nem, mivel nem tudom, hogy mit szeretnél kiírni a játékosoknak "segítségként".

_________________
Valami új kezdete...
Kép
Egyedi pluginok készítése pénzért (Banki átutalás, PayPal) -> Privát üzenet


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 2 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole