HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #pragma dynamic 131072 //I used to much memory =(
  2. /*
  3.  * CVARs:
  4.  * - These CVARS can be changed at any time during round!
  5.  * sj_kick (default: 650) - Default Kicking Speed.
  6.  * sj_score (default: 15) - Scores needed to win a round.
  7.  * sj_reset (default: 30.0) - Ball reset time, to respawn at ball spawn location.
  8.  * sj_goalsafety (default: 650) - Distance around Mascot, that does damage to enemy.
  9.  * sj_random (default: 1) - Turns Team Randomizing ON/OFF.
  10.  *
  11.  * Requires: AMXX 1.75+
  12.  *
  13.  * Author: OneEyed
  14.  * IRC: #soccerjam (irc.gamesurge.net)
  15.  * Website: http://www.soccer-jam.com/
  16.  */
  17.  
  18. /* ------------------------------------------------------------------------- */
  19. /* /----------------------- START OF CUSTOMIZATION -----------------------/ */
  20. /* ------------------------------------------------------------------------- */
  21. /* ------------------------------------------------------------------------- */
  22. /* ------------------------------------------------------------------------- */
  23. /* /------------ CUSTOM DEFINES ------------ CUSTOM DEFINES ------------/ */
  24. /* ------------------------------------------------------------------------- */
  25.  
  26. // Disable knife disarm ? (Leaves only ball disarm)
  27. // Comment this define to disable.
  28. #define KNIFE_DISARM_OFF
  29.  
  30. //When player reaches MAX level, they receive this many levels.
  31. #define MAX_LVL_BONUS 1
  32.  
  33. //Max levels for each upgrade
  34. #define MAX_LVL_STAMINA 5
  35. #define MAX_LVL_STRENGTH 5
  36. #define MAX_LVL_AGILITY 5
  37. #define MAX_LVL_DEXTERITY 5
  38. #define MAX_LVL_DISARM 5
  39. #define MAX_LVL_POWERPLAY 5
  40.  
  41. //Prices for each upgrade.
  42. //price = ((UpgradeLevel * UpgradePrice) / 2) + UpgradePrice
  43. #define EXP_PRICE_STAMINA 100
  44. #define EXP_PRICE_STRENGTH 150
  45. #define EXP_PRICE_AGILITY 100
  46. #define EXP_PRICE_DEXTERITY 100
  47. #define EXP_PRICE_DISARM 150
  48.  
  49. //Experience per stat.
  50. #define EXP_GOALY 20 //for goaly save and goaly points.
  51. #define EXP_STEAL 40
  52. #define EXP_KILL 40
  53. #define EXP_ASSIST 40
  54. #define EXP_GOAL 70
  55.  
  56. #define BASE_HP 100 //starting hp
  57. #define BASE_SPEED 280.0 //starting run speed
  58. #define BASE_DISARM 0 //starting disarm from lvl 1
  59.  
  60. #define COUNTDOWN_TIME 10 //Countdown time between rounds.
  61. #define GOALY_DELAY 8.0 //Delay for goaly exp
  62.  
  63. //Curve Ball Defines
  64. #define CURVE_ANGLE 15 //Angle for spin kick multipled by current direction.
  65. #define CURVE_COUNT 6 //Curve this many times.
  66. #define CURVE_TIME 0.2 //Time to curve again.
  67. #define DIRECTIONS 3 //# of angles allowed.
  68. #define ANGLEDIVIDE 6 //Divide angle this many times for curve.
  69.  
  70. //Misc. amounts
  71. #define AMOUNT_LATEJOINEXP 40 //latejoinexp * each scored point.
  72. #define AMOUNT_POWERPLAY 5 //added bonus to STR and AGI per powerplay lvl.
  73. #define AMOUNT_GOALY 7 //Goaly camper exp
  74.  
  75. //Amount of points for each upgrade.
  76. #define AMOUNT_STA 20 //Health per lvl
  77. #define AMOUNT_STR 50 //Stronger kicking per lvl
  78. #define AMOUNT_AGI 17 //Faster Speed per lvl
  79. #define AMOUNT_DEX 50 //Better Catching
  80. #define AMOUNT_DISARM 2 //Disarm ball chance (disarm lvl * this) if random num 1-100 < disarm
  81.  
  82. #define DISARM_MULTIPLIER 3
  83. /* ------------------------------------------------------------------------- */
  84. /* /---------------- TEAM NAMES ------------ TEAM NAMES ------------/ */
  85. /* ------------------------------------------------------------------------- */
  86.  
  87. #define TEAMS 4 //Don't edit this.
  88.  
  89. //Names to be put on scoreboard.
  90. static const TeamNames[TEAMS][] = {
  91. "NULL",
  92. "Piros", //Terrorist Team
  93. "Kék", //CT Team
  94. "NULL"
  95. }
  96. /* ------------------------------------------------------------------------- */
  97. /* /---------------- MODELS ---------------- MODELS ----------------/ */
  98. /* ------------------------------------------------------------------------- */
  99. //You may change the ball model. Just give correct path of new model.
  100. new ball[] = "models/kickball/soccerball.mdl"
  101.  
  102. static const TeamMascots[2][] = {
  103. "models/mascot.mdl", //TERRORIST MASCOT
  104. "models/mascot.mdl" //CT MASCOT
  105. }
  106. /* ------------------------------------------------------------------------- */
  107. /* /---------------- COLORS ---------------- COLORS ----------------/ */
  108. /* ------------------------------------------------------------------------- */
  109. //Format is RGB 0-255
  110.  
  111. //TEAM MODEL GLOW COLORS
  112. #define TERR_GLOW_RED 250
  113. #define TERR_GLOW_GREEN 150
  114. #define TERR_GLOW_BLUE 0
  115.  
  116. #define CT_GLOW_RED 0
  117. #define CT_GLOW_GREEN 150
  118. #define CT_GLOW_BLUE 250
  119.  
  120. //TEAM HUD METER COLOR (Turbo/Curve Angle meters)
  121. #define TERR_METER_RED 255
  122. #define TERR_METER_GREEN 150
  123. #define TERR_METER_BLUE 0
  124.  
  125. #define CT_METER_RED 0
  126. #define CT_METER_GREEN 150
  127. #define CT_METER_BLUE 255
  128.  
  129. //BALL GLOW COLOR (default: yellow) //it glows only one color
  130. #define BALL_RED 255
  131. #define BALL_GREEN 10
  132. #define BALL_BLUE 255
  133.  
  134. //BALL BEAM
  135. #define BALL_BEAM_WIDTH 2
  136. #define BALL_BEAM_LIFE 15
  137. #define BALL_BEAM_RED 255
  138. #define BALL_BEAM_GREEN 10
  139. #define BALL_BEAM_BLUE 255
  140. #define BALL_BEAM_ALPHA 250
  141.  
  142. /* ------------------------------------------------------------------------- */
  143. /* /---------------- SOUNDS ---------------- SOUNDS ----------------/ */
  144. /* ------------------------------------------------------------------------- */
  145. //-- NOTE: Sounds must be located in sound/kickball/ folder.
  146.  
  147. new BALL_BOUNCE_GROUND[] = "kickball/bounce.wav"
  148. new BALL_RESPAWN[] = "kickball/returned.wav"
  149. new BALL_KICKED[] = "kickball/kicked.wav"
  150. new BALL_PICKED_UP[] = "kickball/gotball.wav"
  151. new UPGRADED_MAX_LEVEL[] = "kickball/levelup.wav"
  152. new ROUND_START[] = "kickball/prepare.wav"
  153. new SCORED_GOAL[] = "kickball/distress.wav"
  154. new STOLE_BALL_FAST[] = "kickball/pussy.wav"
  155.  
  156. //When a goal is scored, one of these will randomly play.
  157. #define MAX_SOUNDS 6
  158. new SCORED_SOUNDS[MAX_SOUNDS][] = {
  159. "kickball/amaze.wav",
  160. "kickball/laugh.wav",
  161. "kickball/perfect.wav",
  162. "kickball/diebitch.wav",
  163. "kickball/bday.wav",
  164. "kickball/boomchakalaka.wav"
  165. }
  166. /* ------------------------------------------------------------------------- */
  167. /* ------------------------------------------------------------------------- */
  168. /* /------------------------ END OF CUSTOMIZATION ------------------------/ */
  169. /* ------------------------------------------------------------------------- */
  170. /* ------------------------------------------------------------------------- */
  171.  
  172. /* ------------ DO NOT EDIT BELOW ---------------------------------------------------------- */
  173. /* -------------------------- DO NOT EDIT BELOW -------------------------------------------- */
  174. /* --------------------------------------- DO NOT EDIT BELOW ------------------------------- */
  175. /* ---------------------------------------------------- DO NOT EDIT BELOW ------------------ */
  176.  
  177. #include <amxmodx>
  178. #include <cstrike>
  179. #include <engine>
  180. #include <fakemeta>
  181. #include <fun>
  182. #include <nvault>
  183.  
  184. static const AUTHOR[] = "OneEyed"
  185. static const VERSION[] = "2.07a"
  186.  
  187. #define MAX_TEXT_BUFFER 2047
  188. #define MAX_NAME_LENGTH 33
  189. #define MAX_PLAYER 33
  190. #define MAX_ASSISTERS 3
  191. #define MAX_BALL_SPAWNS 5
  192. #define POS_X -1.0
  193. #define POS_Y 0.85
  194. #define HUD_CHANNEL 4
  195. #define MESSAGE_DELAY 4.0
  196.  
  197. #define CHAT_PREFIX "SERVER"
  198.  
  199. enum {
  200. UNASSIGNED = 0,
  201. T,
  202. CT,
  203. SPECTATOR
  204. }
  205.  
  206. #define RECORDS 6
  207. enum {
  208. GOAL = 1,
  209. ASSIST,
  210. STEAL,
  211. KILL,
  212. DISTANCE,
  213. GOALY
  214. }
  215.  
  216. #define UPGRADES 5
  217. enum {
  218. STA = 1, //stamina
  219. STR, //strength
  220. AGI, //agility
  221. DEX, //dexterity
  222. DISARM,
  223. }
  224.  
  225. static const UpgradeTitles[UPGRADES+1][] = {
  226. "NULL",
  227. "Életerõ",
  228. "Erõ",
  229. "Gyorsaság",
  230. "Ügyesség",
  231. "Lefegyverzés"
  232. }
  233.  
  234. new const UpgradeMax[UPGRADES+1] = {
  235. 0, //NULL
  236. MAX_LVL_STAMINA, //STAMINA
  237. MAX_LVL_STRENGTH, //STRENGTH
  238. MAX_LVL_AGILITY, //AGILITY
  239. MAX_LVL_DEXTERITY, //DEXTERITY
  240. MAX_LVL_DISARM, //DISARM
  241. }
  242.  
  243. new const UpgradePrice[UPGRADES+1] = {
  244. 0, //NULL
  245. EXP_PRICE_STAMINA,
  246. EXP_PRICE_STRENGTH,
  247. EXP_PRICE_AGILITY,
  248. EXP_PRICE_DEXTERITY,
  249. EXP_PRICE_DISARM,
  250. }
  251.  
  252. new TeamColors[TEAMS][3] =
  253. {
  254. { 0, 0, 0 },
  255. { TERR_GLOW_RED, TERR_GLOW_GREEN, TERR_GLOW_BLUE } ,
  256. { CT_GLOW_RED, CT_GLOW_GREEN, CT_GLOW_BLUE },
  257. { 0, 0, 0 }
  258. }
  259.  
  260. new TeamMeterColors[TEAMS][3] =
  261. {
  262. { 0, 0, 0 },
  263. { TERR_METER_RED, TERR_METER_GREEN, TERR_METER_BLUE } ,
  264. { CT_METER_RED, CT_METER_GREEN, CT_METER_BLUE },
  265. { 0, 0, 0 }
  266. }
  267.  
  268.  
  269. new ballcolor[3] = { BALL_RED, BALL_GREEN, BALL_BLUE }
  270. new PlayerUpgrades[MAX_PLAYER][UPGRADES+1]
  271. new GoalEnt[TEAMS]
  272. new PressedAction[MAX_PLAYER]
  273. new seconds[MAX_PLAYER]
  274. new g_sprint[MAX_PLAYER]
  275. new SideJump[MAX_PLAYER]
  276. new Float:SideJumpDelay[MAX_PLAYER]
  277. new PlayerDeaths[MAX_PLAYER]
  278. new PlayerKills[MAX_PLAYER]
  279. new curvecount
  280. new direction
  281. new maxplayers
  282. new Float:BallSpinDirection[3]
  283. new ballspawncount
  284. new Float:TeamBallOrigins[TEAMS][3]
  285. new Float:TEMP_TeamBallOrigins[3]
  286. new Mascots[TEAMS]
  287. new Float:MascotsOrigins[3]
  288. new Float:MascotsAngles[3]
  289. new menu_upgrade[MAX_PLAYER]
  290. new Float:fire_delay
  291. new winner
  292. new Float:GoalyCheckDelay[MAX_PLAYER]
  293. new GoalyCheck[MAX_PLAYER]
  294. new GoalyPoints[MAX_PLAYER]
  295. new Float:BallSpawnOrigin[MAX_BALL_SPAWNS][3]
  296. new TopPlayer[2][RECORDS+1]
  297. new MadeRecord[MAX_PLAYER][RECORDS+1]
  298. new TopPlayerName[RECORDS+1][MAX_NAME_LENGTH]
  299. new g_Experience[MAX_PLAYER]
  300. new timer
  301. new Float:testorigin[3]
  302. new Float:velocity[3]
  303. new score[TEAMS]
  304. new scoreboard[1025]
  305. new temp1[64], temp2[64]
  306. new distorig[2][3] //distance recorder
  307. new gmsgShake
  308. new gmsgDeathMsg
  309. new gmsgTextMsg
  310. new goaldied[MAX_PLAYER]
  311. new bool:is_dead[MAX_PLAYER]
  312. new terr[33], ct[33], cntCT, cntT
  313. new PowerPlay, powerplay_list[MAX_LVL_POWERPLAY+1]
  314. new assist[16]
  315. new iassist[TEAMS]
  316. new gamePlayerEquip
  317. new CVAR_SCORE
  318. new CVAR_RESET
  319. new CVAR_GOALSAFETY
  320. new CVAR_KICK
  321. new Float:CVAR_RESPAWN
  322. new CVAR_RANDOM
  323. new CVAR_FRAG
  324. new fire
  325. new smoke
  326. new beamspr
  327. new g_fxBeamSprite
  328. new Burn_Sprite
  329. new ballholder
  330. new ballowner
  331. new aball
  332. new is_kickball
  333. new g_TimeLimit;
  334. new bool:has_knife[MAX_PLAYER]
  335. new bool:korvegi[33]
  336. new golok[33], golpasszok[33], vedesek[33]
  337. new gVault
  338.  
  339. new OFFSET_INTERNALMODEL;
  340.  
  341. /*====================================================================================================
  342.  [Precache]
  343.  
  344.  Purpose: $$
  345.  
  346.  Comment: $$
  347.  
  348. ====================================================================================================*/
  349. PrecacheSounds() {
  350. new x
  351. for(x=0;x<MAX_SOUNDS;x++)
  352. engfunc( EngFunc_PrecacheSound, SCORED_SOUNDS[x])
  353.  
  354. engfunc( EngFunc_PrecacheSound, STOLE_BALL_FAST)
  355. engfunc( EngFunc_PrecacheSound, ROUND_START)
  356. engfunc( EngFunc_PrecacheSound, BALL_BOUNCE_GROUND)
  357. engfunc( EngFunc_PrecacheSound, BALL_PICKED_UP)
  358. engfunc( EngFunc_PrecacheSound, BALL_RESPAWN)
  359. engfunc( EngFunc_PrecacheSound, SCORED_GOAL)
  360. engfunc( EngFunc_PrecacheSound, BALL_KICKED)
  361. engfunc( EngFunc_PrecacheSound, UPGRADED_MAX_LEVEL)
  362. }
  363.  
  364. PrecacheBall() {
  365. engfunc( EngFunc_PrecacheModel, ball)
  366. }
  367.  
  368. PrecacheMonsters(team) {
  369. engfunc( EngFunc_PrecacheModel, TeamMascots[team-1])
  370. }
  371.  
  372. PrecacheSprites() {
  373. beamspr = engfunc( EngFunc_PrecacheModel,"sprites/laserbeam.spr")
  374. fire = engfunc( EngFunc_PrecacheModel,"sprites/shockwave.spr")
  375. smoke = engfunc( EngFunc_PrecacheModel,"sprites/steam1.spr")
  376. Burn_Sprite = engfunc( EngFunc_PrecacheModel,"sprites/xfireball3.spr")
  377. g_fxBeamSprite = engfunc( EngFunc_PrecacheModel,"sprites/lgtning.spr")
  378. }
  379.  
  380. PrecacheOther() {
  381. engfunc( EngFunc_PrecacheModel, "models/chick.mdl")
  382. }
  383.  
  384. /*====================================================================================================
  385.  [Initialize]
  386.  
  387.  Purpose: $$
  388.  
  389.  Comment: $$
  390.  
  391. ====================================================================================================*/
  392. public plugin_init() {
  393.  
  394. new mapname[64]
  395. get_mapname(mapname,63)
  396.  
  397. register_cvar("soccer_jam_online", "0", FCVAR_SERVER)
  398. register_plugin("SoccerJam", VERSION, AUTHOR)
  399. register_cvar("soccer_jam_version", VERSION, FCVAR_SERVER)
  400. set_cvar_string("soccer_jam_version", VERSION)
  401. register_dictionary("soccerjam.txt")
  402. register_dictionary("soccerjam_help.txt")
  403. if(is_kickball > 0)
  404. {
  405. PrecacheSprites()
  406.  
  407.  
  408. set_cvar_num("soccer_jam_online", 1)
  409.  
  410. timer = COUNTDOWN_TIME
  411.  
  412. gmsgTextMsg = get_user_msgid("TextMsg")
  413. gmsgDeathMsg = get_user_msgid("DeathMsg")
  414. gmsgShake = get_user_msgid("ScreenShake")
  415.  
  416. maxplayers = get_maxplayers()
  417.  
  418. if(equali(mapname,"soccerjam")) {
  419. PrecacheOther()
  420. CreateGoalNets()
  421. create_wall()
  422. }
  423.  
  424. register_clcmd("say","handle_say")
  425.  
  426. register_event("ResetHUD", "Event_ResetHud", "be")
  427. register_event("ResetHUD", "skincsere", "b")
  428. register_event("HLTV","Event_StartRound","a","1=0","2=0")
  429. register_event("Damage", "Event_Damage", "b", "2!0", "3=0", "4!0" )
  430.  
  431. CVAR_SCORE = register_cvar("sj_score","15")
  432. CVAR_RESET = register_cvar("sj_reset","30.0")
  433. CVAR_GOALSAFETY = register_cvar("sj_goalsafety","650")
  434. CVAR_KICK = register_cvar("sj_kick","650")
  435. CVAR_RESPAWN = 2.0 //register_cvar("kickball_respawn","2.0")
  436. CVAR_RANDOM = register_cvar("sj_random","1")
  437. CVAR_FRAG = register_cvar("sj_frag","0")
  438. register_cvar("sj_timelimit", "0" );
  439.  
  440.  
  441. register_cvar("SCORE_CT","0")
  442. register_cvar("SCORE_T","0")
  443.  
  444. gVault = nvault_open("SoccerJam");
  445.  
  446. register_menucmd(register_menuid("Team_Select",1), (1<<0)|(1<<1)|(1<<4)|(1<<5), "team_select")
  447.  
  448. register_touch("PwnBall", "player", "touchPlayer")
  449. register_touch("PwnBall", "soccerjam_goalnet", "touchNet")
  450.  
  451. register_touch("PwnBall", "worldspawn", "touchWorld")
  452. register_touch("PwnBall", "func_wall", "touchWorld")
  453. register_touch("PwnBall", "func_door", "touchWorld")
  454. register_touch("PwnBall", "func_door_rotating", "touchWorld")
  455. register_touch("PwnBall", "func_wall_toggle", "touchWorld")
  456. register_touch("PwnBall", "func_breakable", "touchWorld")
  457. register_touch("PwnBall", "Blocker", "touchBlocker")
  458.  
  459. set_task(0.4,"meter",0,_,_,"b")
  460. set_task(0.5,"statusDisplay",7654321,"",0,"b")
  461. set_task(120.0, "Hirdetes")
  462.  
  463. register_think("PwnBall","ball_think")
  464. register_think("Mascot", "mascot_think")
  465.  
  466. register_clcmd("radio1", "LeftDirection", 0)
  467. register_clcmd("radio2", "RightDirection", 0)
  468.  
  469. register_clcmd("say /zenebe", "ZeneBe")
  470. register_clcmd("say /zeneki", "ZeneKi")
  471. register_clcmd("say /statom", "ShowStatom")
  472. register_clcmd("say_team /statom", "ShowStatom")
  473. register_clcmd("say_team /zenebe", "ZeneBe")
  474. register_clcmd("say_team /zeneKi", "ZeneKi")
  475. register_clcmd("drop","Turbo")
  476. register_clcmd("say /help", "SjHelp")
  477. register_clcmd("say /rules", "SjRules")
  478. register_clcmd("say /szabaly", "SjRules")
  479. register_clcmd("say /szabalyok", "SjRules")
  480. register_clcmd("say_team /help", "SjHelp")
  481. register_clcmd("say_team /rules", "SjRules")
  482. register_clcmd("say_team /szabaly", "SjRules")
  483. register_clcmd("say_team /szabalyok", "SjRules")
  484.  
  485. register_clcmd("lastinv","BuyUpgrade")
  486. register_clcmd("fullupdate","fullupdate")
  487. register_message(gmsgTextMsg, "editTextMsg")
  488.  
  489. register_event("ShowMenu", "menuclass", "b", "4&CT_Select", "4&Terrorist_Select");
  490. register_event("VGUIMenu", "menuclass", "b", "1=26", "1=27");
  491.  
  492. OFFSET_INTERNALMODEL = is_amd64_server() ? 152 : 126;
  493. }
  494. else {
  495. set_cvar_num("soccer_jam_online",0)
  496. }
  497. return PLUGIN_HANDLED
  498. }
  499.  
  500. public plugin_precache()
  501. {
  502. precache_sound("kickball/korvegi1.mp3")
  503. precache_sound("kickball/korvegi2.mp3")
  504. precache_sound("kickball/korvegi3.mp3")
  505. precache_sound("kickball/korvegi4.mp3")
  506. precache_sound("kickball/korvegi5.mp3")
  507. precache_sound("kickball/korvegi6.mp3")
  508. precache_sound("kickball/korvegi7.mp3")
  509. precache_sound("kickball/korvegi8.mp3")
  510. precache_sound("kickball/korvegi9.mp3")
  511. precache_sound("kickball/korvegi10.mp3")
  512. precache_sound("kickball/korvegi11.mp3")
  513. precache_model("models/player/piros/piros.mdl")
  514. precache_generic("models/player/piros/pirosT.mdl")
  515. precache_model("models/player/kek/kek.mdl")
  516. precache_generic("models/player/kek/kekT.mdl")
  517. }
  518.  
  519. //public plugin_end() {
  520. //server_cmd("mp_timelimit %i", g_TimeLimit)
  521. //}
  522.  
  523. /*====================================================================================================
  524.  [RoundEndSound]
  525.  
  526.  Purpose: After goal playing mp3 sounds
  527.  
  528.  Comment: $$
  529.  
  530. ====================================================================================================*/
  531. public ZeneBe(id)
  532. {
  533. if(korvegi[id] == false)
  534. {
  535. print_chatColor(id, "^x04[%s]^x01 Bekapcsoltad a körvégi zenekét.", CHAT_PREFIX)
  536. korvegi[id] = true
  537. }
  538. else
  539. print_chatColor(id, "^x04[%s]^x01 Te már bekapcsoltad a körvégi zenekét.", CHAT_PREFIX)
  540.  
  541. return PLUGIN_CONTINUE
  542. }
  543.  
  544. public ZeneKi(id)
  545. {
  546. if(korvegi[id] == true)
  547. {
  548. print_chatColor(id, "^x04[%s]^x01 Kikapcsoltad a körvégi zenekét.", CHAT_PREFIX)
  549. korvegi[id] = false
  550. }
  551. else
  552. print_chatColor(id, "^x04[%s]^x01 Te már kikapcsoltad a körvégi zenekét.", CHAT_PREFIX)
  553.  
  554. return PLUGIN_CONTINUE
  555. }
  556.  
  557. public Zene(id)
  558. {
  559. if(korvegi[id] == true)
  560. {
  561. switch(random(11))
  562. {
  563. case 0:
  564. {
  565. client_cmd(id, "mp3 play sound/kickball/korvegi1.mp3")
  566. }
  567. case 1:
  568. {
  569. client_cmd(id, "mp3 play sound/kickball/korvegi2.mp3")
  570. }
  571. case 2:
  572. {
  573. client_cmd(id, "mp3 play sound/kickball/korvegi3.mp3")
  574. }
  575. case 3:
  576. {
  577. client_cmd(id, "mp3 play sound/kickball/korvegi4.mp3")
  578. }
  579. case 4:
  580. {
  581. client_cmd(id, "mp3 play sound/kickball/korvegi5.mp3")
  582. }
  583. case 5:
  584. {
  585. client_cmd(id, "mp3 play sound/kickball/korvegi6.mp3")
  586. }
  587. case 6:
  588. {
  589. client_cmd(id, "mp3 play sound/kickball/korvegi7.mp3")
  590. }
  591. case 7:
  592. {
  593. client_cmd(id, "mp3 play sound/kickball/korvegi8.mp3")
  594. }
  595. case 8:
  596. {
  597. client_cmd(id, "mp3 play sound/kickball/korvegi9.mp3")
  598. }
  599. case 9:
  600. {
  601. client_cmd(id, "mp3 play sound/kickball/korvegi10.mp3")
  602. }
  603. case 10:
  604. {
  605. client_cmd(id, "mp3 play sound/kickball/korvegi11.mp3")
  606. }
  607. }
  608. }
  609.  
  610. return PLUGIN_CONTINUE
  611. }
  612.  
  613. public SjHelp(id)
  614. {
  615. show_motd(id, "soccerjamhelp.txt")
  616. }
  617.  
  618. public SjRules(id)
  619. {
  620. show_motd(id, "soccerjamrules.txt")
  621. }
  622.  
  623. /*====================================================================================================
  624.  [Initialize Entities]
  625.  
  626.  Purpose: Handles our custom entities, created with Valve Hammer, and fixes for soccerjam.bsp.
  627.  
  628.  Comment: $$
  629.  
  630. ====================================================================================================*/
  631. public pfn_keyvalue(entid) {
  632.  
  633. new classname[32], key[32], value[32]
  634. copy_keyvalue(classname, 31, key, 31, value, 31)
  635.  
  636. new temp_origins[3][10], x, team
  637. new temp_angles[3][10]
  638.  
  639. if(equal(key, "classname") && equal(value, "soccerjam_goalnet"))
  640. DispatchKeyValue("classname", "func_wall")
  641.  
  642. if(equal(classname, "game_player_equip")){
  643. if(!is_kickball || !gamePlayerEquip)
  644. gamePlayerEquip = entid
  645. else {
  646. remove_entity(entid)
  647. }
  648. }
  649. else if(equal(classname, "func_wall"))
  650. {
  651. if(equal(key, "team"))
  652. {
  653. team = str_to_num(value)
  654. if(team == 1 || team == 2) {
  655. GoalEnt[team] = entid
  656. set_task(1.0, "FinalizeGoalNet", team)
  657. }
  658. }
  659. }
  660. else if(equal(classname, "soccerjam_mascot"))
  661. {
  662.  
  663. if(equal(key, "team"))
  664. {
  665. team = str_to_num(value)
  666. create_mascot(team)
  667. }
  668. else if(equal(key, "origin"))
  669. {
  670. parse(value, temp_origins[0], 9, temp_origins[1], 9, temp_origins[2], 9)
  671. for(x=0; x<3; x++)
  672. MascotsOrigins[x] = floatstr(temp_origins[x])
  673. }
  674. else if(equal(key, "angles"))
  675. {
  676. parse(value, temp_angles[0], 9, temp_angles[1], 9, temp_angles[2], 9)
  677. for(x=0; x<3; x++)
  678. MascotsAngles[x] = floatstr(temp_angles[x])
  679. }
  680. }
  681. else if(equal(classname, "soccerjam_teamball"))
  682. {
  683. if(equal(key, "team"))
  684. {
  685. team = str_to_num(value)
  686. for(x=0; x<3; x++)
  687. TeamBallOrigins[team][x] = TEMP_TeamBallOrigins[x]
  688. }
  689. else if(equal(key, "origin"))
  690. {
  691. parse(value, temp_origins[0], 9, temp_origins[1], 9, temp_origins[2], 9)
  692. for(x=0; x<3; x++)
  693. TEMP_TeamBallOrigins[x] = floatstr(temp_origins[x])
  694. }
  695. }
  696. else if(equal(classname, "soccerjam_ballspawn"))
  697. {
  698. if(equal(key, "origin")) {
  699. is_kickball = 1
  700.  
  701. create_Game_Player_Equip()
  702.  
  703. PrecacheBall()
  704. PrecacheSounds()
  705.  
  706. if(ballspawncount < MAX_BALL_SPAWNS) {
  707. parse(value, temp_origins[0], 9, temp_origins[1], 9, temp_origins[2], 9)
  708.  
  709. BallSpawnOrigin[ballspawncount][0] = floatstr(temp_origins[0])
  710. BallSpawnOrigin[ballspawncount][1] = floatstr(temp_origins[1])
  711. BallSpawnOrigin[ballspawncount][2] = floatstr(temp_origins[2]) + 10.0
  712.  
  713. ballspawncount++
  714. }
  715. }
  716. }
  717. }
  718.  
  719. createball()
  720. {
  721. new entity = create_entity("info_target")
  722. if (entity)
  723. {
  724. entity_set_string(entity,EV_SZ_classname,"PwnBall")
  725. entity_set_model(entity, ball)
  726.  
  727. entity_set_int(entity, EV_INT_solid, SOLID_BBOX)
  728. entity_set_int(entity, EV_INT_movetype, MOVETYPE_BOUNCE)
  729.  
  730. new Float:MinBox[3]
  731. new Float:MaxBox[3]
  732. MinBox[0] = -15.0
  733. MinBox[1] = -15.0
  734. MinBox[2] = 0.0
  735. MaxBox[0] = 15.0
  736. MaxBox[1] = 15.0
  737. MaxBox[2] = 12.0
  738.  
  739. entity_set_vector(entity, EV_VEC_mins, MinBox)
  740. entity_set_vector(entity, EV_VEC_maxs, MaxBox)
  741.  
  742. glow(entity,ballcolor[0],ballcolor[1],ballcolor[2],10)
  743.  
  744. entity_set_float(entity,EV_FL_framerate,0.0)
  745. entity_set_int(entity,EV_INT_sequence,0)
  746. }
  747. //save our entity ID to aball variable
  748. aball = entity
  749. entity_set_float(entity,EV_FL_nextthink,halflife_time() + 0.05)
  750. return PLUGIN_HANDLED
  751. }
  752.  
  753.  
  754. CreateGoalNets() {
  755.  
  756. new endzone, x
  757. new Float:orig[3]
  758. new Float:MinBox[3], Float:MaxBox[3]
  759.  
  760. for(x=1;x<3;x++) {
  761. endzone = create_entity("info_target")
  762. if (endzone) {
  763.  
  764. entity_set_string(endzone,EV_SZ_classname,"soccerjam_goalnet")
  765. entity_set_model(endzone, "models/chick.mdl")
  766. entity_set_int(endzone, EV_INT_solid, SOLID_BBOX)
  767. entity_set_int(endzone, EV_INT_movetype, MOVETYPE_NONE)
  768.  
  769. MinBox[0] = -25.0; MinBox[1] = -145.0; MinBox[2] = -36.0
  770. MaxBox[0] = 25.0; MaxBox[1] = 145.0; MaxBox[2] = 70.0
  771.  
  772. entity_set_vector(endzone, EV_VEC_mins, MinBox)
  773. entity_set_vector(endzone, EV_VEC_maxs, MaxBox)
  774.  
  775. switch(x) {
  776. case 1: {
  777. orig[0] = 2110.0
  778. orig[1] = 0.0
  779. orig[2] = 1604.0
  780. }
  781. case 2: {
  782. orig[0] = -2550.0
  783. orig[1] = 0.0
  784. orig[2] = 1604.0
  785. }
  786. }
  787.  
  788. entity_set_origin(endzone,orig)
  789.  
  790. entity_set_int(endzone, EV_INT_team, x)
  791. set_entity_visibility(endzone, 0)
  792. GoalEnt[x] = endzone
  793. }
  794. }
  795.  
  796. }
  797.  
  798. create_wall() {
  799. new wall = create_entity("func_wall")
  800. if(wall)
  801. {
  802. new Float:orig[3]
  803. new Float:MinBox[3], Float:MaxBox[3]
  804. entity_set_string(wall,EV_SZ_classname,"Blocker")
  805. entity_set_model(wall, "models/chick.mdl")
  806.  
  807. entity_set_int(wall, EV_INT_solid, SOLID_BBOX)
  808. entity_set_int(wall, EV_INT_movetype, MOVETYPE_NONE)
  809.  
  810. MinBox[0] = -72.0; MinBox[1] = -100.0; MinBox[2] = -72.0
  811. MaxBox[0] = 72.0; MaxBox[1] = 100.0; MaxBox[2] = 72.0
  812.  
  813. entity_set_vector(wall, EV_VEC_mins, MinBox)
  814. entity_set_vector(wall, EV_VEC_maxs, MaxBox)
  815.  
  816. orig[0] = 2355.0
  817. orig[1] = 1696.0
  818. orig[2] = 1604.0
  819. entity_set_origin(wall,orig)
  820. set_entity_visibility(wall, 0)
  821. }
  822. }
  823.  
  824. create_mascot(team)
  825. {
  826. new Float:MinBox[3], Float:MaxBox[3]
  827. new mascot = create_entity("info_target")
  828. if(mascot)
  829. {
  830. PrecacheMonsters(team)
  831. entity_set_string(mascot,EV_SZ_classname,"Mascot")
  832. entity_set_model(mascot, TeamMascots[team-1])
  833. Mascots[team] = mascot
  834.  
  835. entity_set_int(mascot, EV_INT_solid, SOLID_NOT)
  836. entity_set_int(mascot, EV_INT_movetype, MOVETYPE_NONE)
  837. entity_set_int(mascot, EV_INT_team, team)
  838. MinBox[0] = -16.0; MinBox[1] = -16.0; MinBox[2] = -72.0
  839. MaxBox[0] = 16.0; MaxBox[1] = 16.0; MaxBox[2] = 72.0
  840. entity_set_vector(mascot, EV_VEC_mins, MinBox)
  841. entity_set_vector(mascot, EV_VEC_maxs, MaxBox)
  842. //orig[2] += 200.0
  843.  
  844. entity_set_origin(mascot,MascotsOrigins)
  845. entity_set_float(mascot,EV_FL_animtime,2.0)
  846. entity_set_float(mascot,EV_FL_framerate,1.0)
  847. entity_set_int(mascot,EV_INT_sequence,0)
  848.  
  849. if(team == 2)
  850. entity_set_byte(mascot, EV_BYTE_controller1, 115)
  851.  
  852. entity_set_vector(mascot,EV_VEC_angles,MascotsAngles)
  853. entity_set_float(mascot,EV_FL_nextthink,halflife_time() + 1.0)
  854.  
  855. glow(mascot, TeamColors[team][0], TeamColors[team][1], TeamColors[team][2], 1)
  856. }
  857. }
  858.  
  859. public skincsere(id)
  860. {
  861. if(!is_user_alive(id))
  862. return PLUGIN_CONTINUE
  863.  
  864. new userTeam = get_user_team(id)
  865.  
  866. if (userTeam ==1)
  867. {
  868. cs_set_user_model(id, "piros")
  869. }
  870. else if(userTeam == 2)
  871. {
  872. cs_set_user_model(id, "kek")
  873. }
  874. else
  875. {
  876. cs_reset_user_model(id)
  877. }
  878.  
  879. return PLUGIN_CONTINUE
  880. }
  881.  
  882.  
  883. create_Game_Player_Equip() {
  884. gamePlayerEquip = create_entity("game_player_equip")
  885. if(gamePlayerEquip) {
  886. //DispatchKeyValue(gamePlayerEquip, "weapon_knife", "1")
  887. //DispatchKeyValue(entity, "weapon_scout", "1")
  888. DispatchKeyValue(gamePlayerEquip, "targetname", "roundstart")
  889. DispatchSpawn(gamePlayerEquip)
  890. }
  891.  
  892. }
  893.  
  894. public FinalizeGoalNet(team)
  895. {
  896. new goalnet = GoalEnt[team]
  897. entity_set_string(goalnet,EV_SZ_classname,"soccerjam_goalnet")
  898. entity_set_int(goalnet, EV_INT_team, team)
  899. set_entity_visibility(goalnet, 0)
  900. }
  901.  
  902. public RightDirection(id) {
  903.  
  904. if(id == ballholder) {
  905.  
  906. direction--
  907. if(direction < -(DIRECTIONS))
  908. direction = -(DIRECTIONS)
  909. new temp = direction * CURVE_ANGLE
  910. SendCenterText( id, temp );
  911.  
  912. }
  913. else
  914. {
  915. print_chatColor(id, "^x04[%s]^x01 %L",CHAT_PREFIX,id,"CANT_CURVE_RIGHT")
  916. }
  917. return PLUGIN_HANDLED
  918. }
  919.  
  920. public LeftDirection(id) {
  921.  
  922. if(id == ballholder) {
  923. direction++
  924. if(direction > DIRECTIONS)
  925. direction = DIRECTIONS
  926. new temp = direction * CURVE_ANGLE
  927. SendCenterText( id, temp );
  928.  
  929. }
  930. else
  931. {
  932. print_chatColor(id, "^x04[%s]^x01 %L",CHAT_PREFIX, id, "CANT_CURVE_LEFT");
  933. }
  934. return PLUGIN_HANDLED
  935. }
  936.  
  937.  
  938. SendCenterText( id, dir )
  939. {
  940. if(dir < 0)
  941. client_print(id, print_center, "%L", id, "CURVING_RIGHT", (dir<0?-(dir):dir));
  942. else if(dir == 0)
  943. client_print(id, print_center, "0 fok");
  944. else if(dir > 0)
  945. client_print(id, print_center, "%L", id, "CURVING_LEFT", (dir<0?-(dir):dir));
  946. }
  947.  
  948. public plugin_cfg() {
  949. if(is_kickball) {
  950. server_cmd("sv_maxspeed 999")
  951. server_cmd("sv_airaccelerate 100")
  952. server_cmd("sv_restartround 1")
  953.  
  954. //Fallback to make sure our mp_timelimit is correct.
  955. new mpTimelimit = get_cvar_num("mp_timelimit");
  956. new sjTimelimit = get_cvar_num("sj_timelimit");
  957.  
  958. if( mpTimelimit > 3 )
  959. set_cvar_num("sj_timelimit", mpTimelimit);
  960. else {
  961. if(mpTimelimit && sjTimelimit > 3 )
  962. set_cvar_num("mp_timelimit", sjTimelimit);
  963. }
  964.  
  965. }
  966. else {
  967. //server_cmd("exec server.cfg")
  968. new failed[64];
  969. format(failed,63,"%L", LANG_SERVER, "PLUGIN_FAILED");
  970. set_fail_state(failed);
  971. }
  972. }
  973. /*====================================================================================================
  974.  [Ball Brain]
  975.  
  976.  Purpose: These functions help control the ball and its activities.
  977.  
  978.  Comment: $$
  979.  
  980. ====================================================================================================*/
  981. public ball_think() {
  982.  
  983. new maxscore = get_pcvar_num(CVAR_SCORE)
  984. if(score[1] >= maxscore || score[2] >= maxscore) {
  985. entity_set_float(aball,EV_FL_nextthink,halflife_time() + 0.05)
  986. return PLUGIN_HANDLED
  987. }
  988.  
  989. if(is_valid_ent(aball))
  990. {
  991.  
  992. new Float:gametime = get_gametime()
  993. if(PowerPlay >= MAX_LVL_POWERPLAY && gametime - fire_delay >= 0.3)
  994. on_fire()
  995.  
  996. if(ballholder > 0)
  997. {
  998. new team = get_user_team(ballholder)
  999. entity_get_vector(ballholder, EV_VEC_origin,testorigin)
  1000.  
  1001.  
  1002. if(!is_user_alive(ballholder)) {
  1003.  
  1004. new tname[32]
  1005. get_user_name(ballholder,tname,31)
  1006.  
  1007. remove_task(55555)
  1008. set_task(get_pcvar_float(CVAR_RESET),"clearBall",55555)
  1009.  
  1010. if(!g_sprint[ballholder])
  1011. set_speedchange(ballholder)
  1012.  
  1013. format(temp1,63,"%L", LANG_PLAYER, "DROPPED_BALL", TeamNames[team], tname)
  1014.  
  1015. //remove glow of owner and set ball velocity really really low
  1016. glow(ballholder,0,0,0,0)
  1017.  
  1018. ballowner = ballholder
  1019. ballholder = 0
  1020.  
  1021. testorigin[2] += 5
  1022. entity_set_origin(aball, testorigin)
  1023.  
  1024. new Float:vel[3], x
  1025. for(x=0;x<3;x++)
  1026. vel[x] = 1.0
  1027.  
  1028. entity_set_vector(aball,EV_VEC_velocity,vel)
  1029. entity_set_float(aball,EV_FL_nextthink,halflife_time() + 0.05)
  1030. return PLUGIN_HANDLED
  1031. }
  1032. if(entity_get_int(aball,EV_INT_solid) != SOLID_NOT)
  1033. entity_set_int(aball, EV_INT_solid, SOLID_NOT)
  1034.  
  1035. //Put ball in front of player
  1036. ball_infront(ballholder, 55.0)
  1037. new i
  1038. for(i=0;i<3;i++)
  1039. velocity[i] = 0.0
  1040. //Add lift to z axis
  1041. new flags = entity_get_int(ballholder, EV_INT_flags)
  1042. if(flags & FL_DUCKING)
  1043. testorigin[2] -= 10
  1044. else
  1045. testorigin[2] -= 30
  1046.  
  1047. entity_set_vector(aball,EV_VEC_velocity,velocity)
  1048. entity_set_origin(aball,testorigin)
  1049. }
  1050. else {
  1051. if(entity_get_int(aball,EV_INT_solid) != SOLID_BBOX)
  1052. entity_set_int(aball, EV_INT_solid, SOLID_BBOX)
  1053. }
  1054. }
  1055. entity_set_float(aball,EV_FL_nextthink,halflife_time() + 0.05)
  1056. return PLUGIN_HANDLED
  1057. }
  1058.  
  1059. moveBall(where, team=0) {
  1060.  
  1061. if(is_valid_ent(aball)) {
  1062. if(team) {
  1063. new Float:bv[3]
  1064. bv[2] = 50.0
  1065. entity_set_origin(aball, TeamBallOrigins[team])
  1066. entity_set_vector(aball,EV_VEC_velocity,bv)
  1067. }
  1068. else {
  1069. switch(where) {
  1070. case 0: { //outside map
  1071. new Float:orig[3], x
  1072. for(x=0;x<3;x++)
  1073. orig[x] = -9999.9
  1074. entity_set_origin(aball,orig)
  1075. ballholder = -1
  1076. }
  1077. case 1: { //at middle
  1078.  
  1079. new Float:v[3], rand
  1080. v[2] = 400.0
  1081. if(ballspawncount > 1)
  1082. rand = random_num(0, ballspawncount-1)
  1083. else
  1084. rand = 0
  1085.  
  1086. entity_set_origin(aball, BallSpawnOrigin[rand])
  1087. entity_set_vector(aball, EV_VEC_velocity, v)
  1088.  
  1089. PowerPlay = 0
  1090. ballholder = 0
  1091. ballowner = 0
  1092. }
  1093. }
  1094. }
  1095. }
  1096. }
  1097.  
  1098. public ball_infront(id, Float:dist) {
  1099.  
  1100. new Float:nOrigin[3]
  1101. new Float:vAngles[3] // plug in the view angles of the entity
  1102. new Float:vReturn[3] // to get out an origin fDistance away
  1103.  
  1104. entity_get_vector(aball,EV_VEC_origin,testorigin)
  1105. entity_get_vector(id,EV_VEC_origin,nOrigin)
  1106. entity_get_vector(id,EV_VEC_v_angle,vAngles)
  1107.  
  1108.  
  1109. vReturn[0] = floatcos( vAngles[1], degrees ) * dist
  1110. vReturn[1] = floatsin( vAngles[1], degrees ) * dist
  1111.  
  1112. vReturn[0] += nOrigin[0]
  1113. vReturn[1] += nOrigin[1]
  1114.  
  1115. testorigin[0] = vReturn[0]
  1116. testorigin[1] = vReturn[1]
  1117. testorigin[2] = nOrigin[2]
  1118.  
  1119. /*
  1120. //Sets the angle to face the same as the player.
  1121. new Float:ang[3]
  1122. entity_get_vector(id,EV_VEC_angles,ang)
  1123. ang[0] = 0.0
  1124. ang[1] -= 90.0
  1125. ang[2] = 0.0
  1126. entity_set_vector(aball,EV_VEC_angles,ang)
  1127. */
  1128. }
  1129.  
  1130.  
  1131. public CurveBall(id) {
  1132. if(direction && get_speed(aball) > 5 && curvecount > 0) {
  1133.  
  1134. new Float:dAmt = float((direction * CURVE_ANGLE) / ANGLEDIVIDE);
  1135. new Float:v[3], Float:v_forward[3];
  1136.  
  1137. entity_get_vector(aball, EV_VEC_velocity, v);
  1138. vector_to_angle(v, BallSpinDirection);
  1139.  
  1140. BallSpinDirection[1] = normalize( BallSpinDirection[1] + dAmt );
  1141. BallSpinDirection[2] = 0.0;
  1142.  
  1143. angle_vector(BallSpinDirection, 1, v_forward);
  1144.  
  1145. new Float:speed = vector_length(v)// * 0.95;
  1146. v[0] = v_forward[0] * speed
  1147. v[1] = v_forward[1] * speed
  1148.  
  1149. entity_set_vector(aball, EV_VEC_velocity, v);
  1150.  
  1151. curvecount--;
  1152. set_task(CURVE_TIME, "CurveBall", id);
  1153. }
  1154. }
  1155.  
  1156. public clearBall() {
  1157. play_wav(0, BALL_RESPAWN);
  1158. format(temp1,63,"%L",LANG_PLAYER,"BALL_RESPAWNED")
  1159. moveBall(1)
  1160. }
  1161.  
  1162. /*====================================================================================================
  1163.  [Mascot Think]
  1164.  
  1165.  Purpose: $$
  1166.  
  1167.  Comment: $$
  1168.  
  1169. ====================================================================================================*/
  1170. public mascot_think(mascot)
  1171. {
  1172. new team = entity_get_int(mascot, EV_INT_team)
  1173. new indist[32], inNum, chosen
  1174.  
  1175. new id, playerteam, dist
  1176. for(id=1 ; id<=maxplayers ; id++)
  1177. {
  1178. if(is_user_alive(id) && !is_user_bot(id))
  1179. {
  1180. playerteam = get_user_team(id)
  1181. if(playerteam != team)
  1182. {
  1183. if(!chosen) {
  1184. dist = get_entity_distance(id, mascot)
  1185. if(dist < get_pcvar_num(CVAR_GOALSAFETY))
  1186. if(id == ballholder) {
  1187. chosen = id
  1188. break
  1189. }
  1190. else
  1191. indist[inNum++] = id
  1192. }
  1193. }
  1194. }
  1195. }
  1196. if(!chosen) {
  1197. new rnd = random_num(0, (inNum-1))
  1198. chosen = indist[rnd]
  1199. }
  1200. if(chosen)
  1201. TerminatePlayer(chosen, mascot, team, ( ballholder == chosen ? 999.0 : random_float(5.0, 15.0) ) )
  1202. entity_set_float(mascot,EV_FL_nextthink,halflife_time() + 1.0)
  1203. }
  1204.  
  1205. goaly_checker(id, Float:gametime, team) {
  1206. if(!is_user_alive(id) || (gametime - GoalyCheckDelay[id] < GOALY_DELAY) )
  1207. return PLUGIN_HANDLED
  1208.  
  1209. new dist, gcheck
  1210. new Float:pOrig[3]
  1211. entity_get_vector(id, EV_VEC_origin, pOrig)
  1212. dist = floatround(get_distance_f(pOrig, TeamBallOrigins[team]))
  1213.  
  1214. //--/* Goaly Exp System */--//
  1215. if(dist < 600 ) {
  1216.  
  1217. gcheck = GoalyCheck[id]
  1218.  
  1219. if(id == ballholder && gcheck >= 2)
  1220. kickBall(id, 1)
  1221.  
  1222. GoalyPoints[id]++
  1223.  
  1224. if(gcheck < 2)
  1225. g_Experience[id] += gcheck * AMOUNT_GOALY
  1226. else
  1227. g_Experience[id] += gcheck * (AMOUNT_GOALY / 2)
  1228.  
  1229. if(gcheck < 5)
  1230. GoalyCheck[id]++
  1231.  
  1232. GoalyCheckDelay[id] = gametime
  1233. }
  1234. else
  1235. GoalyCheck[id] = 0
  1236. return PLUGIN_HANDLED
  1237. }
  1238.  
  1239. /*====================================================================================================
  1240.  [Status Display]
  1241.  
  1242.  Purpose: Displays the Scoreboard information.
  1243.  
  1244.  Comment: $$
  1245.  
  1246. ====================================================================================================*/
  1247. public statusDisplay()
  1248. {
  1249. new id, team, bteam = get_user_team(ballholder>0?ballholder:ballowner)
  1250. new score_t = score[T], score_ct = score[CT]
  1251.  
  1252. new Float:gametime = get_gametime()
  1253.  
  1254. for(id=1; id<=maxplayers; id++) {
  1255. if(is_user_connected(id) && !is_user_bot(id))
  1256. {
  1257. team = get_user_team(id)
  1258. goaly_checker(id, gametime, team)
  1259. if(!is_user_alive(id) && !is_dead[id] && (team == 1 || team == 2) && GetPlayerModel(id) != 0xFF)
  1260. {
  1261. //new Float:ballorig[3], x
  1262. //entity_get_vector(id,EV_VEC_origin,ballorig)
  1263. //for(x=0;x<3;x++)
  1264. // distorig[0][x] = floatround(ballorig[x])
  1265. remove_task(id+1000)
  1266. has_knife[id] = false;
  1267. is_dead[id] = true
  1268. new Float:respawntime = CVAR_RESPAWN
  1269. set_task(respawntime,"AutoRespawn",id)
  1270. set_task((respawntime+0.2), "AutoRespawn2",id)
  1271. }
  1272. if(!winner) {
  1273. set_hudmessage(10, 255, 10, 0.95, 0.20, 0, 1.0, 1.5, 0.1, 0.1, HUD_CHANNEL)
  1274. format(scoreboard,1024,"%i %L^n^n%s - %i : %i - %s ^n%L %i^n^n%s^n^n^n%s",get_pcvar_num(CVAR_SCORE),id,"GOALS_WINS",TeamNames[T],score_t,score_ct,TeamNames[CT],id,"EXPERIENCE",g_Experience[id],temp1,team==bteam?temp2:"")
  1275. show_hudmessage(id,"%s",scoreboard)
  1276. }
  1277. }
  1278. }
  1279. }
  1280.  
  1281. /*====================================================================================================
  1282.  [Touched]
  1283.  
  1284.  Purpose: All touching stuff takes place here.
  1285.  
  1286.  Comment: $$
  1287.  
  1288. ====================================================================================================*/
  1289. public touchWorld(ball, world) {
  1290.  
  1291. if(get_speed(ball) > 10)
  1292. {
  1293. new Float:v[3]
  1294. entity_get_vector(ball, EV_VEC_velocity, v)
  1295.  
  1296. v[0] = (v[0] * 0.85)
  1297. v[1] = (v[1] * 0.85)
  1298. v[2] = (v[2] * 0.85)
  1299. entity_set_vector(ball, EV_VEC_velocity, v)
  1300. emit_sound(ball, CHAN_ITEM, BALL_BOUNCE_GROUND, 1.0, ATTN_NORM, 0, PITCH_NORM)
  1301. }
  1302.  
  1303. return PLUGIN_HANDLED
  1304. }
  1305.  
  1306. public touchPlayer(ball, player) {
  1307.  
  1308. if(is_user_bot(player))
  1309. return PLUGIN_HANDLED
  1310.  
  1311. new playerteam = get_user_team(player)
  1312. if((playerteam != 1 && playerteam != 2))
  1313. return PLUGIN_HANDLED
  1314.  
  1315. remove_task(55555)
  1316.  
  1317. new aname[64], stolen, x
  1318. get_user_name(player,aname,63)
  1319. new ballteam = get_user_team(ballowner)
  1320. if(ballowner > 0 && playerteam != ballteam )
  1321. {
  1322. new speed = get_speed(aball)
  1323. if(speed > 500)
  1324. {
  1325. //configure catching algorithm
  1326. new rnd = random_num(0,100)
  1327. new bstr = (PlayerUpgrades[ballowner][STR] * AMOUNT_STR) / 10
  1328. new dex = (PlayerUpgrades[player][DEX] * AMOUNT_DEX)
  1329. new pct = ( PressedAction[player] ? 40:20 ) + dex
  1330.  
  1331. pct += ( g_sprint[player] ? 5 : 0 ) //player turboing? give 5%
  1332. pct -= ( g_sprint[ballowner] ? 5 : 0 ) //ballowner turboing? lose 5%
  1333. pct -= bstr //ballowner has strength? remove bstr
  1334.  
  1335. //will player avoid damage?
  1336. if( rnd > pct ) {
  1337. new Float:dodmg = (float(speed) / 13.0) + bstr
  1338.  
  1339. print_chatColor(player,"^x04[%s]^x01 %L",CHAT_PREFIX,player,"BALL_SMACKED",aname,floatround(dodmg))
  1340.  
  1341. set_msg_block(gmsgDeathMsg,BLOCK_ONCE)
  1342. fakedamage(player,"AssWhoopin",dodmg,1)
  1343. set_msg_block(gmsgDeathMsg,BLOCK_NOT)
  1344.  
  1345. if(!is_user_alive(player)) {
  1346. message_begin(MSG_ALL, gmsgDeathMsg)
  1347. write_byte(ballowner)
  1348. write_byte(player)
  1349. write_string("AssWhoopin")
  1350. message_end()
  1351.  
  1352. new frags = get_user_frags(ballowner)
  1353. entity_set_float(ballowner, EV_FL_frags, float(frags + 1))
  1354. setScoreInfo(ballowner)
  1355. //set_user_frags(ballowner, get_user_frags(ballowner)+1)
  1356. Event_Record(ballowner, KILL, -1, EXP_KILL)
  1357.  
  1358. print_chatColor(player,"^x04[%s]^x01 %L",CHAT_PREFIX,player,"KILLED_BY_BALL")
  1359. print_chatColor(ballowner,"^x04[%s]^x01 %L",CHAT_PREFIX,ballowner,"EXP_FOR_BALLKILL")
  1360. }
  1361. else {
  1362. new Float:pushVel[3]
  1363. pushVel[0] = velocity[0]
  1364. pushVel[1] = velocity[1]
  1365. pushVel[2] = velocity[2] + ((velocity[2] < 0)?random_float(-200.0,-50.0):random_float(50.0,200.0))
  1366. entity_set_vector(player,EV_VEC_velocity,pushVel)
  1367. }
  1368. for(x=0;x<3;x++)
  1369. velocity[x] = (velocity[x] * random_float(0.1,0.9))
  1370. entity_set_vector(aball,EV_VEC_velocity,velocity)
  1371. direction = 0
  1372. return PLUGIN_HANDLED
  1373. }
  1374. }
  1375.  
  1376. if(speed > 950)
  1377. play_wav(0, STOLE_BALL_FAST)
  1378.  
  1379. new Float:pOrig[3]
  1380. entity_get_vector(player, EV_VEC_origin, pOrig)
  1381. new dist = floatround(get_distance_f(pOrig, TeamBallOrigins[playerteam]))
  1382. new gainedxp
  1383.  
  1384. if(dist < 550) {
  1385. gainedxp = EXP_GOALY + (speed / 8)
  1386. Event_Record(player, STEAL, -1, EXP_GOALY + (speed / 8))
  1387. GoalyPoints[player] += EXP_GOALY/2
  1388. vedesek[player]++
  1389. }
  1390. else {
  1391. gainedxp = EXP_STEAL
  1392. Event_Record(player, STEAL, -1, EXP_STEAL)
  1393. }
  1394.  
  1395. format(temp1,63,"%L",LANG_PLAYER,"STOLE_BALL",TeamNames[playerteam],aname)
  1396. client_print(0,print_console,"%s",temp1)
  1397. stolen = 1
  1398.  
  1399. message_begin(MSG_ONE, gmsgShake, {0,0,0}, player)
  1400. write_short(255 << 12) //ammount
  1401. write_short(1 << 11) //lasts this long
  1402. write_short(255 << 10) //frequency
  1403. message_end()
  1404.  
  1405. print_chatColor(player,"^x04[%s]^x01 %L",CHAT_PREFIX,player,"EXP_FOR_STEAL",gainedxp)
  1406.  
  1407. }
  1408. if(ballholder == 0) {
  1409. emit_sound(aball, CHAN_ITEM, BALL_PICKED_UP, 1.0, ATTN_NORM, 0, PITCH_NORM)
  1410. new msg[64], check
  1411. if(!has_knife[player])
  1412. give_knife(player)
  1413.  
  1414. if(stolen)
  1415. PowerPlay = 0
  1416. else
  1417. format(temp1,63,"%L",LANG_PLAYER,"BALL_PICKUP",TeamNames[playerteam],aname)
  1418.  
  1419. if(((PowerPlay > 1 && powerplay_list[PowerPlay-2] == player) || (PowerPlay > 0 && powerplay_list[PowerPlay-1] == player)) && PowerPlay != MAX_LVL_POWERPLAY)
  1420. check = true
  1421.  
  1422. if(PowerPlay <= MAX_LVL_POWERPLAY && !check) {
  1423. g_Experience[player] += (PowerPlay==2?10:25)
  1424. powerplay_list[PowerPlay] = player
  1425. PowerPlay++
  1426. }
  1427. curvecount = 0
  1428. direction = 0
  1429. GoalyCheck[player] = 0
  1430.  
  1431. format(temp2, 63, "%L %i",LANG_PLAYER,"POWER_PLAY", PowerPlay>0?PowerPlay-1:0)
  1432.  
  1433. ballholder = player
  1434. ballowner = 0
  1435.  
  1436. if(!g_sprint[player])
  1437. set_speedchange(player)
  1438.  
  1439.  
  1440. set_hudmessage(random(100), random(256), random(100), POS_X, 0.4, 1, 1.0, 1.5, 0.1, 0.1, 2)
  1441. format(msg,63,"%L",player,"YOU_HAVE_BALL")
  1442. show_hudmessage(player,"%s",msg)
  1443.  
  1444. //Glow Player who has ball their team color
  1445. beam()
  1446. glow(player, TeamColors[playerteam][0], TeamColors[playerteam][1], TeamColors[playerteam][2], 1)
  1447. }
  1448. return PLUGIN_HANDLED
  1449. }
  1450.  
  1451. public touchNet(ball, goalpost)
  1452. {
  1453. remove_task(55555)
  1454.  
  1455. new team = get_user_team(ballowner)
  1456. new goalent = GoalEnt[team]
  1457. if (goalpost != goalent && ballowner > 0) {
  1458. new aname[64]
  1459. new Float:netOrig[3]
  1460. new netOrig2[3]
  1461.  
  1462. entity_get_vector(ball, EV_VEC_origin,netOrig)
  1463. new l
  1464. for(l=0;l<3;l++)
  1465. netOrig2[l] = floatround(netOrig[l])
  1466. flameWave(netOrig2)
  1467. get_user_name(ballowner,aname,63)
  1468. new frags = get_user_frags(ballowner)
  1469. entity_set_float(ballowner, EV_FL_frags, float(frags + 10))
  1470.  
  1471.  
  1472. /////////////////////SOUNDS CODE HERE///////////
  1473.  
  1474. for(new i;i<32;i++)
  1475. Zene(i)
  1476.  
  1477. /////////////////////ASSIST CODE HERE///////////
  1478.  
  1479. new assisters[4] = { 0, 0, 0, 0 }
  1480. new iassisters = 0
  1481. new ilastplayer = iassist[ team ]
  1482.  
  1483. // We just need the last player to kick the ball
  1484. // 0 means it has passed 15 at least once
  1485. if ( ilastplayer == 0 )
  1486. ilastplayer = 15
  1487. else
  1488. ilastplayer--
  1489.  
  1490. if ( assist[ ilastplayer ] != 0 ) {
  1491. new i, x, bool:canadd, playerid
  1492. for(i=0; i<16; i++) {
  1493. // Stop if we've already found 4 assisters
  1494. if ( iassisters == MAX_ASSISTERS )
  1495. break
  1496. playerid = assist[ i ]
  1497. // Skip if player is invalid
  1498. if ( playerid == 0 )
  1499. continue
  1500. // Skip if kicker is counted as an assister
  1501. if ( playerid == assist[ ilastplayer ] )
  1502. continue
  1503.  
  1504. canadd = true
  1505. // Loop through each assister value
  1506. for(x=0; x<3; x++)
  1507. // make sure we can add them
  1508. if ( playerid == assisters[ x ] ) {
  1509. canadd = false
  1510. break
  1511. }
  1512.  
  1513. // Skip if they've already been added
  1514. if ( canadd == false )
  1515. continue
  1516. // They didn't kick the ball last, and they haven't been added, add them
  1517. assisters[ iassisters++ ] = playerid
  1518. }
  1519. // This gives each person an assist, xp, and prints that out to them
  1520. new c, pass
  1521. for(c=0; c<iassisters; c++) {
  1522. pass = assisters[ c ]
  1523. Event_Record(pass, ASSIST, -1, EXP_ASSIST)
  1524. print_chatColor(pass, "^x04[%s]^x01 %L",CHAT_PREFIX,pass,"EXP_FOR_ASSIST",EXP_ASSIST)
  1525. golpasszok[pass]++
  1526. }
  1527. }
  1528. iassist[ 0 ] = 0
  1529. /////////////////////ASSIST CODE HERE///////////
  1530.  
  1531. for(l=0; l<3; l++)
  1532. distorig[1][l] = floatround(netOrig[l])
  1533. new distshot = ((get_distance(distorig[0],distorig[1])/12)/3)
  1534. new gainedxp = distshot + EXP_GOAL
  1535.  
  1536. format(temp1,63,"%L",LANG_PLAYER,"SCORED_GOAL",TeamNames[team],aname,distshot)
  1537. client_print(0,print_console,"%s",temp1)
  1538.  
  1539.  
  1540. if(distshot > MadeRecord[ballowner][DISTANCE])
  1541. Event_Record(ballowner, DISTANCE, distshot, 0)// record distance, and make that distance exp
  1542.  
  1543. Event_Record(ballowner, GOAL, -1, gainedxp) //zero xp for goal cause distance is what gives it.
  1544.  
  1545. //Increase Score, and update cvar score
  1546. score[team]++
  1547. switch(team) {
  1548. case 1: set_cvar_num("score_ct",score[team])
  1549. case 2: set_cvar_num("score_t",score[team])
  1550. }
  1551. print_chatColor(ballowner,"^x04[%s]^x01 %L",CHAT_PREFIX,ballowner,"EXP_FOR_GOAL",gainedxp+30,distshot)
  1552.  
  1553. golok[ballowner]++
  1554.  
  1555. new oteam = (team == 1 ? 2 : 1)
  1556. increaseTeamXP(team, 30)
  1557. increaseTeamXP(oteam, 15)
  1558. moveBall(0)
  1559.  
  1560. new x
  1561. for(x=1; x<=maxplayers; x++) {
  1562. if(is_user_connected(x))
  1563. {
  1564. Event_Record(x, GOALY, GoalyPoints[x], 0)
  1565. new kills = get_user_frags(x)
  1566. new deaths = cs_get_user_deaths(x)
  1567. setScoreInfo(x)
  1568. if( deaths > 0)
  1569. PlayerDeaths[x] = deaths
  1570. if( kills > 0)
  1571. PlayerKills[x] = kills
  1572. }
  1573. }
  1574.  
  1575. if(score[team] < get_pcvar_num(CVAR_SCORE)) {
  1576. new r = random_num(0,MAX_SOUNDS-1)
  1577. play_wav(0, SCORED_SOUNDS[r]);
  1578.  
  1579. }
  1580. else {
  1581. winner = team
  1582. format(scoreboard,1024,"%L",LANG_PLAYER,"TEAM_WINS",TeamNames[team])
  1583. set_task(1.0,"showhud_winner",0,"",0,"a",3)
  1584. }
  1585.  
  1586. server_cmd("sv_restart 4")
  1587.  
  1588. }
  1589. else if(goalpost == goalent)
  1590. {
  1591. moveBall(0, team)
  1592. print_chatColor(ballowner, "^x04[%s]^x01 %L",CHAT_PREFIX,ballowner, "CANNOT_KICK_GOAL")
  1593. }
  1594. return PLUGIN_HANDLED
  1595. }
  1596.  
  1597. //This is for soccerjam.bsp to fix locker room.
  1598. public touchBlocker(pwnball, blocker) {
  1599. new Float:orig[3] = { 2234.0, 1614.0, 1604.0 }
  1600. entity_set_origin(pwnball, orig)
  1601. }
  1602.  
  1603. /*====================================================================================================
  1604.  [Events]
  1605.  
  1606.  Purpose: $$
  1607.  
  1608.  Comment: $$
  1609.  
  1610. ====================================================================================================*/
  1611. //public Event_DeathMsg() {
  1612. // new id = read_data(2)
  1613. // strip_user_weapons(id);
  1614. //}
  1615.  
  1616. public Event_Damage()
  1617. {
  1618. new victim = read_data(0)
  1619. new attacker = get_user_attacker(victim)
  1620. if(is_user_alive(attacker)) {
  1621. if(is_user_alive(victim) ) {
  1622.  
  1623. #if !defined KNIFE_DISARM_ON
  1624. if(victim == ballholder) {
  1625. #endif
  1626. new upgrade = PlayerUpgrades[attacker][DISARM]
  1627. if(upgrade) {
  1628. new disarm = upgrade * AMOUNT_DISARM
  1629. new disarmpct = BASE_DISARM + (victim==ballholder?(disarm*2):0)
  1630. new rand = random_num(1,100)
  1631.  
  1632. if(disarmpct >= rand)
  1633. {
  1634. new vname[32], aname[32]
  1635. get_user_name(victim,vname,31)
  1636. get_user_name(attacker,aname,31)
  1637.  
  1638. #if defined KNIFE_DISARM_ON
  1639. if(victim == ballholder) {
  1640. #endif
  1641. kickBall(victim, 1)
  1642. print_chatColor(attacker,"^x04[%s]^x01 %L",CHAT_PREFIX,attacker,"DISARM_BALL_ATTACKER",vname)
  1643. print_chatColor(victim,"^x04[%s]^x01 %L",CHAT_PREFIX,victim,"DISARM_BALL_VICTIM",aname)
  1644. #if defined KNIFE_DISARM_ON
  1645. }
  1646. else {
  1647. new weapon, clip, ammo
  1648. weapon = get_user_weapon(victim,clip,ammo)
  1649. if(weapon == CSW_KNIFE)
  1650. {
  1651. strip_user_weapons(victim);
  1652. has_knife[victim] = false;
  1653. set_task(float(disarm / DISARM_MULTIPLIER), "give_knife", victim+1000)
  1654. print_chatColor(attacker,"^x04[%s]^x01 %L",CHAT_PREFIX,attacker,"DISARM_KNIFE_ATTACKER",vname)
  1655. print_chatColor(victim,"^x04[%s]^x01 %L",CHAT_PREFIX,victim,"DISARM_KNIFE_VICTIM",aname)
  1656. }
  1657. }
  1658. #endif
  1659. }
  1660. }
  1661. #if !defined KNIFE_DISARM_ON
  1662. }
  1663. #endif
  1664. }
  1665. else
  1666. g_Experience[attacker] += (EXP_KILL/2)
  1667. }
  1668. }
  1669.  
  1670. public Event_StartRound()
  1671. {
  1672. g_TimeLimit = get_cvar_num("mp_timelimit");
  1673. if(winner)
  1674. {
  1675. set_task(1.0,"displayWinnerAwards",0)
  1676.  
  1677. //MP_TIMELIMIT replication
  1678. new Float:gtime = float(g_TimeLimit) - (get_gametime() / 60.0);
  1679.  
  1680.  
  1681.  
  1682. if( g_TimeLimit && gtime <= 0.0 )
  1683. {
  1684. //Fix for Map Vote plugins (2 min marker).
  1685. new bool:check;
  1686. if(cvar_exists("amx_extendmap_max"))
  1687. check = true;
  1688.  
  1689. server_cmd("mp_timelimit %i", (check ? 2 : 1));
  1690. set_task(10.0, "CheckExtendMap", 555666, "", 0, "b");
  1691. }
  1692. else
  1693. {
  1694. /*switch(random(2))
  1695. {
  1696. case 0: set_task(10.0,"PostGame",0)
  1697. case 1: */server_cmd("mp_timelimit 2")
  1698. //}
  1699. }
  1700. }
  1701. else
  1702. SetupRound()
  1703. }
  1704.  
  1705. public CheckExtendMap() {
  1706.  
  1707. new timelimit = get_cvar_num("mp_timelimit");
  1708. if(timelimit > g_TimeLimit) {
  1709. PostGame();
  1710. remove_task(555666);
  1711. }
  1712. }
  1713.  
  1714. public SetupRound() {
  1715.  
  1716. iassist[ 0 ] = 0
  1717.  
  1718. if(!is_valid_ent(aball))
  1719. createball()
  1720.  
  1721. moveBall(1)
  1722.  
  1723. new id
  1724. for(id=1; id<=maxplayers; id++) {
  1725. if(is_user_connected(id) && !is_user_bot(id)) {
  1726. is_dead[id] = false
  1727. seconds[id] = 0
  1728. g_sprint[id] = 0
  1729. PressedAction[id] = 0
  1730. }
  1731. }
  1732. play_wav(0, ROUND_START)
  1733.  
  1734. set_task(0.5, "PostSetupRound", 0)
  1735. set_task(1.0, "PostPostSetupRound", 0)
  1736.  
  1737. return PLUGIN_HANDLED
  1738. }
  1739.  
  1740. public PostSetupRound() {
  1741. new id
  1742. for(id=1; id<=maxplayers; id++)
  1743. if(is_user_alive(id) && !is_user_bot(id))
  1744. give_knife(id)
  1745. }
  1746.  
  1747. public PostPostSetupRound() {
  1748. new id, kills, deaths
  1749. for(id=1; id<=maxplayers; id++) {
  1750. if(is_user_connected(id) && !is_user_bot(id)) {
  1751. kills = PlayerKills[id]
  1752. deaths = PlayerDeaths[id]
  1753. if(kills)
  1754. entity_set_float(id, EV_FL_frags, float(kills))
  1755. if(deaths)
  1756. cs_set_user_deaths(id,deaths)
  1757.  
  1758. setScoreInfo(id)
  1759. }
  1760. }
  1761. }
  1762.  
  1763. public Event_ResetHud(id) {
  1764. goaldied[id] = 0
  1765. set_task(1.0,"PostResetHud",id)
  1766. }
  1767.  
  1768. public PostResetHud(id) {
  1769. if(is_user_alive(id) && !is_user_bot(id))
  1770. {
  1771. new stam = PlayerUpgrades[id][STA]
  1772.  
  1773. if(!has_knife[id]) {
  1774. give_knife(id)
  1775. }
  1776.  
  1777. //compensate for our turbo
  1778. if(!g_sprint[id])
  1779. set_speedchange(id)
  1780.  
  1781. if(stam > 0)
  1782. entity_set_float(id, EV_FL_health, float(BASE_HP + (stam * AMOUNT_STA)))
  1783. }
  1784. }
  1785.  
  1786. /*====================================================================================================
  1787.  [Client Commands]
  1788.  
  1789.  Purpose: $$
  1790.  
  1791.  Comment: $$
  1792.  
  1793. ====================================================================================================*/
  1794. public Turbo(id)
  1795. {
  1796. if(is_user_alive(id))
  1797. g_sprint[id] = 1
  1798. return PLUGIN_HANDLED
  1799. }
  1800.  
  1801. public client_PreThink(id)
  1802. {
  1803. if( is_kickball && is_valid_ent(aball) && is_user_connected(id))
  1804. {
  1805. new button = entity_get_int(id, EV_INT_button)
  1806. new usekey = (button & IN_USE)
  1807. new up = (button & IN_FORWARD)
  1808. new down = (button & IN_BACK)
  1809. new moveright = (button & IN_MOVERIGHT)
  1810. new moveleft = (button & IN_MOVELEFT)
  1811. new jump = (button & IN_JUMP)
  1812. new flags = entity_get_int(id, EV_INT_flags)
  1813. new onground = flags & FL_ONGROUND
  1814. if( (moveright || moveleft) && !up && !down && jump && onground && !g_sprint[id] && id != ballholder)
  1815. SideJump[id] = 1
  1816.  
  1817. if(g_sprint[id])
  1818. entity_set_float(id, EV_FL_fuser2, 0.0)
  1819.  
  1820. if( id != ballholder )
  1821. PressedAction[id] = usekey
  1822. else {
  1823. if( usekey && !PressedAction[id]) {
  1824. kickBall(ballholder, 0)
  1825. }
  1826. else if( !usekey && PressedAction[id])
  1827. PressedAction[id] = 0
  1828. }
  1829.  
  1830. /****************************************************************** FRAG O NO FRAG ************************************************************************/
  1831. new auxiliar = get_pcvar_num(CVAR_FRAG)
  1832. if(!auxiliar)
  1833. {
  1834. if( id != ballholder && (button & IN_ATTACK || button & IN_ATTACK2) )
  1835. {
  1836. /****************************************************************** FRAG EN AREA ************************************************************************/
  1837. static Float:maxdistance
  1838. static Float:maxdistancem
  1839. static ferencere
  1840. static distancemax
  1841.  
  1842. new fteam = get_user_team(id)
  1843.  
  1844. distancemax = Mascots[fteam]
  1845. maxdistancem = 0.0
  1846.  
  1847. if(ballholder > 0)
  1848. {
  1849. ferencere = ballholder
  1850. maxdistance = 96.0
  1851. }
  1852. else {
  1853. ferencere = aball
  1854. maxdistance = 200.0
  1855. }
  1856.  
  1857. if(!maxdistance)
  1858. return
  1859.  
  1860. if(entity_range(id, ferencere) > maxdistance && entity_range(id, distancemax) > maxdistancem)
  1861. entity_set_int(id, EV_INT_button, (button & ~IN_ATTACK) & ~IN_ATTACK2)
  1862. }
  1863. }
  1864. }
  1865. }
  1866.  
  1867. public client_PostThink(id) {
  1868. if(is_kickball && is_user_connected(id)) {
  1869. new Float:gametime = get_gametime()
  1870. new button = entity_get_int(id, EV_INT_button)
  1871.  
  1872. new up = (button & IN_FORWARD)
  1873. new down = (button & IN_BACK)
  1874. new moveright = (button & IN_MOVERIGHT)
  1875. new moveleft = (button & IN_MOVELEFT)
  1876. new jump = (button & IN_JUMP)
  1877. new Float:vel[3]
  1878.  
  1879. entity_get_vector(id,EV_VEC_velocity,vel)
  1880.  
  1881. if( (gametime - SideJumpDelay[id] > 5.0) && SideJump[id] && jump && (moveright || moveleft) && !up && !down) {
  1882.  
  1883. vel[0] *= 2.0
  1884. vel[1] *= 2.0
  1885. vel[2] = 300.0
  1886.  
  1887. entity_set_vector(id,EV_VEC_velocity,vel)
  1888. SideJump[id] = 0
  1889. SideJumpDelay[id] = gametime
  1890. }
  1891. else
  1892. SideJump[id] = 0
  1893. }
  1894. }
  1895.  
  1896. public kickBall(id, velType)
  1897. {
  1898. remove_task(55555)
  1899. set_task(get_pcvar_float(CVAR_RESET),"clearBall",55555)
  1900.  
  1901. new team = get_user_team(id)
  1902. new a,x
  1903.  
  1904. //Give it some lift
  1905. ball_infront(id, 55.0)
  1906.  
  1907. testorigin[2] += 10
  1908.  
  1909. new Float:tempO[3], Float:returned[3]
  1910. new Float:dist2
  1911.  
  1912. entity_get_vector(id, EV_VEC_origin, tempO)
  1913. new tempEnt = trace_line( id, tempO, testorigin, returned )
  1914.  
  1915. dist2 = get_distance_f(testorigin, returned)
  1916.  
  1917. //ball_infront(id, 55.0)
  1918.  
  1919. if( point_contents(testorigin) != CONTENTS_EMPTY || (!is_user_connected(tempEnt) && dist2 ) )//|| tempDist < 65)
  1920. return PLUGIN_HANDLED
  1921. else
  1922. {
  1923. //Check Make sure our ball isnt inside a wall before kicking
  1924. new Float:ballF[3], Float:ballR[3], Float:ballL[3]
  1925. new Float:ballB[3], Float:ballTR[3], Float:ballTL[3]
  1926. new Float:ballBL[3], Float:ballBR[3]
  1927.  
  1928. for(x=0; x<3; x++) {
  1929. ballF[x] = testorigin[x]; ballR[x] = testorigin[x];
  1930. ballL[x] = testorigin[x]; ballB[x] = testorigin[x];
  1931. ballTR[x] = testorigin[x]; ballTL[x] = testorigin[x];
  1932. ballBL[x] = testorigin[x]; ballBR[x] = testorigin[x];
  1933. }
  1934.  
  1935. for(a=1; a<=6; a++) {
  1936.  
  1937. ballF[1] += 3.0; ballB[1] -= 3.0;
  1938. ballR[0] += 3.0; ballL[0] -= 3.0;
  1939.  
  1940. ballTL[0] -= 3.0; ballTL[1] += 3.0;
  1941. ballTR[0] += 3.0; ballTR[1] += 3.0;
  1942. ballBL[0] -= 3.0; ballBL[1] -= 3.0;
  1943. ballBR[0] += 3.0; ballBR[1] -= 3.0;
  1944.  
  1945. if(point_contents(ballF) != CONTENTS_EMPTY || point_contents(ballR) != CONTENTS_EMPTY ||
  1946. point_contents(ballL) != CONTENTS_EMPTY || point_contents(ballB) != CONTENTS_EMPTY ||
  1947. point_contents(ballTR) != CONTENTS_EMPTY || point_contents(ballTL) != CONTENTS_EMPTY ||
  1948. point_contents(ballBL) != CONTENTS_EMPTY || point_contents(ballBR) != CONTENTS_EMPTY)
  1949. return PLUGIN_HANDLED
  1950. }
  1951.  
  1952. new ent = -1
  1953. testorigin[2] += 35.0
  1954.  
  1955. while((ent = find_ent_in_sphere(ent, testorigin, 35.0)) != 0) {
  1956. if(ent > maxplayers)
  1957. {
  1958. new classname[32]
  1959. entity_get_string(ent, EV_SZ_classname, classname, 31)
  1960.  
  1961. if((contain(classname, "goalnet") != -1 || contain(classname, "func_") != -1) &&
  1962. !equal(classname, "func_water") && !equal(classname, "func_illusionary"))
  1963. return PLUGIN_HANDLED
  1964. }
  1965. }
  1966. testorigin[2] -= 35.0
  1967.  
  1968. }
  1969.  
  1970. new kickVel
  1971. if(!velType)
  1972. {
  1973. new str = (PlayerUpgrades[id][STR] * AMOUNT_STR) + (AMOUNT_POWERPLAY*(PowerPlay*5))
  1974. kickVel = get_pcvar_num(CVAR_KICK) + str
  1975. kickVel += g_sprint[id] * 100
  1976.  
  1977. if(direction) {
  1978. entity_get_vector(id, EV_VEC_angles, BallSpinDirection)
  1979. curvecount = CURVE_COUNT
  1980. }
  1981. }
  1982. else {
  1983. curvecount = 0
  1984. direction = 0
  1985. kickVel = random_num(100, 600)
  1986. }
  1987.  
  1988. new Float:ballorig[3]
  1989. entity_get_vector(id,EV_VEC_origin,ballorig)
  1990. for(x=0; x<3; x++)
  1991. distorig[0][x] = floatround(ballorig[x])
  1992.  
  1993. velocity_by_aim(id, kickVel, velocity)
  1994.  
  1995. for(x=0; x<3; x++)
  1996. distorig[0][x] = floatround(ballorig[x])
  1997.  
  1998. /////////////////////WRITE ASSIST CODE HERE IF NEEDED///////////
  1999. if ( iassist[ 0 ] == team ) {
  2000. if ( iassist[ team ] == 15 )
  2001. iassist[ team ] = 0
  2002. }
  2003. else {
  2004. // clear the assist list
  2005. new ind
  2006. for(ind = 0; ind < 16; ind++ )
  2007. assist[ ind ] = 0
  2008. // clear the assist index
  2009. iassist[ team ] = 0
  2010. // set which team to track
  2011. iassist[ 0 ] = team
  2012. }
  2013. assist[ iassist[ team ]++ ] = id
  2014. /////////////////////WRITE ASSIST CODE HERE IF NEEDED///////////
  2015.  
  2016. ballowner = id
  2017. ballholder = 0
  2018. entity_set_origin(aball,testorigin)
  2019. entity_set_vector(aball,EV_VEC_velocity,velocity)
  2020.  
  2021. set_task(CURVE_TIME*2, "CurveBall", id)
  2022.  
  2023. emit_sound(aball, CHAN_ITEM, BALL_KICKED, 1.0, ATTN_NORM, 0, PITCH_NORM)
  2024.  
  2025. glow(id,0,0,0,0)
  2026.  
  2027. beam()
  2028.  
  2029. new aname[64]
  2030. get_user_name(id,aname,63)
  2031.  
  2032. if(!g_sprint[id])
  2033. set_speedchange(id)
  2034.  
  2035. format(temp1,63,"%L",LANG_PLAYER,"KICKED_BALL",TeamNames[team],aname)
  2036. client_print(0,print_console,"%s",temp1)
  2037. return PLUGIN_HANDLED
  2038. }
  2039.  
  2040. /*====================================================================================================
  2041.  [Command Blocks]
  2042.  
  2043.  Purpose: $$
  2044.  
  2045.  Comment: $$
  2046.  
  2047. ====================================================================================================*/
  2048. public client_kill(id) {
  2049. if(is_kickball)
  2050. return PLUGIN_HANDLED
  2051. return PLUGIN_CONTINUE
  2052. }
  2053.  
  2054. public client_command(id) {
  2055. if(!is_kickball) return PLUGIN_CONTINUE
  2056. new arg[13]
  2057. read_argv( 0, arg , 12 )
  2058.  
  2059. if ( equal("buy",arg) || equal("autobuy",arg) )
  2060. return PLUGIN_HANDLED
  2061.  
  2062. return PLUGIN_CONTINUE
  2063. }
  2064.  
  2065. //fix for an exploit.
  2066. public menuclass(id) {
  2067.  
  2068. // They changed teams
  2069. SetPlayerModel(id, 0xFF);
  2070. }
  2071.  
  2072. GetPlayerModel(id)
  2073. {
  2074. if(!is_user_connected(id))
  2075. return 0;
  2076.  
  2077. return get_pdata_int(id, OFFSET_INTERNALMODEL, 5);
  2078. }
  2079.  
  2080. SetPlayerModel(id, int)
  2081. {
  2082. if(!is_user_connected(id))
  2083. return;
  2084.  
  2085. set_pdata_int(id, OFFSET_INTERNALMODEL, int, 5);
  2086. }
  2087.  
  2088. public team_select(id, key) {
  2089. if(is_kickball) {
  2090. new team = get_user_team(id)
  2091. //SetPlayerModel(id, 0xFF);
  2092. if( (team == 1 || team == 2) && (key == team-1) )
  2093. {
  2094. new message[64]
  2095. format(message, 63, "%L",id,"CANT_REJOIN_TEAM")
  2096.  
  2097. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("StatusText"), {0, 0, 0}, id)
  2098. write_byte(0)
  2099. write_string(message)
  2100. message_end()
  2101.  
  2102. engclient_cmd(id,"chooseteam")
  2103.  
  2104. return PLUGIN_HANDLED
  2105. }
  2106. }
  2107. return PLUGIN_CONTINUE
  2108. }
  2109.  
  2110. public fullupdate(id)
  2111. return PLUGIN_HANDLED
  2112.  
  2113. /*====================================================================================================
  2114.  [Upgrades]
  2115.  
  2116.  Purpose: This handles the upgrade menu.
  2117.  
  2118.  Comment: $$
  2119.  
  2120. ====================================================================================================*/
  2121. public BuyUpgrade(id) {
  2122.  
  2123. new level[65], num[11], mTitle[101]//, max_count
  2124. format(mTitle,100,"%L",id,"MENU_TITLE")
  2125.  
  2126. menu_upgrade[id] = menu_create(mTitle, "Upgrade_Handler")
  2127. new x
  2128. for(x=1; x<=UPGRADES; x++)
  2129. {
  2130. new price = ((PlayerUpgrades[id][x] * UpgradePrice[x]) / 2) + UpgradePrice[x]
  2131. if((PlayerUpgrades[id][x] + 1) > UpgradeMax[x]) {
  2132. //max_count++
  2133. format(level,64,"\r%s %L",UpgradeTitles[x],id,"MENU_CHOICE_MAXED",UpgradeMax[x])
  2134. }
  2135. else {
  2136. format(level,64,"%s \y%L \w-- \y%i TP",UpgradeTitles[x], id, "MENU_CHOICE_NEXT", PlayerUpgrades[id][x]+1, price)
  2137. }
  2138. format(num, 10,"%i",x)
  2139. menu_additem(menu_upgrade[id], level, num, 0)
  2140. }
  2141.  
  2142. menu_addblank(menu_upgrade[id], (UPGRADES+1))
  2143. menu_setprop(menu_upgrade[id], MPROP_EXIT, MEXIT_NORMAL)
  2144.  
  2145. menu_display(id, menu_upgrade[id], 0)
  2146. return PLUGIN_HANDLED
  2147. }
  2148.  
  2149. public Upgrade_Handler(id, menu, item) {
  2150.  
  2151. if(item == MENU_EXIT)
  2152. return PLUGIN_HANDLED
  2153.  
  2154. new cmd[6], iName[64]
  2155. new access, callback
  2156. menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
  2157.  
  2158. new upgrade = str_to_num(cmd)
  2159.  
  2160. new playerupgrade = PlayerUpgrades[id][upgrade]
  2161. new price = ((playerupgrade * UpgradePrice[upgrade]) / 2) + UpgradePrice[upgrade]
  2162. new maxupgrade = UpgradeMax[upgrade]
  2163.  
  2164. if(playerupgrade != maxupgrade && playerupgrade != maxupgrade+MAX_LVL_BONUS)
  2165. {
  2166. new needed = g_Experience[id] - price
  2167.  
  2168. if( (needed >= 0) )
  2169. {
  2170. if(playerupgrade < maxupgrade-1)
  2171. playerupgrade += 1
  2172. else
  2173. playerupgrade += MAX_LVL_BONUS+1
  2174.  
  2175. g_Experience[id] -= price
  2176.  
  2177. if(playerupgrade < maxupgrade)
  2178. print_chatColor(id,"^x04[%s]^x01 %L",CHAT_PREFIX,id,"MENU_UPGRADED",playerupgrade,UpgradeTitles[upgrade],price)
  2179. else {
  2180. #if(MAX_LVL_BONUS > 1)
  2181. print_chatColor(id,"^x04[%s]^x01 %L",CHAT_PREFIX,id,"MENU_MAX_LVL_BONUS",maxupgrade,MAX_LVL_BONUS)
  2182. #else
  2183. print_chatColor(id,"^x04[%s]^x01 %L",CHAT_PREFIX,id,"MENU_MAX_LVL",maxupgrade)
  2184. #endif
  2185.  
  2186. play_wav(id, UPGRADED_MAX_LEVEL)
  2187. }
  2188. switch(upgrade) {
  2189. case STA: {
  2190. new stam = playerupgrade * AMOUNT_STA
  2191. entity_set_float(id, EV_FL_health, float(BASE_HP + stam))
  2192. }
  2193. case AGI: {
  2194. if(!g_sprint[id])
  2195. set_speedchange(id)
  2196. }
  2197. }
  2198. PlayerUpgrades[id][upgrade] = playerupgrade
  2199. }
  2200. else
  2201. print_chatColor(id,"^x04[%s]^x01 %L",CHAT_PREFIX,id,"MENU_MISSING_EXP",(needed * -1),(playerupgrade+1),UpgradeTitles[upgrade])
  2202. }
  2203. else {
  2204. print_chatColor(id,"^x04[%s]^x01 %L",CHAT_PREFIX,id,"MENU_UPGRADE_MAXED",UpgradeTitles[upgrade],maxupgrade)
  2205. }
  2206. return PLUGIN_HANDLED
  2207. }
  2208.  
  2209. /*====================================================================================================
  2210.  [Meters]
  2211.  
  2212.  Purpose: This controls the turbo meter and curve angle meter.
  2213.  
  2214.  Comment: $$
  2215.  
  2216. ====================================================================================================*/
  2217. public meter()
  2218. {
  2219. new id
  2220. new turboTitle[32]
  2221. new sprintText[128], sec
  2222. new r, g, b, team
  2223. new len, x
  2224. new ndir = -(DIRECTIONS)
  2225. format(turboTitle,31,"%L",LANG_PLAYER,"TURBO_TITLE");
  2226. for(id=1; id<=maxplayers; id++)
  2227. {
  2228. if(!is_user_connected(id) || !is_user_alive(id) || is_user_bot(id))
  2229. continue
  2230.  
  2231. sec = seconds[id]
  2232. team = get_user_team(id)
  2233. r = TeamMeterColors[team][0]
  2234. g = TeamMeterColors[team][1]
  2235. b = TeamMeterColors[team][2]
  2236.  
  2237. if(id == ballholder) {
  2238.  
  2239. set_hudmessage(r, g, b, POS_X, 0.75, 0, 0.0, 0.6, 0.0, 0.0, 1)
  2240.  
  2241. len = format(sprintText, 127, " %L ^n[",id,"CURVE_TITLE")
  2242.  
  2243. for(x=DIRECTIONS; x>=ndir; x--)
  2244. if(x==0)
  2245. len += format(sprintText[len], 127-len, "%s%s",direction==x?"0":"+", x==ndir?"]":" ")
  2246. else
  2247. len += format(sprintText[len], 127-len, "%s%s",direction==x?"0":"=", x==ndir?"]":" ")
  2248.  
  2249. show_hudmessage(id, "%s", sprintText)
  2250. }
  2251.  
  2252. set_hudmessage(r, g, b, POS_X, POS_Y, 0, 0.0, 0.6, 0.0, 0.0, 3)
  2253.  
  2254. if(sec > 30) {
  2255. sec -= 2
  2256. format(sprintText, 127, " %s ^n[==============]",turboTitle)
  2257. set_speedchange(id)
  2258. g_sprint[id] = 0
  2259. }
  2260. else if(sec >= 0 && sec < 30 && g_sprint[id]) {
  2261. sec += 2
  2262. set_speedchange(id, 100.0)
  2263. }
  2264.  
  2265. switch(sec) {
  2266. case 0: format(sprintText, 127, " %s ^n[||||||||||||||]",turboTitle)
  2267. case 2: format(sprintText, 127, " %s ^n[|||||||||||||=]",turboTitle)
  2268. case 4: format(sprintText, 127, " %s ^n[||||||||||||==]",turboTitle)
  2269. case 6: format(sprintText, 127, " %s ^n[|||||||||||===]",turboTitle)
  2270. case 8: format(sprintText, 127, " %s ^n[||||||||||====]",turboTitle)
  2271. case 10: format(sprintText, 127, " %s ^n[|||||||||=====]",turboTitle)
  2272. case 12: format(sprintText, 127, " %s ^n[||||||||======]",turboTitle)
  2273. case 14: format(sprintText, 127, " %s ^n[|||||||=======]",turboTitle)
  2274. case 16: format(sprintText, 127, " %s ^n[||||||========]",turboTitle)
  2275. case 18: format(sprintText, 127, " %s ^n[|||||=========]",turboTitle)
  2276. case 20: format(sprintText, 127, " %s ^n[||||==========]",turboTitle)
  2277. case 22: format(sprintText, 127, " %s ^n[|||===========]",turboTitle)
  2278. case 24: format(sprintText, 127, " %s ^n[||============]",turboTitle)
  2279. case 26: format(sprintText, 127, " %s ^n[|=============]",turboTitle)
  2280. case 28: format(sprintText, 127, " %s ^n[==============]",turboTitle)
  2281. case 30: {
  2282. format(sprintText, 128, " %s ^n[==============]",turboTitle)
  2283. sec = 92
  2284. }
  2285. case 32: sec = 0
  2286. }
  2287.  
  2288. seconds[id] = sec
  2289. show_hudmessage(id,"%s",sprintText)
  2290. }
  2291. }
  2292.  
  2293. /*====================================================================================================
  2294.  [Misc.]
  2295.  
  2296.  Purpose: $$
  2297.  
  2298.  Comment: $$
  2299.  
  2300. ====================================================================================================*/
  2301. set_speedchange(id, Float:speed=0.0)
  2302. {
  2303. new Float:agi = float( (PlayerUpgrades[id][AGI] * AMOUNT_AGI) + (id==ballholder?(AMOUNT_POWERPLAY * (PowerPlay*2)):0) )
  2304. agi += (BASE_SPEED + speed)
  2305. entity_set_float(id,EV_FL_maxspeed, agi)
  2306. }
  2307.  
  2308. public give_knife(id) {
  2309. if(id > 1000)
  2310. id -= 1000
  2311.  
  2312. remove_task(id+1000)
  2313.  
  2314. give_item(id, "weapon_knife")
  2315. has_knife[id] = true;
  2316. }
  2317.  
  2318. Event_Record(id, recordtype, amt, exp) {
  2319. if(amt == -1)
  2320. MadeRecord[id][recordtype]++
  2321. else
  2322. MadeRecord[id][recordtype] = amt
  2323.  
  2324. new playerRecord = MadeRecord[id][recordtype]
  2325. if(playerRecord > TopPlayer[1][recordtype])
  2326. {
  2327. TopPlayer[0][recordtype] = id
  2328. TopPlayer[1][recordtype] = playerRecord
  2329. new name[MAX_NAME_LENGTH+1]
  2330. get_user_name(id,name,MAX_NAME_LENGTH)
  2331. format(TopPlayerName[recordtype],MAX_NAME_LENGTH,"%s",name)
  2332. }
  2333. g_Experience[id] += exp
  2334. }
  2335.  
  2336. Float:normalize(Float:nVel)
  2337. {
  2338. if(nVel > 360.0) {
  2339. nVel -= 360.0
  2340. }
  2341. else if(nVel < 0.0) {
  2342. nVel += 360.0
  2343. }
  2344.  
  2345. return nVel
  2346. }
  2347.  
  2348. public editTextMsg()
  2349. {
  2350. new string[64], radio[64]
  2351. get_msg_arg_string(2, string, 63)
  2352.  
  2353. if( get_msg_args() > 2 )
  2354. get_msg_arg_string(3, radio, 63)
  2355.  
  2356. if(containi(string, "#Game_will_restart") != -1 || containi(radio, "#Game_radio") != -1)
  2357. return PLUGIN_HANDLED
  2358.  
  2359. return PLUGIN_CONTINUE
  2360. }
  2361.  
  2362. public client_connect(id)
  2363. {
  2364. betoltes(id)
  2365. if(is_kickball)
  2366. set_user_info(id,"_vgui_menus","0")
  2367.  
  2368. korvegi[id] = true
  2369. }
  2370.  
  2371. public AutoRespawn(id)
  2372. if(is_dead[id] && is_user_connected(id)) {
  2373. new team = get_user_team(id)
  2374. if(team == 1 || team == 2) {
  2375. spawn(id)
  2376.  
  2377. }
  2378. else
  2379. is_dead[id] = false
  2380. }
  2381.  
  2382. public AutoRespawn2(id)
  2383. if(is_dead[id] && is_user_connected(id)) {
  2384. new team = get_user_team(id)
  2385. if(team == 1 || team == 2) {
  2386. spawn(id)
  2387. if(!has_knife[id])
  2388. give_knife(id)
  2389. }
  2390. //strip_user_weapons(id)
  2391. is_dead[id] = false
  2392. }
  2393.  
  2394. play_wav(id, wav[])
  2395. client_cmd(id,"spk %s",wav)
  2396.  
  2397. cmdSpectate(id)
  2398. {
  2399. engclient_cmd(id, "jointeam", "6")
  2400. }
  2401.  
  2402. increaseTeamXP(team, amt) {
  2403. new id
  2404. for(id=1; id<=maxplayers; id++)
  2405. if(get_user_team(id) == team && is_user_connected(id))
  2406. g_Experience[id] += amt
  2407. }
  2408.  
  2409. setScoreInfo(id) {
  2410. message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));
  2411. write_byte(id);
  2412. write_short(get_user_frags(id));
  2413. write_short(cs_get_user_deaths(id));
  2414. write_short(0);
  2415. write_short(get_user_team(id));
  2416. message_end();
  2417. }
  2418.  
  2419. // Erase our current temps (used for ball events)
  2420. public eraser(num) {
  2421. if(num == 3333)
  2422. format(temp1,63,"")
  2423. if(num == 4444)
  2424. format(temp2,63,"")
  2425. return PLUGIN_HANDLED
  2426. }
  2427. /*====================================================================================================
  2428.  [Cleanup]
  2429.  
  2430.  Purpose: $$
  2431.  
  2432.  Comment: $$
  2433.  
  2434. ====================================================================================================*/
  2435. public client_disconnect(id) {
  2436. if(is_kickball) {
  2437. new x
  2438. for(x = 1; x<=RECORDS; x++)
  2439. MadeRecord[id][x] = 0
  2440. remove_task(id)
  2441. if(ballholder == id ) {
  2442. ballholder = 0
  2443. clearBall()
  2444. }
  2445. if(ballowner == id) {
  2446. ballowner = 0
  2447. }
  2448.  
  2449. GoalyPoints[id] = 0
  2450. PlayerKills[id] = 0
  2451. PlayerDeaths[id] = 0
  2452. is_dead[id] = false
  2453. seconds[id] = 0
  2454. g_sprint[id] = 0
  2455. PressedAction[id] = 0
  2456. has_knife[id] = false;
  2457. g_Experience[id] = 0
  2458.  
  2459. for(x=1; x<=UPGRADES; x++)
  2460. PlayerUpgrades[id][x] = 0
  2461.  
  2462. mentes(id)
  2463. }
  2464. }
  2465.  
  2466. cleanup() {
  2467. new x, id, m
  2468. for(x=1;x<=RECORDS;x++) {
  2469. TopPlayer[0][x] = 0
  2470. TopPlayer[1][x] = 0
  2471. TopPlayerName[x][0] = 0
  2472. }
  2473.  
  2474. for(id=1;id<=maxplayers;id++) {
  2475. PlayerDeaths[id] = 0
  2476. PlayerKills[id] = 0
  2477.  
  2478. //UsedExp[id] = 0
  2479. g_Experience[id] = 0
  2480.  
  2481. for(x=1;x<=UPGRADES;x++)
  2482. PlayerUpgrades[id][x] = 0
  2483.  
  2484. for(m = 1; m<=RECORDS; m++)
  2485. MadeRecord[id][m] = 0
  2486. }
  2487.  
  2488. PowerPlay = 0
  2489. winner = 0
  2490. score[T] = 0
  2491. score[CT] = 0
  2492. set_cvar_num("score_ct",0)
  2493. set_cvar_num("score_t",0)
  2494.  
  2495. for(x = 0;x<=cntCT;x++)
  2496. ct[x] = 0
  2497.  
  2498. for(x = 0; x<= cntT; x++)
  2499. terr[x] = 0
  2500.  
  2501. cntCT = 0
  2502. cntT = 0
  2503. }
  2504.  
  2505. /*====================================================================================================
  2506.  [Help]
  2507.  
  2508.  Purpose: $$
  2509.  
  2510.  Comment: $$
  2511.  
  2512. ====================================================================================================*/
  2513. public client_putinserver(id) {
  2514. if(is_kickball) {
  2515. set_task(6.0,"soccerjamHelp", id)
  2516. set_task(10.0,"ShowStatom", id)
  2517. }
  2518. }
  2519.  
  2520. public soccerjamHelp(id)
  2521. {
  2522. client_cmd(id, "cl_forwardspeed 1000")
  2523. client_cmd(id, "cl_backspeed 1000")
  2524. client_cmd(id, "cl_sidespeed 1000")
  2525. LateJoinExp(id)
  2526.  
  2527. new name[32]
  2528. get_user_name(id,name,31)
  2529.  
  2530. print_chatColor(id, "^x04[%s]^x03 SoccerJam v2.07a", CHAT_PREFIX)
  2531. print_chatColor(id, "^x04[%s]^x01 Mod by^x03 %s^x04 -^x01 Edit by^x03 AltaiR", CHAT_PREFIX, AUTHOR)
  2532. print_chatColor(id, "^x04[%s]^x01 Szia ^x03%s^x01! Segítségért írd be ^x03/help", CHAT_PREFIX, name)
  2533. }
  2534.  
  2535. /*====================================================================================================
  2536.  [Stat]
  2537.  
  2538.  Purpose: $$
  2539.  
  2540.  Comment: $$
  2541.  
  2542. ====================================================================================================*/
  2543.  
  2544. public ShowStatom(id)
  2545. {
  2546. print_chatColor(id, "^x04[%s]^x01 Góljaid: ^x04%i ^x01| Gólpasszaid: ^x04%i ^x01| Védéseid: ^x04%i", CHAT_PREFIX, golok[id], golpasszok[id], vedesek[id])
  2547. }
  2548.  
  2549. public Hirdetes()
  2550. {
  2551. switch(random(4))
  2552. {
  2553. case 0: print_chatColor(0, "^x04[%s]^x01 Ha segítségre van szükséged írd be^x03 /help",CHAT_PREFIX)
  2554. case 1: print_chatColor(0, "^x04[%s]^x01 Olvasd el a szabályzatot! Írd be^x03 /szabaly",CHAT_PREFIX)
  2555. case 2: print_chatColor(0, "^x04[%s]^x01 Ha ki/be szeretnéd kapcsolni a körvégi zenekét írd be^x03 /zeneki ^x01| ^x03/zenebe",CHAT_PREFIX)
  2556. case 3: print_chatColor(0, "^x04[%s]^x01 Parancsok:^x03 /statom /help /szabaly",CHAT_PREFIX)
  2557. }
  2558.  
  2559. set_task(120.0, "Hirdetes", 0)
  2560. }
  2561.  
  2562. LateJoinExp(id)
  2563. {
  2564. new total = (score[T] + score[CT]) * AMOUNT_LATEJOINEXP
  2565. if(total) {
  2566. g_Experience[id] += total
  2567. print_chatColor(id, "^x04[%s]^x01 %L",CHAT_PREFIX,id,"EXP_FOR_LATEJOIN",total)
  2568. }
  2569. }
  2570.  
  2571. public handle_say(id)
  2572. {
  2573. new said[192], help[7]
  2574. read_args(said,192)
  2575. remove_quotes(said)
  2576. strcat(help,said,6)
  2577. /*if( (containi(help, "help") != -1) )
  2578. soccerjam_help(id)*/
  2579. if( (contain(help, "spec") != -1) )
  2580. cmdSpectate(id)
  2581.  
  2582. return PLUGIN_CONTINUE
  2583.  
  2584. }
  2585.  
  2586. /*public soccerjam_help(id) {
  2587. new help_title[64], msg[2047], len
  2588. format(help_title,63,"%L",id,"HELP_HEADER")
  2589. len = format(msg,2046,"<body bgcolor=#000000><font color=#FFB000><br>")
  2590. len += format(msg[len],2046-len,"<center><h2>%L</h2><br><table><tr><td><p><b><font color=#FFB000>",id,"HELP_TITLE")
  2591. len += format(msg[len],2046-len,"<h2>%L</h2>",id,"HELP_MOVES_TITLE")
  2592. len += format(msg[len],2046-len,"%L<br>",id,"HELP_MOVES_KICK")
  2593. len += format(msg[len],2046-len,"%L<br>",id,"HELP_MOVES_CURVELEFT")
  2594. len += format(msg[len],2046-len,"%L<br>",id,"HELP_MOVES_CURVERIGHT")
  2595. len += format(msg[len],2046-len,"%L<br>",id,"HELP_MOVES_TURBO")
  2596. len += format(msg[len],2046-len,"%L<br>",id,"HELP_MOVES_UPGRADE")
  2597. len += format(msg[len],2046-len,"%L<br>",id,"HELP_MOVES_DIVE")
  2598. len += format(msg[len],2046-len,"%L<br><br>",id,"HELP_MOVES_CATCH")
  2599.  
  2600. len += format(msg[len],2046-len,"<h2>%L</h2>",id,"HELP_STATS_TITLE")
  2601. len += format(msg[len],2046-len,"%L<br>",id,"HELP_STATS_STAMINA")
  2602. len += format(msg[len],2046-len,"%L<br>",id,"HELP_STATS_STRENGTH")
  2603. len += format(msg[len],2046-len,"%L<br>",id,"HELP_STATS_AGILITY")
  2604. len += format(msg[len],2046-len,"%L<br>",id,"HELP_STATS_DEXTERITY")
  2605. len += format(msg[len],2046-len,"%L<br>",id,"HELP_STATS_DISARM")
  2606. len += format(msg[len],2046-len,"<h2>%L</h2>",id,"HELP_POWERPLAY_TITLE")
  2607. len += format(msg[len],2046-len,"- %L<br>",id,"HELP_POWERPLAY_ONE")
  2608. len += format(msg[len],2046-len,"- %L<br>",id,"HELP_POWERPLAY_TWO")
  2609. len += format(msg[len],2046-len,"<h2>%L</h2>",id,"HELP_TIPS_TITLE")
  2610. len += format(msg[len],2046-len,"- %L<br>",id,"HELP_TIPS_ONE")
  2611. len += format(msg[len],2046-len,"- %L<br>",id,"HELP_TIPS_TWO")
  2612. len += format(msg[len],2046-len,"- %L<br>",id,"HELP_TIPS_THREE")
  2613. len += format(msg[len],2046-len,"</b><br></td></tr></table><br>SoccerJam modot keszitette OneEyed. Kosz tesom.</center>")
  2614. show_motd(id,msg,help_title)
  2615. }*/
  2616.  
  2617. /*====================================================================================================
  2618.  [Post Game]
  2619.  
  2620.  Purpose: $$
  2621.  
  2622.  Comment: $$
  2623.  
  2624. ====================================================================================================*/
  2625. public showhud_winner() {
  2626. set_hudmessage(random(256), random(256), random(256), -1.0, 0.35, 1, 1.0, 1.5, 0.1, 0.1, HUD_CHANNEL)
  2627. show_hudmessage(0,"%s",scoreboard)
  2628. }
  2629. public displayWinnerAwards()
  2630. {
  2631. //If NO steal/assist was made, set name to Nobody
  2632. new x
  2633. for(x=1;x<=RECORDS;x++)
  2634. if(!TopPlayer[0][x])
  2635. format(TopPlayerName[x],MAX_NAME_LENGTH,"Senki")
  2636.  
  2637. //Display our Winning Team, with Awards, and kill Comm Chair of opponent
  2638. new awards[513]
  2639. new len = 0
  2640. len += format(awards[len], 512-len, "%s %L^n", (winner == 1 ? "Terrorist" : "CT"), LANG_PLAYER, "AWARDS_HEADER" )
  2641. len += format(awards[len], 512-len, "%s - %i | %s - %i^n^n", TeamNames[T],score[T],TeamNames[CT],score[CT])
  2642. len += format(awards[len], 512-len, " %L^n",LANG_PLAYER,"AWARDS_TITLE")
  2643. len += format(awards[len], 512-len, "%i %L -- %s^n", TopPlayer[1][GOAL], LANG_PLAYER, "AWARDS_GOALS", TopPlayerName[GOAL])
  2644. len += format(awards[len], 512-len, "%i %L -- %s^n", TopPlayer[1][STEAL], LANG_PLAYER, "AWARDS_STEALS", TopPlayerName[STEAL])
  2645. len += format(awards[len], 512-len, "%i %L -- %s^n", TopPlayer[1][ASSIST], LANG_PLAYER, "AWARDS_ASSISTS", TopPlayerName[ASSIST])
  2646. len += format(awards[len], 512-len, "%i %L -- %s^n", TopPlayer[1][KILL], LANG_PLAYER, "AWARDS_BALLKILLS", TopPlayerName[KILL])
  2647. len += format(awards[len], 512-len, "%i %L -- %s^n", TopPlayer[1][DISTANCE], LANG_PLAYER, "AWARDS_LONGESTGOAL", TopPlayerName[DISTANCE])
  2648.  
  2649. set_hudmessage(random(256), random(256), random(256), 0.4, 0.35, 0, 1.0, 10.0, 0.1, 0.1, 2)
  2650. show_hudmessage(0, "%s", awards)
  2651. }
  2652.  
  2653. public PostGame() {
  2654. new randomize = get_pcvar_num(CVAR_RANDOM)
  2655. if(randomize)
  2656. {
  2657. set_hudmessage(random(100), 255, random(100), -1.0, 0.55, 1, 1.0, 3.0, 1.0, 0.5, 2)
  2658. show_hudmessage(0, "%L",LANG_PLAYER,"RANDOMIZING_TEAMS")
  2659. set_task(3.0,"randomize_teams",0)
  2660. }
  2661. else
  2662. BeginCountdown()
  2663. }
  2664.  
  2665. public BeginCountdown() {
  2666. if(!timer) {
  2667. timer = COUNTDOWN_TIME
  2668. cleanup()
  2669. }
  2670. else {
  2671. new output[32]
  2672. num_to_word(timer,output,31)
  2673. client_cmd(0,"spk vox/%s.wav",output)
  2674.  
  2675. if(timer > (COUNTDOWN_TIME / 2))
  2676. set_hudmessage(255, 255, random(100), -1.0, 0.55, 1, 1.0, 1.0, 1.0, 0.5, 2)
  2677. else
  2678. set_hudmessage(255, 255, random(100), -1.0, 0.55, 1, 1.0, 1.0, 1.0, 0.5, 2)
  2679.  
  2680. if(timer > (COUNTDOWN_TIME - 2))
  2681. show_hudmessage(0, "%L^n%i",LANG_PLAYER,"GAME_BEGINS_IN",timer)
  2682. else
  2683. show_hudmessage(0, "%i",timer)
  2684.  
  2685. if(timer == 1)
  2686. server_cmd("sv_restart 1")
  2687. timer--
  2688. set_task(0.9,"BeginCountdown",0)
  2689. }
  2690. }
  2691.  
  2692. /*====================================================================================================
  2693.  [Team Randomizer]
  2694.  
  2695.  Purpose: $$
  2696.  
  2697.  Comment: $$
  2698.  
  2699. ====================================================================================================*/
  2700. public randomize_teams()
  2701. {
  2702. new terr, ct, id, team, cnt, temp, x, pl_temp
  2703. new teams[3][33], player_list[33]
  2704. new shuff_t, shuff_ct
  2705. new shuffle = random_num(10,30)
  2706.  
  2707. //Put all players in one big list
  2708. for(id=1; id<=maxplayers; id++)
  2709. if(is_user_connected(id) && !is_user_bot(id)) {
  2710. team = get_user_team(id)
  2711. if(team == 1 || team == 2)
  2712. player_list[cnt++] = id
  2713. }
  2714.  
  2715. cnt--
  2716.  
  2717. //Make a list of Terr and CT players
  2718. while(cnt >= 0)
  2719. {
  2720. if(cnt % 2 == 0)
  2721. teams[1][terr++] = player_list[cnt--]
  2722. else
  2723. teams[2][ct++] = player_list[cnt--]
  2724. }
  2725.  
  2726. //Shuffle the players
  2727. for(x=0;x<=shuffle;x++) {
  2728. shuff_t = random_num(0,terr-1);
  2729. shuff_ct = random_num(0,ct-1);
  2730. temp = teams[1][shuff_t];
  2731. teams[1][shuff_t] = teams[2][shuff_ct];
  2732. teams[2][shuff_ct] = temp;
  2733. }
  2734.  
  2735. //Put Players in their team.
  2736. for(x=1; x<3; x++)
  2737. for(id=0; id<((terr>ct?terr:ct)); id++) {
  2738. pl_temp = teams[x][id]
  2739. if(is_user_connected(pl_temp)) {
  2740. select_model(pl_temp, x, random_num(1,4))
  2741. set_task(1.0, "DelayedTeamSwitch", pl_temp+(x*1000))
  2742. }
  2743. }
  2744. set_task(3.0,"BeginCountdown",0)
  2745. }
  2746.  
  2747. public DelayedTeamSwitch(id) {
  2748. new team
  2749. if(id >= 2000)
  2750. team = 2
  2751. else
  2752. team = 1
  2753.  
  2754. id -= team*1000
  2755.  
  2756. print_chatColor(id, "^x04[%s]^x01 %L",CHAT_PREFIX,id,"RANDOM_MOVED_TEAM",team==1?"Piros":"Kék")
  2757. }
  2758.  
  2759. //random model selecting for teamstack
  2760. select_model(id, team, model) {
  2761. switch(team) {
  2762. case 1: {
  2763. switch(model) {
  2764. case 1: cs_set_user_team(id, CS_TEAM_T, CS_T_TERROR)
  2765. case 2: cs_set_user_team(id, CS_TEAM_T, CS_T_LEET)
  2766. case 3: cs_set_user_team(id, CS_TEAM_T, CS_T_ARCTIC)
  2767. case 4: cs_set_user_team(id, CS_TEAM_T, CS_T_GUERILLA)
  2768. }
  2769. }
  2770. case 2: {
  2771. switch(model) {
  2772. case 1: cs_set_user_team(id, CS_TEAM_CT, CS_CT_URBAN)
  2773. case 2: cs_set_user_team(id, CS_TEAM_CT, CS_CT_GSG9)
  2774. case 3: cs_set_user_team(id, CS_TEAM_CT, CS_CT_SAS)
  2775. case 4: cs_set_user_team(id, CS_TEAM_CT, CS_CT_GIGN)
  2776. case 5: cs_set_user_team(id, CS_TEAM_CT, CS_CT_VIP) //my lil secret
  2777. }
  2778. }
  2779. case 3: {
  2780. cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE)
  2781. if(is_user_alive(id))
  2782. user_kill(id)
  2783. }
  2784. }
  2785. }
  2786.  
  2787. /*====================================================================================================
  2788.  [Save]
  2789.  
  2790.  Purpose: Save goals, assist and goaly points
  2791.  
  2792.  Comment: $$
  2793.  
  2794. ====================================================================================================*/
  2795. public mentes(id)
  2796. {
  2797. if(gVault == INVALID_HANDLE)
  2798. set_fail_state("nVault returned invalid handle")
  2799.  
  2800. new Name[32]
  2801. get_user_name(id,Name,31)
  2802. new vaultkey[64],vaultdata[256]
  2803.  
  2804. format(vaultkey,63,"%s-SoccerJam",Name)
  2805. format(vaultdata,255,"%i#%i#%i#",golok[id],golpasszok[id],vedesek[id])
  2806.  
  2807. nvault_set(gVault,vaultkey,vaultdata)
  2808.  
  2809. return PLUGIN_CONTINUE
  2810. }
  2811.  
  2812. public betoltes(id)
  2813. {
  2814. if(gVault == INVALID_HANDLE)
  2815. set_fail_state("nVault returned invalid handle")
  2816.  
  2817. new Name[32]
  2818. get_user_name(id,Name,31)
  2819. new vaultkey[64],vaultdata[256]
  2820.  
  2821. format(vaultkey,63,"%s-SoccerJam",Name)
  2822. format(vaultdata,255,"%i#%i#%i#",golok[id],golpasszok[id],vedesek[id])
  2823.  
  2824. nvault_get(gVault,vaultkey,vaultdata,255)
  2825.  
  2826. replace_all(vaultdata, 255, "#", " ")
  2827.  
  2828. new playergolok[33], playergolpasszok[33], playervedesek[33]
  2829. parse(vaultdata, playergolok, 32, playergolpasszok, 32, playervedesek, 32)
  2830.  
  2831. golok[id] = str_to_num(playergolok)
  2832. golpasszok[id] = str_to_num(playergolpasszok)
  2833. vedesek[id] = str_to_num(playervedesek)
  2834.  
  2835. return PLUGIN_CONTINUE
  2836. }
  2837. /*====================================================================================================
  2838.  [Special FX]
  2839.  
  2840.  Purpose: $$
  2841.  
  2842.  Comment: $$
  2843.  
  2844. ====================================================================================================*/
  2845. TerminatePlayer(id, mascot, team, Float:dmg) {
  2846. new orig[3], Float:morig[3], iMOrig[3]
  2847.  
  2848. get_user_origin(id, orig)
  2849. entity_get_vector(mascot,EV_VEC_origin,morig)
  2850. new x
  2851. for(x=0;x<3;x++)
  2852. iMOrig[x] = floatround(morig[x])
  2853.  
  2854. fakedamage(id,"Terminator",dmg,1)
  2855.  
  2856. new hp = get_user_health(id)
  2857. if(hp < 0)
  2858. increaseTeamXP(team, 25)
  2859.  
  2860. new loc = (team == 1 ? 100 : 140)
  2861. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  2862. write_byte(0)
  2863. write_coord(iMOrig[0]) //(start positionx)
  2864. write_coord(iMOrig[1]) //(start positiony)
  2865. write_coord(iMOrig[2] + loc) //(start positionz)
  2866. write_coord(orig[0]) //(end positionx)
  2867. write_coord(orig[1]) //(end positiony)
  2868. write_coord(orig[2]) //(end positionz)
  2869. write_short(g_fxBeamSprite) //(sprite index)
  2870. write_byte(0) //(starting frame)
  2871. write_byte(0) //(frame rate in 0.1's)
  2872. write_byte(7) //(life in 0.1's)
  2873. write_byte(120) //(line width in 0.1's)
  2874. write_byte(25) //(noise amplitude in 0.01's)
  2875. write_byte(0) //r
  2876. write_byte(120) //g
  2877. write_byte(250) //b
  2878. write_byte(255) //brightness
  2879. write_byte(1) //(scroll speed in 0.1's)
  2880. message_end()
  2881. }
  2882.  
  2883. glow(id, r, g, b, on) {
  2884. if(on == 1) {
  2885. set_rendering(id, kRenderFxGlowShell, r, g, b, kRenderNormal, 255)
  2886. entity_set_float(id, EV_FL_renderamt, 1.0)
  2887. }
  2888. else if(!on) {
  2889. set_rendering(id, kRenderFxNone, r, g, b, kRenderNormal, 255)
  2890. entity_set_float(id, EV_FL_renderamt, 1.0)
  2891. }
  2892. else if(on == 10) {
  2893. set_rendering(id, kRenderFxGlowShell, r, g, b, kRenderNormal, 255)
  2894. entity_set_float(id, EV_FL_renderamt, 1.0)
  2895. }
  2896. }
  2897.  
  2898. on_fire()
  2899. {
  2900. new rx, ry, rz, Float:forig[3], forigin[3], x
  2901. fire_delay = get_gametime()
  2902.  
  2903. rx = random_num(-5, 5)
  2904. ry = random_num(-5, 5)
  2905. rz = random_num(-5, 5)
  2906. entity_get_vector(aball, EV_VEC_origin, forig)
  2907. for(x=0;x<3;x++)
  2908. forigin[x] = floatround(forig[x])
  2909.  
  2910. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  2911. write_byte(17)
  2912. write_coord(forigin[0] + rx)
  2913. write_coord(forigin[1] + ry)
  2914. write_coord(forigin[2] + 10 + rz)
  2915. write_short(Burn_Sprite)
  2916. write_byte(7)
  2917. write_byte(235)
  2918. message_end()
  2919. }
  2920.  
  2921. beam() {
  2922. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  2923. write_byte(22) // TE_BEAMFOLLOW
  2924. write_short(aball) // ball
  2925. write_short(beamspr)// laserbeam
  2926. write_byte(BALL_BEAM_LIFE) // life
  2927. write_byte(BALL_BEAM_WIDTH) // width
  2928. write_byte(BALL_BEAM_RED) // R
  2929. write_byte(BALL_BEAM_GREEN) // G
  2930. write_byte(BALL_BEAM_BLUE) // B
  2931. write_byte(BALL_BEAM_ALPHA) // brightness
  2932. message_end()
  2933. }
  2934.  
  2935. flameWave(myorig[3]) {
  2936. message_begin(MSG_BROADCAST, SVC_TEMPENTITY, myorig)
  2937. write_byte( 21 )
  2938. write_coord(myorig[0])
  2939. write_coord(myorig[1])
  2940. write_coord(myorig[2] + 16)
  2941. write_coord(myorig[0])
  2942. write_coord(myorig[1])
  2943. write_coord(myorig[2] + 500)
  2944. write_short( fire )
  2945. write_byte( 0 ) // startframe
  2946. write_byte( 0 ) // framerate
  2947. write_byte( 15 ) // life 2
  2948. write_byte( 50 ) // width 16
  2949. write_byte( 10 ) // noise
  2950. write_byte( 0 ) // r
  2951. write_byte( 130 ) // g
  2952. write_byte( 250 ) // b
  2953. write_byte( 255 ) //brightness
  2954. write_byte( 1 / 10 ) // speed
  2955. message_end()
  2956.  
  2957. message_begin(MSG_BROADCAST,SVC_TEMPENTITY,myorig)
  2958. write_byte( 21 )
  2959. write_coord(myorig[0])
  2960. write_coord(myorig[1])
  2961. write_coord(myorig[2] + 16)
  2962. write_coord(myorig[0])
  2963. write_coord(myorig[1])
  2964. write_coord(myorig[2] + 500)
  2965. write_short( fire )
  2966. write_byte( 0 ) // startframe
  2967. write_byte( 0 ) // framerate
  2968. write_byte( 10 ) // life 2
  2969. write_byte( 70 ) // width 16
  2970. write_byte( 10 ) // noise
  2971. write_byte( 0 ) // r
  2972. write_byte( 70 ) // g
  2973. write_byte( 250 ) // b
  2974. write_byte( 200 ) //brightness
  2975. write_byte( 1 / 9 ) // speed
  2976. message_end()
  2977.  
  2978. message_begin(MSG_BROADCAST,SVC_TEMPENTITY,myorig)
  2979. write_byte( 21 )
  2980. write_coord(myorig[0])
  2981. write_coord(myorig[1])
  2982. write_coord(myorig[2] + 16)
  2983. write_coord(myorig[0])
  2984. write_coord(myorig[1])
  2985. write_coord(myorig[2] + 500)
  2986. write_short( fire )
  2987. write_byte( 0 ) // startframe
  2988. write_byte( 0 ) // framerate
  2989. write_byte( 10 ) // life 2
  2990. write_byte( 90 ) // width 16
  2991. write_byte( 10 ) // noise
  2992. write_byte( 0 ) // r
  2993. write_byte( 30 ) // g
  2994. write_byte( 250 ) // b
  2995. write_byte( 200 ) //brightness
  2996. write_byte( 1 / 8 ) // speed
  2997. message_end()
  2998.  
  2999. //Explosion2
  3000. message_begin( MSG_BROADCAST, SVC_TEMPENTITY)
  3001. write_byte( 12 )
  3002. write_coord(myorig[0])
  3003. write_coord(myorig[1])
  3004. write_coord(myorig[2])
  3005. write_byte( 80 ) // byte (scale in 0.1's) 188
  3006. write_byte( 10 ) // byte (framerate)
  3007. message_end()
  3008.  
  3009. //TE_Explosion
  3010. message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  3011. write_byte( 3 )
  3012. write_coord(myorig[0])
  3013. write_coord(myorig[1])
  3014. write_coord(myorig[2])
  3015. write_short( fire )
  3016. write_byte( 65 ) // byte (scale in 0.1's) 188
  3017. write_byte( 10 ) // byte (framerate)
  3018. write_byte( 0 ) // byte flags
  3019. message_end()
  3020.  
  3021. //Smoke
  3022. message_begin( MSG_BROADCAST,SVC_TEMPENTITY,myorig)
  3023. write_byte( 5 ) // 5
  3024. write_coord(myorig[0])
  3025. write_coord(myorig[1])
  3026. write_coord(myorig[2])
  3027. write_short( smoke )
  3028. write_byte( 50 ) // 2
  3029. write_byte( 10 ) // 10
  3030. message_end()
  3031.  
  3032. return PLUGIN_HANDLED
  3033. }
  3034.  
  3035. stock print_chatColor(const id,const input[], any:...)
  3036. {
  3037. new msg[191], players[32], count = 1;
  3038. vformat(msg,190,input,3);
  3039. replace_all(msg,190,"!g","^x04");// green
  3040. replace_all(msg,190,"!n","^x01");// normal
  3041. replace_all(msg,190,"!t","^x03");// team
  3042.  
  3043. if (id) players[0] = id; else get_players(players,count,"ch");
  3044. for (new i=0;i<count;i++)
  3045. if (is_user_connected(players[i]))
  3046. {
  3047. message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
  3048. write_byte(players[i]);
  3049. write_string(msg);
  3050. message_end();
  3051. }
  3052. }