Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 258.82 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <engine>
  4. #include <fakemeta>
  5. #include <fun>
  6. #include <amxmisc>
  7. #include <csx>
  8. #include <nvault>
  9. #include <maths>
  10. //#include <Sj-Pro>
  11. #include <hamsandwich>
  12. #include <cs_player_models_api>
  13. #include <xs>
  14.  
  15. //#pragma semicolon 1;
  16.  
  17. #define VAULTNAMEEXP "Sj-Pro_Exp"
  18. #define VAULTNAMERANK "Sj-Pro_Rank"
  19. #define VAULTNAMETOP "Sj-Pro_Top"
  20.  
  21. /*
  22.  
  23. #define ADMIN_LEVEL ADMIN_MENU //admin access level to use this plugin. ADMIN_MENU = flag 'u'
  24. #define MAIN_MENU_KEYS (1<<0)|(1<<1)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<9)
  25.  
  26. enum { N1, N2, N3, N4, N5, N6, N7, N8, N9, N0 };
  27. new const X = 0;
  28. new const Y = 1;
  29. new const Z = 2; //for some reason I got tag mismatch on Z when using an enum
  30.  
  31. new gszMainMenuText[256];
  32.  
  33. new const spr_teams[] = "sprites/PersonClock.spr";
  34. new const spr_digits[] = "sprites/clock_digits.spr";
  35. new const spr_tiempo[] = "sprites/Tiempo.spr";
  36.  
  37. new const gszPrefix[] = "[CM] ";
  38.  
  39. // Clases de carteles
  40.  
  41. new const class_infotarget[] = "info_target";
  42. new const class_team[] = "cartel_team";
  43. new const class_digito[] = "cartel_digito";
  44. new const class_tiempo[] = "cartel_tiempo";
  45.  
  46. new const Float:gfDigitOffsetMultipliers[2] = {0.3, 0.75};
  47. new const Float:gfClockSize[2] = {40.0, 32.0};
  48. new const Float:gfTitleSize = 16.0;
  49.  
  50. new FileCartel[128];
  51.  
  52. const gteamTypesMax = 2;
  53.  
  54. //clock types
  55. enum
  56. {
  57. SJ_CT,
  58. SJ_TERROR,
  59. SJ_TIME
  60. };
  61.  
  62. new gClockSaveIds[gteamTypesMax] =
  63. {
  64. 'C', 'T'
  65. };
  66.  
  67. */
  68.  
  69. static const AUTHOR[] = "a7x ' # TeaM"
  70. static const VERSION[] = "6.0c"
  71.  
  72. //#define NAME_SERVER "Sj-Pro 6.0a"
  73.  
  74. ///////////////////////////////////////////////////////////////////////////////////
  75. ////////////////////////////////// PERFECT SELECT ///////////////////////////////
  76. ///////////////////////////////////////////////////////////////////////////////////
  77.  
  78. #define MENSAGE_SERVER "- Bem vindo a a7x '# TeaM -^n^n"
  79.  
  80. #pragma dynamic 131072 //I used to much memory =(
  81.  
  82. /* ------------------------------------------------------------------------- */
  83. /* /----------------------- START OF CUSTOMIZATION -----------------------/ */
  84. /* ------------------------------------------------------------------------- */
  85. /* ------------------------------------------------------------------------- */
  86. /* ------------------------------------------------------------------------- */
  87. /* /------------ CUSTOM DEFINES ------------ CUSTOM DEFINES ------------/ */
  88. /* ------------------------------------------------------------------------- */
  89.  
  90. //When player reaches MAX level, they receive this many levels.
  91.  
  92. #define MAX_LVL_BONUS 1
  93. #define MAX_LVL_POWERPLAY 10
  94. #define DISARM_MULTIPLIER 2
  95.  
  96. #define TEAMS 4 //Don't edit this.
  97. static const TeamNames[TEAMS][32]
  98.  
  99. /* ------------------------------------------------------------------------- */
  100. /* /---------------- MODELS ---------------- MODELS ----------------/ */
  101. /* ------------------------------------------------------------------------- */
  102.  
  103. new ball[256]
  104.  
  105. static const TeamMascots[2][] = {
  106. "models/a7x_sj/placa_barca.mdl",//"models/kingpin.mdl", //TERRORIST MASCOT
  107. "models/a7x_sj/placa_real.mdl"//"models/garg.mdl" //CT MASCOT
  108. }
  109. new const szModelBarca[] = "a7x_sj_barca"
  110. new const szModelMadrid[] = "a7x_sj_real"
  111.  
  112. /* ------------------------------------------------------------------------- */
  113. /* /---------------- SOUNDS ---------------- SOUNDS ----------------/ */
  114. /* ------------------------------------------------------------------------- */
  115.  
  116.  
  117. /* ------------------------------------------------------------------------- */
  118. /* ------------------------------------------------------------------------- */
  119. /* /------------------------ END OF CUSTOMIZATION ------------------------/ */
  120. /* ------------------------------------------------------------------------- */
  121. /* ------------------------------------------------------------------------- */
  122.  
  123. /* ------------ DO NOT EDIT BELOW ---------------------------------------------------------- */
  124. /* -------------------------- DO NOT EDIT BELOW -------------------------------------------- */
  125. /* --------------------------------------- DO NOT EDIT BELOW ------------------------------- */
  126. /* ---------------------------------------------------- DO NOT EDIT BELOW ------------------ */
  127.  
  128. #define MAX_TEXT_BUFFER 2047
  129. #define MAX_PLAYER 32
  130. #define MAX_ASSISTERS 3
  131. #define MAX_BALL_SPAWNS 5
  132. #define POS_X -1.0
  133. #define POS_Y 0.85
  134. #define HUD_CHANNEL 4
  135.  
  136.  
  137. #define MAX_LINE_MODELS 200
  138. #define BOCHA_COLORS 12
  139. #define PLAYER_COLORS 31
  140. #define NUM_MODELS 7
  141. #define NUM_SPRITES 10
  142. #define NUM_SOUNDS 27
  143.  
  144. #define NOMBRETEAMCT "NOMBRE_TEAM_CT"
  145. #define NOMBRETEAMTT "NOMBRE_TEAM_TT"
  146. #define NOMBRETEAMSPEC "NOMBRE_TEAM_SPEC"
  147.  
  148. #define BOCHAGLOW "BOCHA_GLOW"
  149. #define BOCHACOLORBEAMCT "BOCHA_COLOR_BEAM_CT"
  150. #define BOCHACOLORBEAMTT "BOCHA_COLOR_BEAM_TT"
  151. #define BEAMGROSOR "BEAM_GROSOR"
  152. #define BEAMLIFE "BEAM_LIFE"
  153. #define BOCHABRILLO "BOCHA_BRILLO"
  154.  
  155. #define PLAYERCOLORGLOWCT "PLAYER_COLOR_GLOW_CT"
  156. #define PLAYERCOLORGLOWTT "PLAYER_COLOR_GLOW_TT"
  157. #define ARQUEROCOLORGLOWCT "ARQUERO_COLOR_GLOW_CT"
  158. #define ARQUEROCOLORGLOWTT "ARQUERO_COLOR_GLOW_TT"
  159. #define PLAYERGROSORGLOW "PLAYER_GROSOR_GLOW"
  160. #define ARQUEROGROSORGLOW "ARQUERO_GROSOR_GLOW"
  161.  
  162. #define COLORGLOWOFFSIDE "COLOR_GLOW_OFFSIDE"
  163. #define GROSORGLOWOFFSIDE "GROSOR_GLOW_OFFSIDE"
  164. #define COLORGLOWFOUL "COLOR_GLOW_FOUL"
  165. #define GROSORGLOWFOUL "GROSOR_GLOW_FOUL"
  166.  
  167. #define COLORTURBOCT "COLOR_TURBO_CT"
  168. #define COLORTURBOTT "COLOR_TURBO_TT"
  169. #define COLORCARTELSCORE "COLOR_CARTEL_SCORE"
  170.  
  171. #define MODELBOCHA "MODEL_BOCHA"
  172. #define MODELARQUEROCT "MODEL_ARQUERO_CT"
  173. #define MODELARQUEROTT "MODEL_ARQUERO_TT"
  174. #define VMODELFAKAARQUERO "V_MODEL_FAKA_ARQUERO"
  175. #define PMODELFAKAARQUERO "P_MODEL_FAKA_ARQUERO"
  176. #define VMODELFAKAPLAYER "V_MODEL_FAKA_PLAYER"
  177. #define PMODELFAKAPLAYER "P_MODEL_FAKA_PLAYER"
  178.  
  179. #define EXPLOSIONGOL "EXPLOSION_GOL"
  180. #define EFECTOHUMO "EFECTO_HUMO"
  181. #define POWERPLAY "POWER_PLAY"
  182. #define RAYOMASCOTA "RAYO_MASCOTA"
  183. #define FESTEJOGOLBARCA "FESTEJO_GOL_BARCA"
  184. #define FESTEJOGOLREAL "FESTEJO_GOL_REAL"
  185. #define FESTEJOGOLENCONTRA "FESTEJO_GOL_EN_CONTRA"
  186. #define BOCHABEAM "BOCHA_BEAM"
  187. #define BOCHABEAM2 "BOCHA_BEAM2"
  188. #define LINEAOFFSIDE "LINEA_OFFSIDE"
  189.  
  190. #define GOL1 "GOL_1"
  191. #define GOL2 "GOL_2"
  192. #define GOL3 "GOL_3"
  193. #define GOL4 "GOL_4"
  194. #define GOL5 "GOL_5"
  195. #define GOL6 "GOL_6"
  196. #define GOLENCONTRA1 "GOL_EN_CONTRA_1"
  197. #define GOLENCONTRA2 "GOL_EN_CONTRA_2"
  198. #define GOLENCONTRA3 "GOL_EN_CONTRA_3"
  199. #define GOLENCONTRA4 "GOL_EN_CONTRA_4"
  200. #define GOLENCONTRA5 "GOL_EN_CONTRA_5"
  201. #define PUSSY "PUSSY"
  202. #define INICIORONDA "INICIO_RONDA"
  203. #define BOCHAPIQUE "BOCHA_PIQUE"
  204. #define BOCHARECIBIDA "BOCHA_RECIBIDA"
  205. #define BOCHARESPAWN "BOCHA_RESPAWN"
  206. #define GOLMARCADO "GOL_MARCADO"
  207. #define BOCHAPASE "BOCHA_PASE"
  208. #define FULLSKILL "FULL_SKILL"
  209. #define VICTORIA "VICTORIA"
  210. #define TELEPORTCABINA "TELEPORT_CABINA"
  211. #define KILLCONBOCHA "KILL_CON_BOCHA"
  212. #define TEDESARMAN "TE_DESARMAN"
  213. #define DESARMAS "DESARMAS"
  214. #define SERARQUERO "SER_ARQUERO"
  215. #define NOSERARQUERO "NO_SER_ARQUERO"
  216. #define SILBATO "SILBATO"
  217.  
  218.  
  219. #define MAXLVLSTAMINA "MAX_LVL_VIDA"
  220. #define MAXLVLSTRENGTH "MAX_LVL_FUERZA"
  221. #define MAXLVLAGILITY "MAX_LVL_AGILIDAD"
  222. #define MAXLVLDEXTERITY "MAX_LVL_DESTREZA"
  223. #define MAXLVLDISARM "MAX_LVL_DISARM"
  224.  
  225. #define EXPPRICESTAMINA "EXP_PRECIO_VIDA"
  226. #define EXPPRICESTRENGTH "EXP_PRECIO_FUERZA"
  227. #define EXPPRICEAGILITY "EXP_PRECIO_AGILIDAD"
  228. #define EXPPRICEDEXTERITY "EXP_PRECIO_DESTREZA"
  229. #define EXPPRICEDISARM "EXP_PRECIO_DISARM"
  230.  
  231. #define EXPGOLEQUIPO "EXP_GOL_EQUIPO"
  232. #define EXPROBO "EXP_ROBO"
  233. #define EXPBALLKILL "EXP_BALLKILL"
  234. #define EXPASISTENCIA "EXP_ASISTENCIA"
  235. #define EXPGOL "EXP_GOL"
  236.  
  237. #define BASEHP "VIDA_INICIAL"
  238. //#define BASESPEED "SPEED_INICIAL"
  239. #define BASEDISARM "DISARM_INICIAL"
  240.  
  241. #define CUENTAREGRESIVA "CUENTA_REGRESIVA"
  242. #define TIEMPOEXPCAMPEAR "TIEMPO_EXP_CAMPEAR"
  243.  
  244. #define CURVEANGLE "COMBA_ANGULO"
  245. #define CURVECOUNT "COMBA_VECES_CURVA"
  246. //#define CURVETIME "COMBA_TIEMPO"
  247. #define DIRECTIONS "COMBA_CUANTAS"
  248. #define ANGLEDIVIDE "COMBA_DIVISION"
  249.  
  250. #define AMOUNTLATEJOINEXP "EXP_TARDE"
  251. #define AMOUNTPOWERPLAY "PP_AUMENTO_SKILL"
  252. #define AMOUNTGOALY "EXP_CAMPEAR"
  253.  
  254. #define AMOUNTSTA "CANT_VIDA_POR_LVL"
  255. #define AMOUNTSTR "CANT_FUERZA_POR_LVL"
  256. #define AMOUNTAGI "CANT_AGILIDAD_POR_LVL"
  257. #define AMOUNTDEX "CANT_DESTREZA_POR_LVL"
  258. #define AMOUNTDISARM "CANT_DISARM_POR_LVL"
  259.  
  260. #define RANKGOL "RANK_GOL"
  261. #define RANKGOLENCONTRA "RANK_GOL_EN_CONTRA"
  262. #define RANKROBO "RANK_ROBO"
  263. #define RANKREGALO "RANK_REGALO"
  264. #define RANKASISTENCIA "RANK_ASISTENCIA"
  265. #define RANKBALLKILL "RANK_BALLKILL"
  266. #define RANKRVBALLKILL "RANK_RV_BALLKILL"
  267. #define RANKDISARM "RANK_DISARM"
  268. #define RANKRVDISARM "RANK_RV_DISARM"
  269.  
  270. #define VISORHP "VISOR_HP"
  271.  
  272. #define MAXRANK "MAX_RANK"
  273.  
  274. new ConfigPro[32]
  275.  
  276. #define MAX_FILE_NAME 50
  277. #define MAX_PLAYERS 33
  278. #define FILES_PER_PAGE 8
  279. #define MAX_MENU_CHARS 500
  280. #define MAX_FILE_SIZE 300
  281. #define ALL_MENU_KEYS (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9)
  282.  
  283. enum {
  284. UNASSIGNED = 0,
  285. T,
  286. CT,
  287. SPECTATOR
  288. }
  289.  
  290. #define RECORDS 8
  291. enum {
  292. GOAL = 1,
  293. ASSIST,
  294. STEAL,
  295. KILL,
  296. DISTANCE,
  297. DISARMS,
  298. ENCONTRA,
  299. GOALY
  300. }
  301.  
  302. #define UPGRADES 5
  303. enum {
  304. STA = 1, //stamina
  305. STR, //strength
  306. AGI, //agility
  307. DEX, //dexterity
  308. DISARM, //disarm
  309. }
  310.  
  311. static const UpgradeTitles[UPGRADES+1][] =
  312. {
  313. "Nada",
  314. "Vida",
  315. "Forca",
  316. "Velocidade",
  317. "Resistencia",
  318. "Desarme"
  319. }
  320.  
  321. new UpgradeMax[UPGRADES+1]
  322. new UpgradePrice[UPGRADES+1]
  323.  
  324. new PlayerUpgrades[MAX_PLAYER + 1][UPGRADES+1]
  325. new GoalEnt[TEAMS]
  326. new PressedAction[MAX_PLAYER + 1]
  327. new seconds[MAX_PLAYER + 1]
  328. new g_sprint[MAX_PLAYER + 1]
  329. new SideJump[MAX_PLAYER + 1]
  330. new Float:SideJumpDelay[MAX_PLAYER + 1]
  331. new PlayerDeaths[MAX_PLAYER + 1]
  332. new PlayerKills[MAX_PLAYER + 1]
  333. new curvecount
  334. new direction
  335. new maxplayers
  336. new Float:BallSpinDirection[3]
  337. new ballspawncount
  338. new Float:TeamBallOrigins[TEAMS][3]
  339. new Float:TEMP_TeamBallOrigins[3]
  340. new Mascots[TEAMS]
  341. new Float:MascotsOrigins[3]
  342. new Float:MascotsAngles[3]
  343. new menu_upgrade[MAX_PLAYER + 1]
  344. new Float:fire_delay
  345. new winner
  346. new Float:GoalyCheckDelay[MAX_PLAYER + 1]
  347. new GoalyCheck[MAX_PLAYER + 1]
  348. new GoalyPoints[MAX_PLAYER + 1]
  349. new Float:BallSpawnOrigin[MAX_BALL_SPAWNS][3]
  350. new TopPlayer[2][RECORDS+1]
  351. new MadeRecord[MAX_PLAYER + 1][RECORDS+1]
  352. new TopPlayerName[RECORDS+1][MAX_PLAYER + 1]
  353. new g_Experience[MAX_PLAYER + 1]
  354. new timer
  355. new Float:testorigin[3]
  356. new Float:velocity[3]
  357. new score[TEAMS]
  358. new scoreboard[1025]
  359. new temp1[64], temp2[64]
  360. new distorig[2][3] //distance recorder
  361. new gmsgShake
  362. new gmsgDeathMsg
  363. new gmsgSayText
  364. new gmsgTextMsg
  365. new goaldied[MAX_PLAYER + 1]
  366. new bool:is_dead[MAX_PLAYER + 1]
  367. new terr[MAX_PLAYER + 1], ct[MAX_PLAYER + 1], cntCT, cntT
  368. new PowerPlay, powerplay_list[MAX_LVL_POWERPLAY+1]
  369. new assist[16]
  370. new iassist[TEAMS]
  371. new gamePlayerEquip
  372.  
  373. new CVAR_SCORE
  374. new CVAR_RESET
  375. new CVAR_GOALSAFETY
  376. new CVAR_KICK
  377. new Float:CVAR_RESPAWN
  378. new CVAR_RANDOM
  379. new CVAR_KILLNEARBALL
  380. new CVAR_KILLNEARHOLDER
  381. new CVAR_KILLNEARAREA
  382. new CVAR_FRAG
  383. new CVAR_POSS
  384. new CVAR_LIMITES
  385. new CVAR_ARQUEROS
  386. new CVAR_ENCONTRA
  387. new CVAR_FOUL
  388. new CVAR_OFFSIDE
  389. new CVAR_SPEC
  390. new CVAR_SPEC_CABINAS
  391. new CVAR_RANK
  392. new CVAR_RESEXP
  393.  
  394. new BCol[BOCHA_COLORS][4]
  395. new BallColors[BOCHA_COLORS]
  396. new PCol[PLAYER_COLORS][4]
  397. new PlayerColors[PLAYER_COLORS]
  398. new SModel[NUM_MODELS][128]
  399. new SSprite[NUM_SPRITES][128]
  400. new SoundDirect[NUM_SOUNDS][256]
  401.  
  402. new SpriteGolBarca
  403. new SpriteGolReal
  404. new SpriteGolContra
  405.  
  406. new fire
  407. new smoke
  408. new beamspr
  409. new beamspr2
  410. new g_fxBeamSprite
  411. new Burn_Sprite
  412. new offbeam
  413.  
  414. new ballholder
  415. new ballowner
  416. new aball
  417. new is_kickball
  418. new bool:has_knife[MAX_PLAYER + 1]
  419.  
  420. // System Foul
  421.  
  422. new bool:is_user_foul[MAX_PLAYER + 1]
  423. new user_foul_count[MAX_PLAYER + 1]
  424. new g_msgScreenFade
  425.  
  426. // System Keeper
  427.  
  428. new bool:T_keeper[MAX_PLAYER + 1]
  429. new bool:CT_keeper[MAX_PLAYER + 1]
  430. new bool:user_is_goleiro_real[MAX_PLAYER + 1]
  431. new bool:user_is_goleiro_barca[MAX_PLAYER + 1]
  432. new bool:user_is_keeper[MAX_PLAYER + 1]
  433.  
  434. new a_Classname[] = "aco_t"
  435. new b_Classname[] = "aco_t2"
  436.  
  437. new p_Classname[] = "arco_t"
  438. new g_Classname[] = "arco_ct"
  439. new y_Classname[] = "limite_t"
  440. new z_Classname[] = "limite_ct"
  441. new arqueroct
  442. new arquerot
  443. new bobo[MAX_PLAYER + 1]
  444.  
  445. new espectadores
  446. new bool:soy_spec[MAX_PLAYER + 1]
  447.  
  448. // System Offside
  449.  
  450. new bool:is_offside[MAX_PLAYER + 1]
  451. new off_1
  452.  
  453. // Festejos
  454.  
  455. new T_sprite
  456. new CT_sprite
  457.  
  458. // Security CFG's
  459.  
  460. new bool:Seguridad_rr
  461. new bool:Seguridad_cfg
  462.  
  463. // nVault
  464.  
  465. new nameVault
  466. new rankVault
  467. new topVault
  468. //new fileVault // version 5.06
  469. //new ResguardVault // version 5.06
  470. //new ResguardVault2 // version 5.06
  471.  
  472. // Spawns Maps Sj
  473.  
  474. new SpawnSjPro[256]
  475.  
  476. // Global Rank
  477.  
  478. new no_ball
  479. new Coord_Off_Z_active
  480. new Coord_Off_Z
  481. new Coord_Off_Y
  482.  
  483. new Pro_Rank[MAX_PLAYER + 1]
  484. new Pro_Point[MAX_PLAYER + 1]
  485. //new Pro_Partidos[MAX_PLAYER + 1] // version 5.06
  486. //new Pro_Active[MAX_PLAYER + 1] // version 5.06
  487.  
  488. new bool:UserPassword[MAX_PLAYER + 1] = true;
  489.  
  490. new TotalRank
  491. new sj_systemrank
  492. new ActiveJoinTeam
  493.  
  494. // Segurity Rank
  495.  
  496. new TeamSelect[MAX_PLAYER + 1]
  497.  
  498. // Suman Rank
  499.  
  500. new Pro_Goal[MAX_PLAYER + 1]
  501. new Pro_Steal[MAX_PLAYER + 1]
  502. new Pro_Asis[MAX_PLAYER + 1]
  503. new Pro_Disarm[MAX_PLAYER + 1]
  504. new Pro_Kill[MAX_PLAYER + 1]
  505.  
  506. // Restan Rank
  507.  
  508. new Pro_Contra[MAX_PLAYER + 1]
  509. new Pro_teSteal[MAX_PLAYER + 1]
  510. new Pro_teKill[MAX_PLAYER + 1]
  511. new Pro_teDisarm[MAX_PLAYER + 1]
  512.  
  513.  
  514. // pcvars
  515.  
  516. new sj_password_field;
  517.  
  518.  
  519. new UserHealth[MAX_PLAYER + 1]
  520. new MonitorHudSync
  521.  
  522. new MsgHideWeapon
  523. #define HIDE_HUD_HEALTH (1<<3)
  524.  
  525. //////////////////CHAT COLORS/////////////////////
  526.  
  527. enum Color
  528. {
  529. YELLOW = 1, // Amarillo
  530. GREEN, // Gris
  531. TEAM_COLOR, // Rojo, verde, Azul
  532. GREY, // gris
  533. RED, // Rojo
  534. BLUE, // Azul
  535. }
  536.  
  537. new TeamInfo;
  538. new SayText;
  539. new MaxSlots;
  540.  
  541. new TeamName[][] =
  542. {
  543. "",
  544. "Barcelona",
  545. "Real Madrid",
  546. "Spec"
  547. }
  548.  
  549. new bool:IsConnected[MAX_PLAYER + 1];
  550.  
  551. new FileMdl[256], FileCol[256], FileSpr[256], FileSounds[256], FileCfg[256]
  552.  
  553. //new mod_name[MAX_PLAYER + 1] = NAME_SERVER
  554.  
  555. new OFFSET_INTERNALMODEL;
  556.  
  557. /*====================================================================================================
  558. [Precache]
  559.  
  560. Purpose: $$
  561.  
  562. Comment: $$
  563.  
  564. ====================================================================================================*/
  565. PrecacheSounds()
  566. {
  567. new configDir[128]
  568. get_configsdir(configDir,127)
  569. formatex(FileSounds,255,"%s/a7x_sj/pro-sounds.ini",configDir)
  570.  
  571. new SoundNames[128]
  572. new prefijo[4], sufijo[26], Data[128], len
  573. for(new x = 0; x < MAX_LINE_MODELS; x++)
  574. {
  575. read_file(FileSounds, x, Data, 127, len)
  576. parse(Data, prefijo, 3, sufijo, 25)
  577. if(equali(prefijo,"##"))
  578. {
  579. for(new y = x + 1; y < x + 10; y++)
  580. {
  581. read_file(FileSounds, y, Data, 127, len)
  582. if(equali(Data,""))
  583. continue
  584.  
  585. x = y - 1
  586. break;
  587. }
  588.  
  589. parse(Data, SoundNames, 127)
  590.  
  591. if(equali(sufijo,GOL1))
  592. formatex(SoundDirect[0], 255, "a7x_sj/%s.wav", SoundNames)
  593. else if(equali(sufijo,GOL2))
  594. formatex(SoundDirect[1], 255, "a7x_sj/%s.wav", SoundNames)
  595. else if(equali(sufijo,GOL3))
  596. formatex(SoundDirect[2], 255, "a7x_sj/%s.wav", SoundNames)
  597. else if(equali(sufijo,GOL4))
  598. formatex(SoundDirect[3], 255, "a7x_sj/%s.wav", SoundNames)
  599. else if(equali(sufijo,GOL5))
  600. formatex(SoundDirect[4], 255, "a7x_sj/%s.wav", SoundNames)
  601. else if(equali(sufijo,GOL6))
  602. formatex(SoundDirect[5], 255, "a7x_sj/%s.wav", SoundNames)
  603. else if(equali(sufijo,GOLENCONTRA1))
  604. formatex(SoundDirect[6], 255, "a7x_sj/%s.wav", SoundNames)
  605. else if(equali(sufijo,GOLENCONTRA2))
  606. formatex(SoundDirect[7], 255, "a7x_sj/%s.wav", SoundNames)
  607. else if(equali(sufijo,GOLENCONTRA3))
  608. formatex(SoundDirect[8], 255, "a7x_sj/%s.wav", SoundNames)
  609. else if(equali(sufijo,GOLENCONTRA4))
  610. formatex(SoundDirect[9], 255, "a7x_sj/%s.wav", SoundNames)
  611. else if(equali(sufijo,GOLENCONTRA5))
  612. formatex(SoundDirect[10], 255, "a7x_sj/%s.wav", SoundNames)
  613. else if(equali(sufijo,PUSSY))
  614. formatex(SoundDirect[11], 255, "a7x_sj/%s.wav", SoundNames)
  615. else if(equali(sufijo,INICIORONDA))
  616. formatex(SoundDirect[12], 255, "a7x_sj/%s.wav", SoundNames)
  617. else if(equali(sufijo,BOCHAPIQUE))
  618. formatex(SoundDirect[13], 255, "a7x_sj/%s.wav", SoundNames)
  619. else if(equali(sufijo,BOCHARECIBIDA))
  620. formatex(SoundDirect[14], 255, "a7x_sj/%s.wav", SoundNames)
  621. else if(equali(sufijo,BOCHARESPAWN))
  622. formatex(SoundDirect[15], 255, "a7x_sj/%s.wav", SoundNames)
  623. else if(equali(sufijo,GOLMARCADO))
  624. formatex(SoundDirect[16], 255, "a7x_sj/%s.wav", SoundNames)
  625. else if(equali(sufijo,BOCHAPASE))
  626. formatex(SoundDirect[17], 255, "a7x_sj/%s.wav", SoundNames)
  627. else if(equali(sufijo,FULLSKILL))
  628. formatex(SoundDirect[18], 255, "a7x_sj/%s.wav", SoundNames)
  629. else if(equali(sufijo,KILLCONBOCHA))
  630. formatex(SoundDirect[19], 255, "a7x_sj/%s.wav", SoundNames)
  631. else if(equali(sufijo,VICTORIA))
  632. formatex(SoundDirect[20], 255, "a7x_sj/%s.wav", SoundNames)
  633. else if(equali(sufijo,TELEPORTCABINA))
  634. formatex(SoundDirect[21], 255, "a7x_sj/%s.wav", SoundNames)
  635. else if(equali(sufijo,DESARMAS))
  636. formatex(SoundDirect[22], 255, "a7x_sj/%s.wav", SoundNames)
  637. else if(equali(sufijo,TEDESARMAN))
  638. formatex(SoundDirect[23], 255, "a7x_sj/%s.wav", SoundNames)
  639. else if(equali(sufijo,SERARQUERO))
  640. formatex(SoundDirect[24], 255, "a7x_sj/%s.wav", SoundNames)
  641. else if(equali(sufijo,NOSERARQUERO))
  642. formatex(SoundDirect[25], 255, "a7x_sj/%s.wav", SoundNames)
  643. else if(equali(sufijo,SILBATO))
  644. formatex(SoundDirect[26], 255, "a7x_sj/%s.wav", SoundNames)
  645.  
  646. }
  647. }
  648. for(new x = 0; x < NUM_SOUNDS; x++)
  649. engfunc( EngFunc_PrecacheSound, SoundDirect[x])
  650. }
  651.  
  652. PrecacheBall()
  653. {
  654. new prefijo[4], sufijo[26], Data[128], len
  655. for(new x = 0; x < MAX_LINE_MODELS; x++)
  656. {
  657. read_file(FileCol, x, Data, 127, len)
  658. parse(Data, prefijo, 3, sufijo, 25)
  659. if(equali(prefijo,"##"))
  660. {
  661. for(new y = x + 1; y < x + 10; y++)
  662. {
  663. read_file(FileCol, y, Data, 127, len)
  664. if(equali(Data,""))
  665. continue
  666.  
  667. x = y - 1
  668. break;
  669. }
  670.  
  671. if(equali(sufijo,BOCHAGLOW))
  672. parse(Data, BCol[0], 3, BCol[1], 3, BCol[2], 3)
  673.  
  674. else if(equali(sufijo,BOCHACOLORBEAMCT))
  675. parse(Data, BCol[3], 3, BCol[4], 3, BCol[5], 3)
  676.  
  677. else if(equali(sufijo,BOCHACOLORBEAMTT))
  678. parse(Data, BCol[6], 3, BCol[7], 3, BCol[8], 3)
  679.  
  680. else if(equali(sufijo,BEAMGROSOR))
  681. parse(Data, BCol[9], 3)
  682.  
  683. else if(equali(sufijo,BEAMLIFE))
  684. parse(Data, BCol[10], 3)
  685.  
  686. else if(equali(sufijo,BOCHABRILLO))
  687. parse(Data, BCol[11], 3)
  688.  
  689. else if(equali(sufijo,PLAYERCOLORGLOWCT))
  690. parse(Data, PCol[0], 3, PCol[1], 3, PCol[2], 3)
  691.  
  692. else if(equali(sufijo,PLAYERCOLORGLOWTT))
  693. parse(Data, PCol[3], 3, PCol[4], 3, PCol[5], 3)
  694.  
  695. else if(equali(sufijo,ARQUEROCOLORGLOWCT))
  696. parse(Data, PCol[6], 3, PCol[7], 3, PCol[8], 3)
  697.  
  698. else if(equali(sufijo,ARQUEROCOLORGLOWTT))
  699. parse(Data, PCol[9], 3, PCol[10], 3, PCol[11], 3)
  700.  
  701. else if(equali(sufijo,PLAYERGROSORGLOW))
  702. parse(Data, PCol[12], 3)
  703.  
  704. else if(equali(sufijo,ARQUEROGROSORGLOW))
  705. parse(Data, PCol[13], 3)
  706.  
  707. else if(equali(sufijo,COLORGLOWOFFSIDE))
  708. parse(Data, PCol[14], 3, PCol[15], 3, PCol[16], 3)
  709.  
  710. else if(equali(sufijo,GROSORGLOWOFFSIDE))
  711. parse(Data, PCol[17], 3)
  712.  
  713. else if(equali(sufijo,COLORGLOWFOUL))
  714. parse(Data, PCol[18], 3, PCol[19], 3, PCol[20], 3)
  715.  
  716. else if(equali(sufijo,GROSORGLOWFOUL))
  717. parse(Data, PCol[21], 3)
  718.  
  719. else if(equali(sufijo,COLORTURBOCT))
  720. parse(Data, PCol[22], 3, PCol[23], 3, PCol[24], 3)
  721.  
  722. else if(equali(sufijo,COLORTURBOTT))
  723. parse(Data, PCol[25], 3, PCol[26], 3, PCol[27], 3)
  724.  
  725. else if(equali(sufijo,COLORCARTELSCORE))
  726. parse(Data, PCol[28], 3, PCol[29], 3, PCol[30], 3)
  727.  
  728. }
  729. }
  730. for(new x = 0; x < BOCHA_COLORS; x++)
  731. BallColors[x] = str_to_num(BCol[x])
  732.  
  733. for(new x = 0; x < PLAYER_COLORS; x++)
  734. PlayerColors[x] = str_to_num(PCol[x])
  735.  
  736.  
  737. new configDir[128]
  738. get_configsdir(configDir,127)
  739. formatex(FileCfg,255,"%s/a7x_sj/pro-cfg.ini",configDir)
  740.  
  741. ConfigPro[31] = 8;
  742.  
  743. new cantidad[32]
  744. for(new x = 0; x < MAX_LINE_MODELS; x++)
  745. {
  746. read_file(FileCfg, x, Data, 127, len)
  747. parse(Data, prefijo, 3, sufijo, 25, cantidad, 31)
  748. if(equali(prefijo,"##"))
  749. {
  750. if(equali(sufijo,MAXLVLSTAMINA))
  751. UpgradeMax[1] = str_to_num(cantidad)
  752. else if(equali(sufijo,MAXLVLSTRENGTH))
  753. UpgradeMax[2] = str_to_num(cantidad)
  754. else if(equali(sufijo,MAXLVLAGILITY))
  755. UpgradeMax[3] = str_to_num(cantidad)
  756. else if(equali(sufijo,MAXLVLDEXTERITY))
  757. UpgradeMax[4] = str_to_num(cantidad)
  758. else if(equali(sufijo,MAXLVLDISARM))
  759. UpgradeMax[5] = str_to_num(cantidad)
  760. else if(equali(sufijo,EXPPRICESTAMINA))
  761. UpgradePrice[1] = str_to_num(cantidad)
  762. else if(equali(sufijo,EXPPRICESTRENGTH))
  763. UpgradePrice[2] = str_to_num(cantidad)
  764. else if(equali(sufijo,EXPPRICEAGILITY))
  765. UpgradePrice[3] = str_to_num(cantidad)
  766. else if(equali(sufijo,EXPPRICEDEXTERITY))
  767. UpgradePrice[4] = str_to_num(cantidad)
  768. else if(equali(sufijo,EXPPRICEDISARM))
  769. UpgradePrice[5] = str_to_num(cantidad)
  770. else if(equali(sufijo,EXPGOLEQUIPO))
  771. ConfigPro[0] = str_to_num(cantidad)
  772. else if(equali(sufijo,EXPROBO))
  773. ConfigPro[1] = str_to_num(cantidad)
  774. else if(equali(sufijo,EXPBALLKILL))
  775. ConfigPro[2] = str_to_num(cantidad)
  776. else if(equali(sufijo,EXPASISTENCIA))
  777. ConfigPro[3] = str_to_num(cantidad)
  778. else if(equali(sufijo,EXPGOL))
  779. ConfigPro[4] = str_to_num(cantidad)
  780. else if(equali(sufijo,BASEHP))
  781. ConfigPro[5] = str_to_num(cantidad)
  782. else if(equali(sufijo,BASEDISARM))
  783. ConfigPro[6] = str_to_num(cantidad)
  784. else if(equali(sufijo,CUENTAREGRESIVA))
  785. ConfigPro[7] = str_to_num(cantidad)
  786. else if(equali(sufijo,TIEMPOEXPCAMPEAR))
  787. ConfigPro[8] = str_to_num(cantidad)
  788. else if(equali(sufijo,CURVEANGLE))
  789. ConfigPro[9] = str_to_num(cantidad)
  790. else if(equali(sufijo,CURVECOUNT))
  791. ConfigPro[10] = str_to_num(cantidad)
  792. else if(equali(sufijo,DIRECTIONS))
  793. ConfigPro[11] = str_to_num(cantidad)
  794. else if(equali(sufijo,ANGLEDIVIDE))
  795. ConfigPro[12] = str_to_num(cantidad)
  796. else if(equali(sufijo,AMOUNTLATEJOINEXP))
  797. ConfigPro[13] = str_to_num(cantidad)
  798. else if(equali(sufijo,AMOUNTPOWERPLAY))
  799. ConfigPro[14] = str_to_num(cantidad)
  800. else if(equali(sufijo,AMOUNTGOALY))
  801. ConfigPro[15] = str_to_num(cantidad)
  802. else if(equali(sufijo,AMOUNTSTA))
  803. ConfigPro[16] = str_to_num(cantidad)
  804. else if(equali(sufijo,AMOUNTSTR))
  805. ConfigPro[17] = str_to_num(cantidad)
  806. else if(equali(sufijo,AMOUNTAGI))
  807. ConfigPro[18] = str_to_num(cantidad)
  808. else if(equali(sufijo,AMOUNTDEX))
  809. ConfigPro[19] = str_to_num(cantidad)
  810. else if(equali(sufijo,AMOUNTDISARM))
  811. ConfigPro[20] = str_to_num(cantidad)
  812.  
  813. else if(equali(sufijo,RANKGOL))
  814. ConfigPro[21] = str_to_num(cantidad)
  815. else if(equali(sufijo,RANKGOLENCONTRA))
  816. ConfigPro[22] = str_to_num(cantidad)
  817. else if(equali(sufijo,RANKROBO))
  818. ConfigPro[23] = str_to_num(cantidad)
  819. else if(equali(sufijo,RANKREGALO))
  820. ConfigPro[24] = str_to_num(cantidad)
  821. else if(equali(sufijo,RANKASISTENCIA))
  822. ConfigPro[25] = str_to_num(cantidad)
  823. else if(equali(sufijo,RANKBALLKILL))
  824. ConfigPro[26] = str_to_num(cantidad)
  825. else if(equali(sufijo,RANKRVBALLKILL))
  826. ConfigPro[27] = str_to_num(cantidad)
  827. else if(equali(sufijo,RANKDISARM))
  828. ConfigPro[28] = str_to_num(cantidad)
  829. else if(equali(sufijo,RANKRVDISARM))
  830. ConfigPro[29] = str_to_num(cantidad)
  831.  
  832. else if(equali(sufijo,VISORHP))
  833. ConfigPro[30] = str_to_num(cantidad)
  834.  
  835. else if(equali(sufijo,MAXRANK))
  836. ConfigPro[31] = str_to_num(cantidad)
  837.  
  838. else if(equali(sufijo,NOMBRETEAMCT))
  839. {
  840. new formatoname[64]
  841. format(formatoname, 63,"^"%s^"", cantidad)
  842. TeamNames[2] = cantidad
  843. }
  844. else if(equali(sufijo,NOMBRETEAMTT))
  845. {
  846. new formatoname[64]
  847. format(formatoname, 63,"^"%s^"", cantidad)
  848. TeamNames[1] = cantidad
  849. }
  850. else if(equali(sufijo,NOMBRETEAMSPEC))
  851. {
  852. new formatoname[64]
  853. format(formatoname, 63,"^"%s^"", cantidad)
  854. TeamNames[0] = cantidad
  855. TeamNames[3] = cantidad
  856. }
  857. }
  858. }
  859. }
  860.  
  861. PrecacheMonsters(team) {
  862. engfunc( EngFunc_PrecacheModel, TeamMascots[team-1])
  863. }
  864.  
  865. PrecacheSprites()
  866. {
  867. new configDir[128]
  868. new DirectSprite[128]
  869. get_configsdir(configDir,127)
  870. formatex(FileSpr,255,"%s/a7x_sj/pro-sprites.ini",configDir)
  871. new prefijo[4], sufijo[26], Data[128], len
  872. for(new x = 0; x < MAX_LINE_MODELS; x++)
  873. {
  874. read_file(FileSpr, x, Data, 127, len)
  875. parse(Data, prefijo, 3, sufijo, 25)
  876. if(equali(prefijo,"##"))
  877. {
  878. for(new y = x + 1; y < x + 10; y++)
  879. {
  880. read_file(FileSpr, y, Data, 127, len)
  881. if(equali(Data,""))
  882. continue
  883.  
  884. x = y - 1
  885. break;
  886. }
  887.  
  888. if(equali(sufijo,EXPLOSIONGOL))
  889. {
  890. parse(Data, SSprite[0], 127)
  891. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[0])
  892. fire = engfunc( EngFunc_PrecacheModel, DirectSprite)
  893. }
  894. else if(equali(sufijo,EFECTOHUMO))
  895. {
  896. parse(Data, SSprite[1], 127)
  897. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[1])
  898. smoke = engfunc( EngFunc_PrecacheModel, DirectSprite)
  899. }
  900. else if(equali(sufijo,POWERPLAY))
  901. {
  902. parse(Data, SSprite[2], 127)
  903. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[2])
  904. Burn_Sprite = engfunc( EngFunc_PrecacheModel, DirectSprite)
  905. }
  906. else if(equali(sufijo,RAYOMASCOTA))
  907. {
  908. parse(Data, SSprite[3], 127)
  909. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[3])
  910. g_fxBeamSprite = engfunc( EngFunc_PrecacheModel, DirectSprite)
  911. }
  912. else if(equali(sufijo,FESTEJOGOLBARCA))
  913. {
  914. parse(Data, SSprite[4], 127)
  915. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[4])
  916. SpriteGolBarca = engfunc( EngFunc_PrecacheModel, DirectSprite)
  917. }
  918. else if(equali(sufijo,FESTEJOGOLREAL))
  919. {
  920. parse(Data, SSprite[5], 127)
  921. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[5])
  922. SpriteGolReal = engfunc( EngFunc_PrecacheModel, DirectSprite)
  923. }
  924. else if(equali(sufijo,FESTEJOGOLENCONTRA))
  925. {
  926. parse(Data, SSprite[6], 127)
  927. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[6])
  928. SpriteGolContra = engfunc( EngFunc_PrecacheModel, DirectSprite)
  929. }
  930. else if(equali(sufijo,BOCHABEAM))
  931. {
  932. parse(Data, SSprite[7], 127)
  933. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[7])
  934. beamspr = engfunc( EngFunc_PrecacheModel, DirectSprite)
  935. }
  936. else if(equali(sufijo,BOCHABEAM2))
  937. {
  938. parse(Data, SSprite[8], 127)
  939. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[8])
  940. beamspr2 = engfunc( EngFunc_PrecacheModel, DirectSprite)
  941. }
  942. else if(equali(sufijo,LINEAOFFSIDE))
  943. {
  944. parse(Data, SSprite[9], 127)
  945. formatex(DirectSprite, 127, "sprites/a7x_sj/%s.spr", SSprite[9])
  946. offbeam = engfunc( EngFunc_PrecacheModel, DirectSprite)
  947. }
  948. }
  949. }
  950. }
  951.  
  952.  
  953. public plugin_precache()
  954. {
  955. new mapname[64]
  956. get_mapname(mapname,63)
  957.  
  958. new configDir[128]
  959. get_configsdir(configDir,127)
  960.  
  961. formatex(FileMdl,255,"%s/a7x_sj/pro-models.ini",configDir)
  962. formatex(FileCol,255,"%s/a7x_sj/pro-colors.ini",configDir)
  963.  
  964. /*
  965. precache_model(spr_teams);
  966. precache_model(spr_digits);
  967. */
  968.  
  969. if(equali(mapname,"soccerjam") || (containi(mapname, "sj_") != -1))
  970. {
  971. new spawndir[256]
  972. format(spawndir,255,"%s/a7x_sj/Sj-Pro_spawns",configDir)
  973. if (!dir_exists(spawndir))
  974. {
  975. if (mkdir(spawndir)==0)
  976. {
  977. log_amx("Diretorio [%s] criado",spawndir)
  978. }
  979. else
  980. {
  981. log_error(AMX_ERR_NOTFOUND,"Nao e possivel criar diretorio o [%s], os spawns nao foram adaptados.",spawndir)
  982. pause("ad")
  983. }
  984. }
  985.  
  986. format(SpawnSjPro, 255, "%s/%s_Sj-Pro.cfg",spawndir, mapname)
  987.  
  988. set_task(6.0,"PossSpawnSjPro")
  989.  
  990.  
  991. new timestamp;
  992.  
  993. new RankMax[MAX_PLAYER + 1]
  994.  
  995.  
  996.  
  997. topVault = nvault_open(VAULTNAMETOP);
  998.  
  999. new rankkey[64], rankdata[64];
  1000. format(rankkey, 63, "RankKey");
  1001. if(nvault_lookup(topVault, rankkey, rankdata, 1500, timestamp))
  1002. {
  1003. parse(rankdata,RankMax, MAX_PLAYER);
  1004. TotalRank = str_to_num(RankMax);
  1005. }
  1006. else
  1007. {
  1008. format(rankdata, 63, "0")
  1009. nvault_set(topVault, rankkey, rankdata);
  1010. TotalRank = 0
  1011. }
  1012. nvault_close(topVault);
  1013.  
  1014. new SDirect[256]
  1015. new prefijo[4], sufijo[26], Data[128], len
  1016. for(new x = 0; x < MAX_LINE_MODELS; x++)
  1017. {
  1018. read_file(FileMdl, x, Data, 127, len)
  1019. parse(Data, prefijo, 3, sufijo, 25)
  1020. if(equali(prefijo,"##"))
  1021. {
  1022. for(new y = x + 1; y < x + 10; y++)
  1023. {
  1024. read_file(FileMdl, y, Data, 127, len)
  1025. if(equali(Data,""))
  1026. continue
  1027.  
  1028. x = y - 1
  1029. break;
  1030. }
  1031.  
  1032. if(equali(sufijo,MODELBOCHA))
  1033. {
  1034. parse(Data, SModel[0], 127)
  1035. formatex(SDirect, sizeof SDirect - 1, "models/a7x_sj/Bola/%s.mdl", SModel[0])
  1036. copy(ball, sizeof ball - 1, SDirect)
  1037. }
  1038.  
  1039. else if(equali(sufijo,MODELARQUEROCT))
  1040. {
  1041. parse(Data, SModel[1], 127)
  1042. formatex(SDirect, sizeof SDirect - 1, "models/player/%s/%s.mdl", SModel[1], SModel[1])
  1043. }
  1044.  
  1045. else if(equali(sufijo,MODELARQUEROTT))
  1046. {
  1047. parse(Data, SModel[2], 127)
  1048. formatex(SDirect, sizeof SDirect - 1, "models/player/%s/%s.mdl", SModel[2], SModel[2])
  1049. }
  1050.  
  1051. else if(equali(sufijo,VMODELFAKAARQUERO))
  1052. {
  1053. parse(Data, SModel[3], 127)
  1054. formatex(SDirect, sizeof SDirect - 1, "models/a7x_sj/Facas/%s.mdl", SModel[3])
  1055. }
  1056. else if(equali(sufijo,PMODELFAKAARQUERO))
  1057. {
  1058. parse(Data, SModel[4], 127)
  1059. formatex(SDirect, sizeof SDirect - 1, "models/a7x_sj/Facas/%s.mdl", SModel[4])
  1060. }
  1061. else if(equali(sufijo,VMODELFAKAPLAYER))
  1062. {
  1063. parse(Data, SModel[5], 127)
  1064. formatex(SDirect, sizeof SDirect - 1, "models/%s.mdl", SModel[5])
  1065. }
  1066. else if(equali(sufijo,PMODELFAKAPLAYER))
  1067. {
  1068. parse(Data, SModel[6], 127)
  1069. formatex(SDirect, sizeof SDirect - 1, "models/%s.mdl", SModel[6])
  1070. }
  1071.  
  1072. precache_model(SDirect)
  1073. }
  1074. }
  1075. precache_model("models/rpgrocket.mdl") // Camara 3D
  1076. precache_model("models/player/a7x_sj_barca/a7x_sj_barca.mdl")
  1077. precache_model("models/player/a7x_sj_real/a7x_sj_real.mdl")
  1078. }
  1079. }
  1080.  
  1081. PrecacheOther()
  1082. {
  1083. engfunc( EngFunc_PrecacheModel, "models/chick.mdl")
  1084. }
  1085.  
  1086. /*====================================================================================================
  1087. [Initialize]
  1088.  
  1089. Purpose: $$
  1090.  
  1091. Comment: $$
  1092.  
  1093. ====================================================================================================*/
  1094.  
  1095. public plugin_init()
  1096. {
  1097. new mapname[64]
  1098. get_mapname(mapname,63)
  1099.  
  1100. register_cvar("Sj-Pro", "0", FCVAR_SERVER|FCVAR_SPONLY)
  1101. register_cvar("Sj-Pro_Version", VERSION, FCVAR_SERVER|FCVAR_SPONLY)
  1102.  
  1103. set_cvar_string("Sj-Pro_Version", VERSION)
  1104.  
  1105.  
  1106.  
  1107. /*
  1108.  
  1109. //menus
  1110. register_menucmd(register_menuid("clockMainMenu"), MAIN_MENU_KEYS, "handleMainMenu");
  1111.  
  1112. //commands
  1113. register_clcmd("say /cm", "showClockMenu", ADMIN_LEVEL);
  1114.  
  1115. */
  1116.  
  1117. if(is_kickball > 0)
  1118. {
  1119. PrecacheSprites()
  1120.  
  1121. register_plugin("Soccerjam PRO", VERSION, AUTHOR)
  1122. set_cvar_num("Sj-Pro", 1)
  1123.  
  1124. timer = ConfigPro[7]
  1125.  
  1126. // Message IDs
  1127.  
  1128. gmsgTextMsg = get_user_msgid("TextMsg")
  1129. gmsgDeathMsg = get_user_msgid("DeathMsg")
  1130. gmsgShake = get_user_msgid("ScreenShake")
  1131. gmsgSayText = get_user_msgid("SayText")
  1132. g_msgScreenFade = get_user_msgid("ScreenFade")
  1133.  
  1134.  
  1135. maxplayers = get_maxplayers()
  1136.  
  1137. if(equali(mapname,"soccerjam"))
  1138. {
  1139. PrecacheOther()
  1140. CreateGoalNets()
  1141. create_wall()
  1142. set_cvar_num("sj_score", 25)
  1143. register_clcmd("say /aco","spec_cabina")
  1144. }
  1145.  
  1146. if(equali(mapname,"sj_indoorx_small"))
  1147. {
  1148. register_clcmd("say /aco","spec_cabina")
  1149. set_cvar_num("sj_score", 25)
  1150. }
  1151.  
  1152. if(equali(mapname,"sj_pro") || equali(mapname,"sj_pro_small"))
  1153. {
  1154. register_clcmd("say /aco","spec_cabina")
  1155. set_cvar_num("sj_score", 25)
  1156. }
  1157.  
  1158. sj_password_field = register_cvar("sj_password_field", "_sj")
  1159.  
  1160. register_event("CurWeapon","CurWeapon","be","1=1")
  1161.  
  1162. register_clcmd("say","handle_say")
  1163.  
  1164. register_clcmd("say pipe","sumar_score1")
  1165.  
  1166. register_clcmd("Password_rank", "NewUserRank");
  1167.  
  1168. register_event("ResetHUD", "Event_ResetHud", "be")
  1169. register_event("HLTV","Event_StartRound","a","1=0","2=0")
  1170. register_event("Damage", "Event_Damage", "b", "2!0", "3=0", "4!0" )
  1171. register_event("Health", "health_change", "b")
  1172. RegisterHam( Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1 )
  1173.  
  1174. register_clcmd("say /goleiro","cmdKeeper")
  1175. register_clcmd("say /gk","cmdKeeper")
  1176. register_clcmd("say_team /goleiro","cmdKeeper")
  1177. register_clcmd("say_team /gk","cmdKeeper")
  1178. register_clcmd("say /sairgoleiro","cmdUnKeeper")
  1179. register_clcmd("say /sairgk","cmdUnKeeper")
  1180. register_clcmd("say_team /sairgoleiro","cmdUnKeeper")
  1181. register_clcmd("say_team /sairgk","cmdUnKeeper")
  1182. register_clcmd("say /menu","sjmenuclient")
  1183. register_clcmd("say_team /menu","sjmenuclient")
  1184. register_clcmd("amx_addxp", "CmdAddXP", ADMIN_RCON, "<nome> <xp>")
  1185. register_clcmd("amx_addfull", "CmdFull", ADMIN_RCON, "<nome>")
  1186.  
  1187. register_menucmd(register_menuid("Menu de cameras"), 1023, "setview")
  1188. register_clcmd("say /camera", "chooseview")
  1189. register_clcmd("say_team /camera", "chooseview")
  1190. register_clcmd("say /cam", "chooseview")
  1191. register_clcmd("say_team /cam", "chooseview")
  1192.  
  1193.  
  1194. if(ConfigPro[30])
  1195. {
  1196. MsgHideWeapon = get_user_msgid("HideWeapon")
  1197. register_message(MsgHideWeapon, "msg_hideweapon")
  1198.  
  1199. MonitorHudSync = CreateHudSyncObj()
  1200.  
  1201. new monitor = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  1202. if ( monitor )
  1203. {
  1204. set_pev(monitor, pev_classname, "monitorloop")
  1205. set_pev(monitor, pev_nextthink, get_gametime() + 0.1)
  1206. register_forward(FM_Think, "monitor_think")
  1207. }
  1208. }
  1209.  
  1210. register_concmd("amx_start","restartpartido",ADMIN_KICK,"A Partida se iniciara em 10 segundos")
  1211.  
  1212. register_concmd("help","sjmenuhelp")
  1213. register_concmd("help_pro","comandos_adm", ADMIN_KICK,"Os Admins podem vizualizar todos os comandos disponiveis")
  1214.  
  1215. register_concmd("amx_exp","experiencia", ADMIN_KICK,"Dar EXP a todos os jogadores")
  1216. register_concmd("amx_full","fullall", ADMIN_KICK,"Deixar FULL as skills de todos os jogadores")
  1217. register_concmd("amx_spec","todosspec", ADMIN_KICK,"Mandar todos os jogadores para spec menos os ADMINS")
  1218. register_concmd("amx_sjmenu","menu_pro", ADMIN_KICK,"Menu para adms")
  1219. register_concmd("amx_unkeeper","QuitarKeeper")
  1220. register_concmd("amx_asd","MenuQuitarKeeper")
  1221. register_concmd("menu","sj_editor_menu")
  1222.  
  1223.  
  1224. register_concmd("sj_cerrado","SvCerrado")
  1225. register_concmd("sj_publico","SvPublico")
  1226. register_concmd("sj_vale","SvVale")
  1227. register_concmd("sj_fragarqueros","SvFrag")
  1228.  
  1229. register_event("TeamInfo", "join_team", "a")
  1230.  
  1231. register_clcmd("chooseteam","clcmd_changeteam")
  1232.  
  1233. // register_concmd("amx_mifull","miexperiencia")
  1234.  
  1235. register_concmd("records","records")
  1236.  
  1237. register_concmd("allrecords","allrecords")
  1238.  
  1239.  
  1240. register_clcmd("say /sjrank", "sjrank")
  1241. register_clcmd("say_team /sjrank", "sjrank")
  1242. register_clcmd("say /sjstats", "RankEstadisticas")
  1243. register_clcmd("say_team /sjstats", "RankEstadisticas")
  1244. register_clcmd("say /sjtop10", "SjTop10")
  1245. register_clcmd("say_team /sjtop10", "SjTop10")
  1246.  
  1247.  
  1248. // register_forward(FM_GetGameDescription,"GameDesc")
  1249. register_forward(FM_PlayerPreThink, "glow_del_player")
  1250.  
  1251. register_forward(FM_Touch , "fTouch")
  1252.  
  1253. CVAR_SCORE = register_cvar("sj_score","25")
  1254. CVAR_RESET = register_cvar("sj_reset","30.0")
  1255. CVAR_GOALSAFETY = register_cvar("sj_goalsafety","650")
  1256. CVAR_KICK = register_cvar("sj_kick","650")
  1257. CVAR_RESPAWN = 2.0 //register_cvar("kickball_respawn","2.0")
  1258. CVAR_RANDOM = register_cvar("sj_random","1")
  1259. CVAR_KILLNEARBALL = register_cvar("sj_kill_distance_ball", "500.0")
  1260. CVAR_KILLNEARHOLDER = register_cvar("sj_kill_distance_holder", "96.0")
  1261.  
  1262. CVAR_KILLNEARAREA = register_cvar("sj_areas", "700.0")
  1263.  
  1264. sj_systemrank = 1
  1265.  
  1266. CVAR_FRAG = register_cvar("sj_frag","0")
  1267. CVAR_POSS = register_cvar("sj_poss_areas","0")
  1268. CVAR_LIMITES = register_cvar("sj_limites","0")
  1269. CVAR_ARQUEROS = register_cvar("sj_goleiros","1")
  1270. CVAR_ENCONTRA = register_cvar("sj_golscontra","0")
  1271. CVAR_FOUL = register_cvar("sj_falta","0")
  1272. CVAR_OFFSIDE = register_cvar("sj_impedimento","0")
  1273. CVAR_SPEC = register_cvar("sj_spec","1")
  1274. CVAR_SPEC_CABINAS = register_cvar("sj_spec_cabines","1")
  1275. CVAR_RANK = register_cvar("sj_rank","1")
  1276. CVAR_RESEXP = register_cvar("sj_systemexp","1")
  1277.  
  1278. register_cvar("SCORE_CT","0")
  1279. register_cvar("SCORE_T","0")
  1280.  
  1281. register_touch(a_Classname,"player", "teleport_aco")
  1282. register_touch(b_Classname,"player", "teleport_2")
  1283.  
  1284. register_touch(p_Classname,"player", "tocoarcot")
  1285. register_touch(g_Classname,"player", "tocoarcoct")
  1286.  
  1287. register_touch(y_Classname,"player", "limitet")
  1288. register_touch(z_Classname,"player", "limitect")
  1289.  
  1290. register_touch("PwnBall", "player", "touchPlayer")
  1291. register_touch("PwnBall", "soccerjam_goalnet", "touchNet")
  1292.  
  1293. register_touch("PwnBall", "worldspawn", "touchWorld")
  1294. register_touch("PwnBall", "func_wall", "touchWorld")
  1295. register_touch("PwnBall", "func_door", "touchWorld")
  1296. register_touch("PwnBall", "func_door_rotating", "touchWorld")
  1297. register_touch("PwnBall", "func_wall_toggle", "touchWorld")
  1298. register_touch("PwnBall", "func_breakable", "touchWorld")
  1299. register_touch("PwnBall", "Blocker", "touchBlocker")
  1300.  
  1301. set_task(0.4,"meter",0,_,_,"b")
  1302. set_task(0.5,"statusDisplay",7654321,"",0,"b")
  1303.  
  1304. set_task(1.0, "AutoRestart")
  1305.  
  1306. register_think("PwnBall","ball_think")
  1307. register_think("Mascot", "mascot_think")
  1308.  
  1309. register_clcmd("radio1", "LeftDirection", 0)
  1310. register_clcmd("radio2", "RightDirection", 0)
  1311. register_clcmd("drop", "Turbo")
  1312. register_clcmd("lastinv", "BuyUpgrade")
  1313. register_clcmd("fullupdate", "fullupdate")
  1314.  
  1315. register_message(gmsgTextMsg, "editTextMsg")
  1316.  
  1317. TeamInfo = get_user_msgid("TeamInfo");
  1318. SayText = get_user_msgid("SayText");
  1319. MaxSlots = get_maxplayers();
  1320.  
  1321. //Setup config file paths
  1322. lconfig()
  1323.  
  1324. OFFSET_INTERNALMODEL = is_amd64_server() ? 152 : 126;
  1325. }
  1326. else
  1327. {
  1328. register_plugin("SoccerJam OFF", VERSION, AUTHOR)
  1329. set_cvar_num("Sj-Pro",0)
  1330. }
  1331. return PLUGIN_HANDLED
  1332. }
  1333.  
  1334. public CmdAddXP(id,level,cid)
  1335. {
  1336. if(!cmd_access(id,level,cid,3))
  1337. {
  1338. return PLUGIN_HANDLED
  1339. }
  1340. if(!Acesso(id)) return PLUGIN_HANDLED;
  1341.  
  1342. new arg[32], xp[64]
  1343.  
  1344. read_argv(1, arg, 31)
  1345. read_argv(2, xp, 63)
  1346.  
  1347. remove_quotes(xp)
  1348.  
  1349. new target = cmd_target(id, arg, 3)
  1350. new szNome[32]; get_user_name(target, szNome, charsmax(szNome))
  1351.  
  1352. new sXP = str_to_num(xp)
  1353.  
  1354. if(!is_user_connected(target)) return PLUGIN_HANDLED;
  1355.  
  1356. g_Experience[target] += sXP
  1357. client_print(id, print_chat, "Voce Adicionou %d XP para o Jogador %s", sXP, szNome)
  1358. return PLUGIN_HANDLED;
  1359. }
  1360. public CmdFull(id,level,cid)
  1361. {
  1362. if(!cmd_access(id,level,cid,2))
  1363. {
  1364. return PLUGIN_HANDLED
  1365. }
  1366. if(!Acesso(id)) return PLUGIN_HANDLED;
  1367.  
  1368. new arg[32]
  1369. read_argv(1, arg, 31)
  1370.  
  1371. new target = cmd_target(id, arg, 3)
  1372. new szNome[32]; get_user_name(target, szNome, charsmax(szNome))
  1373.  
  1374. if(!is_user_connected(target)) return PLUGIN_HANDLED;
  1375.  
  1376. PlayerUpgrades[target][1] = UpgradeMax[1]
  1377. PlayerUpgrades[target][2] = UpgradeMax[2]
  1378. PlayerUpgrades[target][3] = UpgradeMax[3]
  1379. PlayerUpgrades[target][4] = UpgradeMax[4]
  1380. PlayerUpgrades[target][5] = UpgradeMax[5]
  1381. client_print(id, print_chat, "Voce Deixou o Jogador %s Full", szNome)
  1382. return PLUGIN_HANDLED;
  1383. }
  1384.  
  1385. public sumar_score1()
  1386. {
  1387. server_cmd("sumar_score %d %d", score[1], score[2])
  1388. }
  1389.  
  1390. /*====================================================================================================
  1391. [Initialize Entities]
  1392.  
  1393. Purpose: Handles our custom entities, created with Valve Hammer, and fixes for soccerjam.bsp.
  1394.  
  1395. Comment: $$
  1396.  
  1397. ====================================================================================================*/
  1398. public pfn_keyvalue(entid) {
  1399.  
  1400. new classname[MAX_PLAYER + 1], key[MAX_PLAYER + 1], value[MAX_PLAYER + 1]
  1401. copy_keyvalue(classname, MAX_PLAYER, key, MAX_PLAYER, value, MAX_PLAYER)
  1402.  
  1403. new temp_origins[3][10], x, team
  1404. new temp_angles[3][10]
  1405.  
  1406. if(equal(key, "classname") && equal(value, "soccerjam_goalnet"))
  1407. DispatchKeyValue("classname", "func_wall")
  1408.  
  1409. if(equal(classname, "game_player_equip")){
  1410. if(!is_kickball || !gamePlayerEquip)
  1411. gamePlayerEquip = entid
  1412. else {
  1413. remove_entity(entid)
  1414. }
  1415. }
  1416. else if(equal(classname, "func_wall"))
  1417. {
  1418. if(equal(key, "team"))
  1419. {
  1420. team = str_to_num(value)
  1421. if(team == 1 || team == 2) {
  1422. GoalEnt[team] = entid
  1423. set_task(1.0, "FinalizeGoalNet", team)
  1424. }
  1425. }
  1426. }
  1427. else if(equal(classname, "soccerjam_mascot"))
  1428. {
  1429.  
  1430. if(equal(key, "team"))
  1431. {
  1432. team = str_to_num(value)
  1433. create_mascot(team)
  1434. }
  1435. else if(equal(key, "origin"))
  1436. {
  1437. parse(value, temp_origins[0], 9, temp_origins[1], 9, temp_origins[2], 9)
  1438. for(x=0; x<3; x++)
  1439. MascotsOrigins[x] = floatstr(temp_origins[x])
  1440. }
  1441. else if(equal(key, "angles"))
  1442. {
  1443. parse(value, temp_angles[0], 9, temp_angles[1], 9, temp_angles[2], 9)
  1444. for(x=0; x<3; x++)
  1445. MascotsAngles[x] = floatstr(temp_angles[x])
  1446. }
  1447. }
  1448. else if(equal(classname, "soccerjam_teamball"))
  1449. {
  1450. if(equal(key, "team"))
  1451. {
  1452. team = str_to_num(value)
  1453. for(x=0; x<3; x++)
  1454. TeamBallOrigins[team][x] = TEMP_TeamBallOrigins[x]
  1455. }
  1456. else if(equal(key, "origin"))
  1457. {
  1458. parse(value, temp_origins[0], 9, temp_origins[1], 9, temp_origins[2], 9)
  1459. for(x=0; x<3; x++)
  1460. TEMP_TeamBallOrigins[x] = floatstr(temp_origins[x])
  1461. }
  1462. }
  1463. else if(equal(classname, "soccerjam_ballspawn"))
  1464. {
  1465. if(equal(key, "origin")) {
  1466. is_kickball = 1
  1467.  
  1468. create_Game_Player_Equip()
  1469.  
  1470. PrecacheBall()
  1471. PrecacheSounds()
  1472.  
  1473. if(ballspawncount < MAX_BALL_SPAWNS) {
  1474. parse(value, temp_origins[0], 9, temp_origins[1], 9, temp_origins[2], 9)
  1475.  
  1476. BallSpawnOrigin[ballspawncount][0] = floatstr(temp_origins[0])
  1477. BallSpawnOrigin[ballspawncount][1] = floatstr(temp_origins[1])
  1478. BallSpawnOrigin[ballspawncount][2] = floatstr(temp_origins[2]) + 10.0
  1479.  
  1480. ballspawncount++
  1481. }
  1482. }
  1483. }
  1484. }
  1485.  
  1486. createball() {
  1487.  
  1488. new entity = create_entity("info_target")
  1489. if (entity) {
  1490.  
  1491. entity_set_string(entity,EV_SZ_classname,"PwnBall")
  1492. entity_set_model(entity, ball)
  1493.  
  1494. entity_set_int(entity, EV_INT_solid, SOLID_BBOX)
  1495. entity_set_int(entity, EV_INT_movetype, MOVETYPE_BOUNCE)
  1496.  
  1497. new Float:MinBox[3]
  1498. new Float:MaxBox[3]
  1499. MinBox[0] = -15.0
  1500. MinBox[1] = -15.0
  1501. MinBox[2] = 0.0
  1502. MaxBox[0] = 15.0
  1503. MaxBox[1] = 15.0
  1504. MaxBox[2] = 12.0
  1505.  
  1506. entity_set_vector(entity, EV_VEC_mins, MinBox)
  1507. entity_set_vector(entity, EV_VEC_maxs, MaxBox)
  1508.  
  1509. glow(entity,BallColors[0],BallColors[1],BallColors[2],10)
  1510.  
  1511.  
  1512. entity_set_float(entity,EV_FL_framerate,0.0)
  1513. entity_set_int(entity,EV_INT_sequence,0)
  1514. }
  1515. //save our entity ID to aball variable
  1516. aball = entity
  1517. entity_set_float(entity,EV_FL_nextthink,halflife_time() + 0.05)
  1518. return PLUGIN_HANDLED
  1519. }
  1520.  
  1521. public cambiarmove(param)
  1522. {
  1523. entity_set_int(aball,EV_INT_sequence,param)
  1524. }
  1525.  
  1526. public cambiarframe(Float:param)
  1527. {
  1528. entity_set_float(aball,EV_FL_framerate,param)
  1529. }
  1530.  
  1531.  
  1532. CreateGoalNets() {
  1533.  
  1534. new endzone, x
  1535. new Float:orig[3]
  1536. new Float:MinBox[3], Float:MaxBox[3]
  1537.  
  1538. for(x=1;x<3;x++) {
  1539. endzone = create_entity("info_target")
  1540. if (endzone) {
  1541.  
  1542. entity_set_string(endzone,EV_SZ_classname,"soccerjam_goalnet")
  1543. entity_set_model(endzone, "models/chick.mdl")
  1544. entity_set_int(endzone, EV_INT_solid, SOLID_BBOX)
  1545. entity_set_int(endzone, EV_INT_movetype, MOVETYPE_NONE)
  1546.  
  1547. MinBox[0] = -25.0; MinBox[1] = -145.0; MinBox[2] = -36.0
  1548. MaxBox[0] = 25.0; MaxBox[1] = 145.0; MaxBox[2] = 70.0
  1549.  
  1550. entity_set_vector(endzone, EV_VEC_mins, MinBox)
  1551. entity_set_vector(endzone, EV_VEC_maxs, MaxBox)
  1552.  
  1553. switch(x) {
  1554. case 1: {
  1555. orig[0] = 2110.0
  1556. orig[1] = 0.0
  1557. orig[2] = 1604.0
  1558. }
  1559. case 2: {
  1560. orig[0] = -2550.0
  1561. orig[1] = 0.0
  1562. orig[2] = 1604.0
  1563. }
  1564. }
  1565.  
  1566. entity_set_origin(endzone,orig)
  1567.  
  1568. entity_set_int(endzone, EV_INT_team, x)
  1569. set_entity_visibility(endzone, 0)
  1570. GoalEnt[x] = endzone
  1571. }
  1572. }
  1573.  
  1574. }
  1575.  
  1576. create_wall() {
  1577. new wall = create_entity("func_wall")
  1578. if(wall)
  1579. {
  1580. new Float:orig[3]
  1581. new Float:MinBox[3], Float:MaxBox[3]
  1582. entity_set_string(wall,EV_SZ_classname,"Blocker")
  1583. entity_set_model(wall, "models/chick.mdl")
  1584.  
  1585. entity_set_int(wall, EV_INT_solid, SOLID_BBOX)
  1586. entity_set_int(wall, EV_INT_movetype, MOVETYPE_NONE)
  1587.  
  1588. MinBox[0] = -72.0; MinBox[1] = -100.0; MinBox[2] = -72.0
  1589. MaxBox[0] = 72.0; MaxBox[1] = 100.0; MaxBox[2] = 72.0
  1590.  
  1591. entity_set_vector(wall, EV_VEC_mins, MinBox)
  1592. entity_set_vector(wall, EV_VEC_maxs, MaxBox)
  1593.  
  1594. orig[0] = 2355.0
  1595. orig[1] = 1696.0
  1596. orig[2] = 1604.0
  1597. entity_set_origin(wall,orig)
  1598. set_entity_visibility(wall, 0)
  1599. }
  1600. }
  1601.  
  1602. create_mascot(team)
  1603. {
  1604. new Float:MinBox[3], Float:MaxBox[3]
  1605. new mascot = create_entity("info_target")
  1606. if(mascot)
  1607. {
  1608. PrecacheMonsters(team)
  1609. entity_set_string(mascot,EV_SZ_classname,"Mascot")
  1610. entity_set_model(mascot, TeamMascots[team-1])
  1611. Mascots[team] = mascot
  1612.  
  1613. entity_set_int(mascot, EV_INT_solid, SOLID_NOT)
  1614. entity_set_int(mascot, EV_INT_movetype, MOVETYPE_NONE)
  1615. entity_set_int(mascot, EV_INT_team, team)
  1616. MinBox[0] = -16.0; MinBox[1] = -16.0; MinBox[2] = -72.0
  1617. MaxBox[0] = 16.0; MaxBox[1] = 16.0; MaxBox[2] = 72.0
  1618. entity_set_vector(mascot, EV_VEC_mins, MinBox)
  1619. entity_set_vector(mascot, EV_VEC_maxs, MaxBox)
  1620. //orig[2] += 200.0
  1621.  
  1622. entity_set_origin(mascot,MascotsOrigins)
  1623. entity_set_float(mascot,EV_FL_animtime,2.0)
  1624. entity_set_float(mascot,EV_FL_framerate,1.0)
  1625. entity_set_int(mascot,EV_INT_sequence,0)
  1626.  
  1627. if(team == 2)
  1628. entity_set_byte(mascot, EV_BYTE_controller1, 115)
  1629.  
  1630. entity_set_vector(mascot,EV_VEC_angles,MascotsAngles)
  1631. entity_set_float(mascot,EV_FL_nextthink,halflife_time() + 1.0)
  1632. }
  1633. }
  1634.  
  1635. create_Game_Player_Equip() {
  1636. gamePlayerEquip = create_entity("game_player_equip")
  1637. if(gamePlayerEquip) {
  1638. //DispatchKeyValue(gamePlayerEquip, "weapon_knife", "1")
  1639. //DispatchKeyValue(entity, "weapon_scout", "1")
  1640. DispatchKeyValue(gamePlayerEquip, "targetname", "roundstart")
  1641. DispatchSpawn(gamePlayerEquip)
  1642. }
  1643.  
  1644. }
  1645.  
  1646. public FinalizeGoalNet(team)
  1647. {
  1648. new golnet = GoalEnt[team]
  1649. entity_set_string(golnet,EV_SZ_classname,"soccerjam_goalnet")
  1650. entity_set_int(golnet, EV_INT_team, team)
  1651. set_entity_visibility(golnet, 0)
  1652. }
  1653.  
  1654. public RightDirection(id) {
  1655.  
  1656. if(id == ballholder) {
  1657.  
  1658. direction--
  1659. if(direction < -(ConfigPro[11]))
  1660. direction = -(ConfigPro[11])
  1661. new temp = direction * ConfigPro[9]
  1662. SendCenterText( id, temp );
  1663.  
  1664. }
  1665. else
  1666. ColorChat(id, YELLOW, "Voce deve ^x03TER^x01 a bola para fazer curva.");
  1667. return PLUGIN_HANDLED
  1668. }
  1669.  
  1670. public LeftDirection(id) {
  1671. if(id == ballholder) {
  1672. direction++
  1673. if(direction > ConfigPro[11])
  1674. direction = ConfigPro[11]
  1675. new temp = direction * ConfigPro[9]
  1676. SendCenterText( id, temp );
  1677.  
  1678. }
  1679. else {
  1680. ColorChat(id, YELLOW, "Voce deve ^x03TER^x01 a bola para fazer curva.");
  1681. }
  1682. return PLUGIN_HANDLED
  1683. }
  1684.  
  1685.  
  1686. SendCenterText( id, dir )
  1687. {
  1688. if(dir < 0)
  1689. client_print(id, print_center, "%i graus para direita.", (dir<0?-(dir):dir));
  1690. else if(dir == 0)
  1691. client_print(id, print_center, "0 graus");
  1692. else if(dir > 0)
  1693. client_print(id, print_center, "%i graus para esquerda.", (dir<0?-(dir):dir));
  1694. }
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700. public plugin_cfg()
  1701. {
  1702. if(is_kickball)
  1703. {
  1704. lconfig()
  1705.  
  1706. /*
  1707.  
  1708. //create the main menu
  1709. new size = sizeof(gszMainMenuText);
  1710. add(gszMainMenuText, size, "\yClock Maker Menu^n^n");
  1711. add(gszMainMenuText, size, "\r1. \wCreate server time clock^n");
  1712. add(gszMainMenuText, size, "\r2. \wCreate map timeleft clock^n^n");
  1713. add(gszMainMenuText, size, "\r4. \wDelete clock^n^n");
  1714. add(gszMainMenuText, size, "\r5. \wMake larger^n");
  1715. add(gszMainMenuText, size, "\r6. \wMake smaller^n^n");
  1716. add(gszMainMenuText, size, "\r7. \wSave clocks^n");
  1717. add(gszMainMenuText, size, "\r8. \wLoad clocks^n^n");
  1718. add(gszMainMenuText, size, "\r0. \wClose^n");
  1719.  
  1720.  
  1721. //make save folder in basedir
  1722. new szDir[64];
  1723. new szMap[32];
  1724.  
  1725. get_basedir(szDir, 64);
  1726. add(szDir, 64, "/clockmaker");
  1727.  
  1728. //create the folder is it doesn't exist
  1729. if (!dir_exists(szDir))
  1730. {
  1731. mkdir(szDir);
  1732. }
  1733.  
  1734. get_mapname(szMap, 32);
  1735. formatex(FileCartel, 96, "%s/%s.cm", szDir, szMap);
  1736.  
  1737. //load the clocks
  1738. loadScore(0);
  1739.  
  1740. //set a task to update the clocks (every second is frequent enough)
  1741. //set_task(1.0, "UpdateScore", 0, "", 0, "b");
  1742.  
  1743. */
  1744. }
  1745. else
  1746. {
  1747. new failed[64];
  1748. format(failed,63,"SoccerJam desabilitado.");
  1749. set_fail_state(failed);
  1750. }
  1751. }
  1752.  
  1753.  
  1754. /*====================================================================================================
  1755. [Ball Brain]
  1756.  
  1757. Purpose: These functions help control the ball and its activities.
  1758.  
  1759. Comment: $$
  1760.  
  1761. ====================================================================================================*/
  1762. public ball_think() {
  1763.  
  1764. new maxscore = get_pcvar_num(CVAR_SCORE)
  1765. if(score[1] >= maxscore || score[2] >= maxscore) {
  1766. entity_set_float(aball,EV_FL_nextthink,halflife_time() + 0.05)
  1767. return PLUGIN_HANDLED
  1768. }
  1769.  
  1770. if(is_valid_ent(aball))
  1771. {
  1772. new Float:gametime = get_gametime()
  1773. if(PowerPlay >= MAX_LVL_POWERPLAY && gametime - fire_delay >= 0.3)
  1774. on_fire()
  1775.  
  1776. if(ballholder > 0)
  1777. {
  1778.  
  1779. new team = get_user_team(ballholder)
  1780. entity_get_vector(ballholder, EV_VEC_origin,testorigin)
  1781. if(!is_user_alive(ballholder)) {
  1782.  
  1783. new tname[MAX_PLAYER + 1]
  1784. get_user_name(ballholder,tname, MAX_PLAYER)
  1785.  
  1786. remove_task(55555)
  1787. set_task(get_pcvar_float(CVAR_RESET),"clearBall",55555)
  1788.  
  1789. if(!g_sprint[ballholder])
  1790. set_speedchange(ballholder)
  1791.  
  1792. format(temp1,63,"%s [%s] foi desarmado!", TeamNames[team], tname)
  1793.  
  1794. //remove glow of owner and set ball velocity really really low
  1795. glow(ballholder,0,0,0,0)
  1796.  
  1797. ballowner = ballholder
  1798. ballholder = 0
  1799.  
  1800. testorigin[2] += 5
  1801. entity_set_origin(aball, testorigin)
  1802.  
  1803. new Float:vel[3], x
  1804. for(x=0;x<3;x++)
  1805. vel[x] = 1.0
  1806.  
  1807. entity_set_vector(aball,EV_VEC_velocity,vel)
  1808. entity_set_float(aball,EV_FL_nextthink,halflife_time() + 0.05)
  1809. return PLUGIN_HANDLED
  1810. }
  1811. if(entity_get_int(aball,EV_INT_solid) != SOLID_NOT)
  1812. entity_set_int(aball, EV_INT_solid, SOLID_NOT)
  1813.  
  1814. //Put ball in front of player
  1815. ball_infront(ballholder, 55.0)
  1816. new i
  1817. for(i=0;i<3;i++)
  1818. velocity[i] = 0.0
  1819. //Add lift to z axis
  1820. new flags = entity_get_int(ballholder, EV_INT_flags)
  1821. if(flags & FL_DUCKING)
  1822. testorigin[2] -= 10
  1823. else
  1824. testorigin[2] -= 30
  1825.  
  1826. entity_set_vector(aball,EV_VEC_velocity,velocity)
  1827. entity_set_origin(aball,testorigin)
  1828. }
  1829. else {
  1830. if(entity_get_int(aball,EV_INT_solid) != SOLID_BBOX)
  1831. entity_set_int(aball, EV_INT_solid, SOLID_BBOX)
  1832. }
  1833. }
  1834. entity_set_float(aball,EV_FL_nextthink,halflife_time() + 0.05)
  1835. return PLUGIN_HANDLED
  1836. }
  1837.  
  1838. moveBall(where, team=0) {
  1839.  
  1840. if(is_valid_ent(aball)) {
  1841. if(team) {
  1842. new Float:bv[3]
  1843. bv[2] = 50.0
  1844. entity_set_origin(aball, TeamBallOrigins[team])
  1845. entity_set_vector(aball,EV_VEC_velocity,bv)
  1846. }
  1847. else {
  1848. switch(where) {
  1849. case 0: { //outside map
  1850.  
  1851. new Float:orig[3], x
  1852. for(x=0;x<3;x++)
  1853. orig[x] = -9999.9
  1854. entity_set_origin(aball,orig)
  1855. ballholder = -1
  1856. }
  1857. case 1: { //at middle
  1858.  
  1859. new Float:v[3], rand
  1860. v[2] = 400.0
  1861. if(ballspawncount > 1)
  1862. rand = random_num(0, ballspawncount-1)
  1863. else
  1864. rand = 0
  1865.  
  1866. entity_set_origin(aball, BallSpawnOrigin[rand])
  1867. entity_set_vector(aball, EV_VEC_velocity, v)
  1868.  
  1869. PowerPlay = 0
  1870. ballholder = 0
  1871. ballowner = 0
  1872. }
  1873. }
  1874. }
  1875. }
  1876. }
  1877.  
  1878. public ball_infront(id, Float:dist) {
  1879.  
  1880. new Float:nOrigin[3]
  1881. new Float:vAngles[3] // plug in the view angles of the entity
  1882. new Float:vReturn[3] // to get out an origin fDistance away
  1883.  
  1884. entity_get_vector(aball,EV_VEC_origin,testorigin)
  1885. entity_get_vector(id,EV_VEC_origin,nOrigin)
  1886. entity_get_vector(id,EV_VEC_v_angle,vAngles)
  1887.  
  1888. // set_change_ball(0, 0.0)
  1889.  
  1890. vReturn[0] = floatcos( vAngles[1], degrees ) * dist
  1891. vReturn[1] = floatsin( vAngles[1], degrees ) * dist
  1892.  
  1893. vReturn[0] += nOrigin[0]
  1894. vReturn[1] += nOrigin[1]
  1895.  
  1896. testorigin[0] = vReturn[0]
  1897. testorigin[1] = vReturn[1]
  1898. testorigin[2] = nOrigin[2]
  1899.  
  1900. /*
  1901. //Sets the angle to face the same as the player.
  1902. new Float:ang[3]
  1903. entity_get_vector(id,EV_VEC_angles,ang)
  1904. ang[0] = 0.0
  1905. ang[1] -= 90.0
  1906. ang[2] = 0.0
  1907. entity_set_vector(aball,EV_VEC_angles,ang)
  1908. */
  1909.  
  1910. }
  1911.  
  1912.  
  1913. public CurveBall(id) {
  1914. if(direction && get_speed(aball) > 5 && curvecount > 0) {
  1915.  
  1916. new Float:dAmt = float((direction * ConfigPro[9]) / ConfigPro[12]);
  1917. new Float:v[3], Float:v_forward[3];
  1918.  
  1919. entity_get_vector(aball, EV_VEC_velocity, v);
  1920. vector_to_angle(v, BallSpinDirection);
  1921.  
  1922. BallSpinDirection[1] = normalize( BallSpinDirection[1] + dAmt );
  1923. BallSpinDirection[2] = 0.0;
  1924.  
  1925. angle_vector(BallSpinDirection, 1, v_forward);
  1926.  
  1927. new Float:speed = vector_length(v)// * 0.95;
  1928. v[0] = v_forward[0] * speed
  1929. v[1] = v_forward[1] * speed
  1930.  
  1931. entity_set_vector(aball, EV_VEC_velocity, v);
  1932.  
  1933. curvecount--;
  1934. set_task(0.14, "CurveBall", id);
  1935. }
  1936. }
  1937.  
  1938. public clearBall()
  1939. {
  1940. // play_wav(0, BALL_RESPAWN);
  1941. play_wav(0, SoundDirect[15]);
  1942. format(temp1,63,"A bola foi teleportada para o meio do campo!")
  1943. moveBall(1)
  1944. }
  1945.  
  1946. /*====================================================================================================
  1947. [Mascot Think]
  1948.  
  1949. Purpose: $$
  1950.  
  1951. Comment: $$
  1952.  
  1953. ====================================================================================================*/
  1954. public mascot_think(mascot)
  1955. {
  1956. new team = entity_get_int(mascot, EV_INT_team)
  1957. new indist[MAX_PLAYER + 1], inNum, chosen
  1958.  
  1959. new id, playerteam, dist
  1960. for(id=1 ; id<=maxplayers ; id++)
  1961. {
  1962. if(is_user_alive(id) && !is_user_bot(id))
  1963. {
  1964. playerteam = get_user_team(id)
  1965. if(playerteam != team)
  1966. {
  1967. if(!chosen) {
  1968. dist = get_entity_distance(id, mascot)
  1969. if(dist < get_pcvar_num(CVAR_GOALSAFETY))
  1970. if(id == ballholder) {
  1971. chosen = id
  1972. break
  1973. }
  1974. else
  1975. indist[inNum++] = id
  1976. }
  1977. }
  1978. }
  1979. }
  1980. if(!chosen) {
  1981. new rnd = random_num(0, (inNum-1))
  1982. chosen = indist[rnd]
  1983. }
  1984. if(chosen)
  1985. TerminatePlayer(chosen, mascot, team, ( ballholder == chosen ? 500.0 : random_float(5.0, 15.0) ) )
  1986. entity_set_float(mascot,EV_FL_nextthink,halflife_time() + 1.0)
  1987. }
  1988.  
  1989. goaly_checker(id, Float:gametime, team) {
  1990. if(!is_user_alive(id) || (gametime - GoalyCheckDelay[id] < ConfigPro[8]) )
  1991. return PLUGIN_HANDLED
  1992.  
  1993. new dist, gcheck
  1994. new Float:pOrig[3]
  1995. entity_get_vector(id, EV_VEC_origin, pOrig)
  1996. dist = floatround(get_distance_f(pOrig, TeamBallOrigins[team]))
  1997.  
  1998. //--/* Goaly Exp System */--//
  1999. if(dist < 600 ) {
  2000.  
  2001. gcheck = GoalyCheck[id]
  2002.  
  2003. if(id == ballholder && gcheck >= 2)
  2004. kickBall(id, 1)
  2005.  
  2006. GoalyPoints[id]++
  2007.  
  2008. if(gcheck < 2)
  2009. g_Experience[id] += gcheck * ConfigPro[15]
  2010. else
  2011. g_Experience[id] += gcheck * (ConfigPro[15] / 2)
  2012.  
  2013. if(gcheck < 5)
  2014. GoalyCheck[id]++
  2015.  
  2016. GoalyCheckDelay[id] = gametime
  2017. }
  2018. else
  2019. GoalyCheck[id] = 0
  2020. return PLUGIN_HANDLED
  2021. }
  2022.  
  2023. /*====================================================================================================
  2024. [Status Display]
  2025.  
  2026. Purpose: Displays the Scoreboard information.
  2027.  
  2028. Comment: $$
  2029.  
  2030. ====================================================================================================*/
  2031.  
  2032.  
  2033. public statusDisplay()
  2034. {
  2035. new id, team, bteam = get_user_team(ballholder>0?ballholder:ballowner)
  2036. new score_t = score[T], score_ct = score[CT]
  2037.  
  2038. set_hudmessage(190, 190, 190, 0.95, 0.20, 1, 1.0, 1.5, 0.1, 0.1, HUD_CHANNEL)
  2039. new Float:gametime = get_gametime()
  2040.  
  2041. for(id=1; id<=maxplayers; id++) {
  2042. if(is_user_connected(id) && !is_user_bot(id))
  2043. {
  2044. team = get_user_team(id)
  2045. goaly_checker(id, gametime, team)
  2046. if(!is_user_alive(id) && !is_dead[id] && (team == 1 || team == 2) && GetPlayerModel(id) != 0xFF)
  2047. {
  2048. //new Float:ballorig[3], x
  2049. //entity_get_vector(id,EV_VEC_origin,ballorig)
  2050. //for(x=0;x<3;x++)
  2051. // distorig[0][x] = floatround(ballorig[x])
  2052. remove_task(id+1000)
  2053. has_knife[id] = false;
  2054. is_dead[id] = true
  2055. new Float:respawntime = CVAR_RESPAWN
  2056. set_task(respawntime,"AutoRespawn",id)
  2057. set_task((respawntime+0.2), "AutoRespawn2",id)
  2058. }
  2059. if(!winner)
  2060. {
  2061. if(get_pcvar_num(CVAR_RANK))
  2062. format(scoreboard,1024,"%s- Rank: %s -^n^n%i Gols!^n%s - %i | %s - %i ^nExperiencia: %i ^n^n%s^n^n^n%s",MENSAGE_SERVER, sj_systemrank==0?"Desativado":"Ativado",get_pcvar_num(CVAR_SCORE),TeamNames[1],score_t,TeamNames[2],score_ct,g_Experience[id],temp1,team==bteam?temp2:"")
  2063. else
  2064. format(scoreboard,1024,"%s- %i Gols!^n%s - %i | %s - %i ^nExperiencia: %i ^n^n%s^n^n^n%s",MENSAGE_SERVER,get_pcvar_num(CVAR_SCORE),TeamNames[1],score_t,TeamNames[2],score_ct,g_Experience[id],temp1,team==bteam?temp2:"")
  2065. show_hudmessage(id,"%s",scoreboard)
  2066. }
  2067. }
  2068. }
  2069. }
  2070.  
  2071.  
  2072. /*====================================================================================================
  2073. [Touched]
  2074.  
  2075. Purpose: All touching stuff takes place here.
  2076.  
  2077. Comment: $$
  2078.  
  2079. ====================================================================================================*/
  2080. public touchWorld(ball, world) {
  2081.  
  2082. if(get_speed(ball) > 10)
  2083. {
  2084. new Float:v[3]
  2085.  
  2086. new Float:r
  2087.  
  2088. entity_get_vector(ball, EV_VEC_velocity, v)
  2089. r = entity_get_float(ball, EV_FL_framerate)
  2090.  
  2091. v[0] = (v[0] * 0.85)
  2092. v[1] = (v[1] * 0.85)
  2093. v[2] = (v[2] * 0.85)
  2094.  
  2095. r = (r * 0.50)
  2096.  
  2097. entity_set_float(ball,EV_FL_framerate,r)
  2098. entity_set_int(ball,EV_INT_sequence,2)
  2099.  
  2100. // set_change_ball(2, r)
  2101.  
  2102. entity_set_vector(ball, EV_VEC_velocity, v)
  2103. emit_sound(ball, CHAN_ITEM, SoundDirect[13], 1.0, ATTN_NORM, 0, PITCH_NORM)
  2104. // emit_sound(ball, CHAN_ITEM, BALL_BOUNCE_GROUND, 1.0, ATTN_NORM, 0, PITCH_NORM)
  2105. }
  2106. else
  2107. {
  2108. entity_set_float(ball,EV_FL_framerate,0.0)
  2109. entity_set_int(ball,EV_INT_sequence,0)
  2110. }
  2111.  
  2112. return PLUGIN_HANDLED
  2113. }
  2114.  
  2115. public set_change_ball(secuencia, Float:frame)
  2116. {
  2117. entity_set_float(aball,EV_FL_framerate,frame)
  2118. entity_set_int(aball,EV_INT_sequence,secuencia)
  2119. }
  2120.  
  2121. public touchPlayer(ball, player) {
  2122.  
  2123. if(is_user_bot(player))
  2124. return PLUGIN_HANDLED
  2125.  
  2126. if(is_offside[player] || is_user_foul[player])
  2127. return PLUGIN_HANDLED
  2128.  
  2129. new playerteam = get_user_team(player)
  2130. if((playerteam != 1 && playerteam != 2))
  2131. return PLUGIN_HANDLED
  2132.  
  2133. remove_task(55555)
  2134.  
  2135. new aname[64], stolen, x
  2136. get_user_name(player,aname,63)
  2137. new ballteam = get_user_team(ballowner)
  2138. if(ballowner > 0 && playerteam != ballteam )
  2139. {
  2140. new speed = get_speed(aball)
  2141. if(speed > 500)
  2142. {
  2143. //configure catching algorithm
  2144. new rnd = random_num(0,100)
  2145. new bstr = (PlayerUpgrades[ballowner][STR] * ConfigPro[17]) / 10
  2146. new dex = (PlayerUpgrades[player][DEX] * ConfigPro[19])
  2147. new pct = ( PressedAction[player] ? 40:20 ) + dex
  2148.  
  2149. pct += ( g_sprint[player] ? 5 : 0 ) //player turboing? give 5%
  2150. pct -= ( g_sprint[ballowner] ? 5 : 0 ) //ballowner turboing? lose 5%
  2151. pct -= bstr //ballowner has strength? remove bstr
  2152.  
  2153. //will player avoid damage?
  2154. if( rnd > pct ) {
  2155. new Float:dodmg = (float(speed) / 13.0) + bstr
  2156.  
  2157. ColorChat(0,YELLOW,"^x04%s^x01 levou uma bolada de ^x04%i^x01 de dano.",aname,floatround(dodmg))
  2158.  
  2159. set_msg_block(gmsgDeathMsg,BLOCK_ONCE)
  2160. fakedamage(player,"AssWhoopin",dodmg,1)
  2161. set_msg_block(gmsgDeathMsg,BLOCK_NOT)
  2162.  
  2163. if(!is_user_alive(player))
  2164. {
  2165. message_begin(MSG_ALL, gmsgDeathMsg)
  2166. write_byte(ballowner)
  2167. write_byte(player)
  2168. write_string("AssWhoopin")
  2169. message_end()
  2170.  
  2171. new frags = get_user_frags(ballowner)
  2172. entity_set_float(ballowner, EV_FL_frags, float(frags + 1))
  2173. setScoreInfo(ballowner)
  2174. //set_user_frags(ballowner, get_user_frags(ballowner)+1)
  2175. Event_Record(ballowner, KILL, -1, ConfigPro[2])
  2176.  
  2177. ///////////////////////////////////////////////
  2178.  
  2179. if(sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  2180. {
  2181. if(UserPassword[ballowner])
  2182. Pro_Kill[ballowner] += 1
  2183. if(UserPassword[player])
  2184. Pro_teKill[player] += 1
  2185. if(VerificarPossUP(ballowner))
  2186. log_amx("1 Rank ok")
  2187. if(VerificarPossUP(player))
  2188. log_amx("2 Rank ok")
  2189. }
  2190.  
  2191. ///////////////////////////////////////////////
  2192.  
  2193. // play_wav(0, HEAD_BOCHA)
  2194. play_wav(0, SoundDirect[19])
  2195.  
  2196. ColorChat(player,GREY,"Voce morreu por ter levado uma bolada!")
  2197. ColorChat(ballowner,YELLOW,"Voce ganhou ^x04%i^x01 de EXP por matar com bolada!",100)
  2198. }
  2199. else
  2200. {
  2201. new Float:pushVel[3]
  2202. pushVel[0] = velocity[0]
  2203. pushVel[1] = velocity[1]
  2204. pushVel[2] = velocity[2] + ((velocity[2] < 0)?random_float(-200.0,-50.0):random_float(50.0,200.0))
  2205. entity_set_vector(player,EV_VEC_velocity,pushVel)
  2206. }
  2207. for(x=0;x<3;x++)
  2208. velocity[x] = (velocity[x] * random_float(0.1,0.9))
  2209. entity_set_vector(aball,EV_VEC_velocity,velocity)
  2210. direction = 0
  2211. return PLUGIN_HANDLED
  2212. }
  2213. }
  2214.  
  2215. if(speed > 950)
  2216. // play_wav(0, STOLE_BALL_FAST)
  2217. play_wav(0, SoundDirect[11])
  2218.  
  2219. new Float:pOrig[3]
  2220. entity_get_vector(player, EV_VEC_origin, pOrig)
  2221. new dist = floatround(get_distance_f(pOrig, TeamBallOrigins[playerteam]))
  2222. new gainedxp
  2223.  
  2224. if(dist < 550) {
  2225. gainedxp = ConfigPro[1] + ConfigPro[0] + (speed / 8)
  2226. Event_Record(player, STEAL, -1, ConfigPro[1] + ConfigPro[0] + (speed / 8))
  2227. GoalyPoints[player] += ConfigPro[0]/2
  2228.  
  2229. ///////////////////////////////////////////////
  2230.  
  2231. if(sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  2232. {
  2233. if(UserPassword[player])
  2234. Pro_Steal[player] += 1
  2235. if(UserPassword[ballowner])
  2236. Pro_teSteal[ballowner] += 1
  2237. if(VerificarPossUP(player))
  2238. log_amx("3 Rank ok")
  2239. if(VerificarPossUP(ballowner))
  2240. log_amx("4 Rank ok")
  2241. }
  2242.  
  2243. ///////////////////////////////////////////////
  2244. }
  2245. else {
  2246. gainedxp = ConfigPro[1]
  2247. Event_Record(player, STEAL, -1, ConfigPro[1])
  2248.  
  2249. ///////////////////////////////////////////////
  2250.  
  2251. if(sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  2252. {
  2253. if(UserPassword[player])
  2254. Pro_Steal[player] += 1
  2255. if(UserPassword[ballowner])
  2256. Pro_teSteal[ballowner] += 1
  2257. if(VerificarPossUP(player))
  2258. log_amx("5 Rank ok")
  2259. if(VerificarPossUP(ballowner))
  2260. log_amx("6 Rank ok")
  2261. }
  2262.  
  2263. ///////////////////////////////////////////////
  2264. }
  2265.  
  2266. format(temp1,63,"%s [%s] Roubou a bola!",TeamNames[playerteam],aname)
  2267. //client_print(0,print_console,"%s",temp1)
  2268.  
  2269. stolen = 1
  2270.  
  2271. message_begin(MSG_ONE, gmsgShake, {0,0,0}, player)
  2272. write_short(255 << 12) //ammount
  2273. write_short(1 << 11) //lasts this long
  2274. write_short(255 << 10) //frequency
  2275. message_end()
  2276.  
  2277. ColorChat(player,YELLOW,"Voce ganhou ^x04%i^x01 de EXP por roubar a bola!",gainedxp)
  2278.  
  2279. }
  2280.  
  2281. if(ballholder == 0)
  2282. {
  2283. // emit_sound(aball, CHAN_ITEM, BALL_PICKED_UP, 1.0, ATTN_NORM, 0, PITCH_NORM)
  2284. emit_sound(aball, CHAN_ITEM, SoundDirect[14], 1.0, ATTN_NORM, 0, PITCH_NORM)
  2285. new msg[64], check
  2286.  
  2287. if(get_pcvar_num(CVAR_OFFSIDE))
  2288. niOffSide()
  2289.  
  2290. if(!has_knife[player] && !soy_spec[player])
  2291. give_knife(player)
  2292.  
  2293. if(stolen)
  2294. PowerPlay = 0
  2295. else
  2296. format(temp1,63,"%s [%s] Pegou a bola!",TeamNames[playerteam],aname)
  2297.  
  2298. if(((PowerPlay > 1 && powerplay_list[PowerPlay-2] == player) || (PowerPlay > 0 && powerplay_list[PowerPlay-1] == player)) && PowerPlay != MAX_LVL_POWERPLAY)
  2299. check = true
  2300.  
  2301. if(PowerPlay <= MAX_LVL_POWERPLAY && !check) {
  2302. g_Experience[player] += (PowerPlay==2?10:25)
  2303. powerplay_list[PowerPlay] = player
  2304. PowerPlay++
  2305. }
  2306. curvecount = 0
  2307. direction = 0
  2308. GoalyCheck[player] = 0
  2309.  
  2310. format(temp2, 63, "POWER PLAY! -- Nivel: %d", PowerPlay>0?PowerPlay-1:0)
  2311.  
  2312. ballholder = player
  2313. ballowner = 0
  2314.  
  2315. if(!g_sprint[player])
  2316. set_speedchange(player)
  2317.  
  2318.  
  2319. set_hudmessage(255, 225, 128, POS_X, 0.4, 1, 1.0, 1.5, 0.1, 0.1, 2)
  2320. format(msg,63,"Voce pegou a bola!!!")
  2321. show_hudmessage(player,"%s",msg)
  2322.  
  2323. beam()
  2324. }
  2325.  
  2326. return PLUGIN_HANDLED
  2327. }
  2328.  
  2329. public touchNet(ball, goalpost)
  2330. {
  2331. remove_task(55555)
  2332.  
  2333. new team = get_user_team(ballowner)
  2334. new golent = GoalEnt[team]
  2335. if (goalpost != golent && ballowner > 0)
  2336. {
  2337. new aname[64]
  2338. new Float:netOrig[3]
  2339. new netOrig2[3]
  2340.  
  2341. entity_get_vector(ball, EV_VEC_origin,netOrig)
  2342.  
  2343. new l
  2344. for(l=0;l<3;l++)
  2345. netOrig2[l] = floatround(netOrig[l])
  2346. flameWave(netOrig2)
  2347. get_user_name(ballowner,aname,63)
  2348. new frags = get_user_frags(ballowner)
  2349. entity_set_float(ballowner, EV_FL_frags, float(frags + 10))
  2350.  
  2351. // play_wav(0, SCORED_GOAL)
  2352. play_wav(0, SoundDirect[16])
  2353.  
  2354. /////////////////////ASSIST CODE HERE///////////
  2355.  
  2356. new assisters[4] = { 0, 0, 0, 0 }
  2357. new iassisters = 0
  2358. new ilastplayer = iassist[ team ]
  2359.  
  2360. // We just need the last player to kick the ball
  2361. // 0 means it has passed 15 at least once
  2362. if ( ilastplayer == 0 )
  2363. ilastplayer = 15
  2364. else
  2365. ilastplayer--
  2366.  
  2367. if ( assist[ ilastplayer ] != 0 ) {
  2368. new i, x, bool:canadd, playerid
  2369. for(i=0; i<16; i++) {
  2370. // Stop if we've already found 4 assisters
  2371. if ( iassisters == MAX_ASSISTERS )
  2372. break
  2373. playerid = assist[ i ]
  2374. // Skip if player is invalid
  2375. if ( playerid == 0 )
  2376. continue
  2377. // Skip if kicker is counted as an assister
  2378. if ( playerid == assist[ ilastplayer ] )
  2379. continue
  2380.  
  2381. canadd = true
  2382. // Loop through each assister value
  2383. for(x=0; x<3; x++)
  2384. // make sure we can add them
  2385. if ( playerid == assisters[ x ] ) {
  2386. canadd = false
  2387. break
  2388. }
  2389.  
  2390. // Skip if they've already been added
  2391. if ( canadd == false )
  2392. continue
  2393. // They didn't kick the ball last, and they haven't been added, add them
  2394. assisters[ iassisters++ ] = playerid
  2395. }
  2396. // This gives each person an assist, xp, and prints that out to them
  2397. new c, pass
  2398. for(c=0; c<iassisters; c++) {
  2399. pass = assisters[ c ]
  2400. Event_Record(pass, ASSIST, -1, ConfigPro[3])
  2401. ColorChat( pass, YELLOW, "Voce ganhou ^x04%i^x01 de EXP por dar assistencia!",ConfigPro[3])
  2402.  
  2403. ///////////////////////////////////////////////
  2404.  
  2405. if(sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  2406. {
  2407. if(UserPassword[pass])
  2408. Pro_Asis[pass] += 1
  2409. if(VerificarPossUP(pass))
  2410. log_amx("7 Rank ok")
  2411. }
  2412.  
  2413. ///////////////////////////////////////////////
  2414.  
  2415. }
  2416. }
  2417. iassist[ 0 ] = 0
  2418. /////////////////////ASSIST CODE HERE///////////
  2419.  
  2420. for(l=0; l<3; l++)
  2421. distorig[1][l] = floatround(netOrig[l])
  2422. new distshot = (get_distance(distorig[0],distorig[1])/12)
  2423. new gainedxp = distshot + ConfigPro[4]
  2424.  
  2425. format(temp1,63,"%s [%s] Fez gol de %i metros!",TeamNames[team],aname,distshot)
  2426. //client_print(0,print_console,"%s",temp1)
  2427.  
  2428. if(distshot > MadeRecord[ballowner][DISTANCE])
  2429. Event_Record(ballowner, DISTANCE, distshot, 0)// record distance, and make that distance exp
  2430.  
  2431. Event_Record(ballowner, GOAL, -1, gainedxp) //zero xp for goal cause distance is what gives it.
  2432.  
  2433. ///////////////////////////////////////////////
  2434. if(sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  2435. {
  2436. if(UserPassword[ballowner])
  2437. Pro_Goal[ballowner] += 1
  2438. if(VerificarPossUP(ballowner))
  2439. log_amx("8 Rank ok")
  2440. }
  2441. ///////////////////////////////////////////////
  2442.  
  2443. //Increase Score, and update cvar score
  2444. score[team]++
  2445. switch(team) {
  2446. case 1: set_cvar_num("score_ct",score[team])
  2447. case 2: set_cvar_num("score_t",score[team])
  2448. }
  2449.  
  2450. // PONER
  2451.  
  2452. server_cmd("setear_score %d %d", score[1], score[2])
  2453.  
  2454. ColorChat(ballowner,YELLOW,"Voce ganhou ^x04%i^x01 de EXP por fazer um gol de ^x04%i^x01 metros!",gainedxp,distshot)
  2455. if(get_user_team(ballowner) == 1){
  2456. Gol_Sprite_Barca(ballowner)
  2457. }
  2458. else if(get_user_team(ballowner) == 2){
  2459. Gol_Sprite_Real(ballowner)
  2460. }
  2461.  
  2462. new oteam = (team == 1 ? 2 : 1)
  2463. increaseTeamXP(team, 75)
  2464. increaseTeamXP(oteam, 50)
  2465. moveBall(0)
  2466.  
  2467. new x
  2468. for(x=1; x<=maxplayers; x++) {
  2469. if(is_user_connected(x))
  2470. {
  2471. Event_Record(x, GOALY, GoalyPoints[x], 0)
  2472. new kills = get_user_frags(x)
  2473. new deaths = cs_get_user_deaths(x)
  2474. setScoreInfo(x)
  2475. if( deaths > 0)
  2476. PlayerDeaths[x] = deaths
  2477. if( kills > 0)
  2478. PlayerKills[x] = kills
  2479. }
  2480. }
  2481.  
  2482.  
  2483. if(score[team] < get_pcvar_num(CVAR_SCORE)) {
  2484. new r = random_num(0,5)
  2485. play_wav(0, SoundDirect[r]);
  2486.  
  2487. /*
  2488. new r = random_num(0,MAX_SOUNDS-1)
  2489. play_wav(0, SCORED_SOUNDS[r]);
  2490. */
  2491. }
  2492. else
  2493. {
  2494. winner = team
  2495. format(scoreboard,1024,"-+- EQUIPE %s -+-^nVENCEU!!!",TeamNames[team])
  2496. set_task(1.0,"showhud_winner",0,"",0,"a",3)
  2497. // play_wav(0, VICTORY)
  2498. play_wav(0, SoundDirect[20])
  2499.  
  2500. ActiveJoinTeam = 0
  2501.  
  2502. // set_cvar_num("sj_systemexp", 0)
  2503. sj_systemrank = 0
  2504. BorrarSistemExp()
  2505. /* set_task(2.0,"gungame")
  2506. set_task(7.0,"RefreshRank")
  2507. set_task(10.0,"LoadAllPlayerRank") */ //version 5.06
  2508.  
  2509. }
  2510. /*
  2511. if(get_cvar_num("sj_systemexp")==1)
  2512. set_task(2.0,"GuardarExp")
  2513. */
  2514. server_cmd("sv_restart 4")
  2515.  
  2516.  
  2517. }
  2518.  
  2519. /********************************************************************** GOLES EN CONTRA ***************************************************************/
  2520.  
  2521. else if(goalpost == golent && get_pcvar_num(CVAR_ENCONTRA))
  2522. {
  2523. new aname[64]
  2524. new Float:netOrig[3]
  2525. new netOrig2[3]
  2526.  
  2527. entity_get_vector(ball, EV_VEC_origin,netOrig)
  2528. new l
  2529. for(l=0;l<3;l++)
  2530. netOrig2[l] = floatround(netOrig[l])
  2531. flameWave(netOrig2)
  2532. get_user_name(ballowner,aname,63)
  2533. new frags = get_user_frags(ballowner)
  2534. entity_set_float(ballowner, EV_FL_frags, float(frags - 10))
  2535.  
  2536. for(l=0; l<3; l++)
  2537. distorig[1][l] = floatround(netOrig[l])
  2538. new distshot = (get_distance(distorig[0],distorig[1])/12)
  2539.  
  2540. format(temp1,63,"%s [%s] Fez um gol de %i mestros!",TeamNames[team],aname,distshot)
  2541. //client_print(0,print_console,"%s",temp1)
  2542.  
  2543. Event_Record(ballowner, ENCONTRA, -1, 0)
  2544.  
  2545. ///////////////////////////////////////////////
  2546.  
  2547. if(sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  2548. {
  2549. if(UserPassword[ballowner])
  2550. Pro_Contra[ballowner] += 1
  2551. if(VerificarPossUP(ballowner))
  2552. log_amx("9 Rank ok")
  2553. }
  2554.  
  2555. ///////////////////////////////////////////////
  2556.  
  2557. //Increase Score, and update cvar score
  2558.  
  2559. if(team == 1)
  2560. {
  2561. set_cvar_num("score_t",score[2]++)
  2562. }
  2563.  
  2564. else if(team == 2)
  2565. {
  2566. set_cvar_num("score_ct",score[1]++)
  2567. }
  2568.  
  2569. // PONER
  2570.  
  2571. server_cmd("setear_score %d %d", score[1], score[2])
  2572.  
  2573. ColorChat(ballowner,YELLOW,"Voce perdeu ^x04%i^x01 de EXP por fazer um gol contra de ^x04%i^x01 metros!",200,distshot)
  2574. Encontra_Sprite(ballowner)
  2575.  
  2576. new oteam = (team == 1 ? 2 : 1)
  2577. increaseTeamXP(team, -200)
  2578. increaseTeamXP(oteam, 200)
  2579. moveBall(0)
  2580.  
  2581. new x
  2582. for(x=1; x<=maxplayers; x++) {
  2583. if(is_user_connected(x))
  2584. {
  2585. new kills = get_user_frags(x)
  2586. new deaths = cs_get_user_deaths(x)
  2587. setScoreInfo(x)
  2588. if( deaths > 0)
  2589. PlayerDeaths[x] = deaths
  2590. if( kills > 0)
  2591. PlayerKills[x] = kills
  2592. }
  2593. }
  2594.  
  2595. if(score[oteam] < get_pcvar_num(CVAR_SCORE)) {
  2596.  
  2597. new p = random_num(6,10)
  2598. play_wav(0, SoundDirect[p]);
  2599.  
  2600. /*
  2601. new p = random_num(0,SOUNDS_CONTRA-1)
  2602. play_wav(0, SCORED_CONTRA[p]);
  2603.  
  2604. */
  2605.  
  2606. }
  2607. else
  2608. {
  2609. winner = oteam
  2610. format(scoreboard,1024,"-+- EQUIPE %s -+-^nVENCEU!",TeamNames[oteam])
  2611. set_task(1.0,"showhud_winner",0,"",0,"a",3)
  2612. play_wav(0, SoundDirect[20])
  2613.  
  2614. ActiveJoinTeam = 0
  2615. // set_cvar_num("sj_systemexp", 0)
  2616. sj_systemrank = 0
  2617. BorrarSistemExp()
  2618. /* set_task(2.0,"gungame")
  2619. set_task(7.0,"RefreshRank")
  2620. set_task(10.0,"LoadAllPlayerRank") */ //version 5.06
  2621.  
  2622. }
  2623. /*
  2624. if(get_cvar_num("sj_systemexp")==1)
  2625. set_task(2.0,"GuardarExp")
  2626. */
  2627.  
  2628. server_cmd("sv_restart 4")
  2629. }
  2630.  
  2631. else if(goalpost == golent && !get_pcvar_num(CVAR_ENCONTRA))
  2632. {
  2633. moveBall(0, team)
  2634. ColorChat(ballowner,GREY,"Voce nao pode fazer gol contra!")
  2635. }
  2636.  
  2637. return PLUGIN_HANDLED
  2638. }
  2639.  
  2640. //This is for soccerjam.bsp to fix locker room.
  2641. public touchBlocker(pwnball, blocker) {
  2642. new Float:orig[3] = { 2234.0, 1614.0, 1604.0 }
  2643. entity_set_origin(pwnball, orig)
  2644. }
  2645.  
  2646. /*====================================================================================================
  2647. [Events]
  2648.  
  2649. Purpose: $$
  2650.  
  2651. Comment: $$
  2652.  
  2653. ====================================================================================================*/
  2654. //public Event_DeathMsg() {
  2655. // new id = read_data(2)
  2656. // strip_user_weapons(id);
  2657. //}
  2658.  
  2659. public Event_Damage()
  2660. {
  2661. new victim = read_data(0)
  2662. new attacker = get_user_attacker(victim)
  2663. if(is_user_alive(attacker))
  2664. {
  2665. if(get_pcvar_num(CVAR_FOUL))
  2666. IsFoul(attacker)
  2667.  
  2668. if(is_user_alive(victim))
  2669. {
  2670. if(victim == ballholder)
  2671. {
  2672. new upgrade = PlayerUpgrades[attacker][DISARM]
  2673. if(upgrade) {
  2674. new disarm = upgrade * ConfigPro[20]
  2675. new disarmpct = ConfigPro[6] + (victim==ballholder?(disarm*2):0)
  2676. new rand = random_num(1,100)
  2677.  
  2678. if(disarmpct >= rand)
  2679. {
  2680. new vname[MAX_PLAYER + 1], aname[MAX_PLAYER + 1]
  2681. get_user_name(victim,vname, MAX_PLAYER)
  2682. get_user_name(attacker,aname, MAX_PLAYER)
  2683.  
  2684. if(victim == ballholder)
  2685. {
  2686. kickBall(victim, 1)
  2687. Event_Record(attacker, DISARMS, -1, 0)
  2688.  
  2689. ////////////////////////////////////////////
  2690.  
  2691. if(sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  2692. {
  2693. if(UserPassword[victim])
  2694. Pro_teDisarm[victim] += 1
  2695. if(UserPassword[attacker])
  2696. Pro_Disarm[attacker] += 1
  2697. if(VerificarPossUP(victim))
  2698. log_amx("10 Rank ok")
  2699. if(VerificarPossUP(attacker))
  2700. log_amx("11 Rank ok")
  2701. }
  2702.  
  2703. ////////////////////////////////////////////
  2704.  
  2705. ColorChat(attacker,YELLOW,"Voce desarmou ^x04%s^x01 !",vname)
  2706. ColorChat(victim,YELLOW,"Foi desarmado por ^x04%s^x01 !!",aname)
  2707. // play_wav(victim, DISARMSOUND);
  2708. play_wav(victim, SoundDirect[23]);
  2709. play_wav(attacker, SoundDirect[22]);
  2710. }
  2711. }
  2712. }
  2713. }
  2714. }
  2715. else
  2716. g_Experience[attacker] += (ConfigPro[2]/2)
  2717. }
  2718. }
  2719.  
  2720. public AvisoFoul(id)
  2721. {
  2722. new msg[64]
  2723. set_hudmessage(255, 225, 128, POS_X, 0.4, 1, 1.0, 1.5, 0.1, 0.1, 2)
  2724.  
  2725. if((user_foul_count[id] > 0) && is_user_foul[id])
  2726. user_foul_count[id]--
  2727. else
  2728. {
  2729. format(msg,63," ")
  2730. show_hudmessage(id,"%s",msg)
  2731. is_user_foul[id] = false;
  2732. remove_foul(id)
  2733. return PLUGIN_HANDLED;
  2734. }
  2735.  
  2736. format(msg,63,"Voce fez falta e nao podera se mover por %d", user_foul_count[id])
  2737. show_hudmessage(id,"%s",msg)
  2738.  
  2739. set_task(1.0,"AvisoFoul",id)
  2740.  
  2741. return PLUGIN_HANDLED;
  2742. }
  2743.  
  2744. public AvisoOffside(id)
  2745. {
  2746. new msg[64]
  2747. set_hudmessage(255, 225, 128, POS_X, 0.4, 1, 1.0, 1.5, 0.1, 0.1, 2)
  2748.  
  2749. if(!is_offside[id])
  2750. {
  2751. new msg[64]
  2752. set_hudmessage(255, 225, 128, POS_X, 0.4, 1, 1.0, 1.5, 0.1, 0.1, 2)
  2753. format(msg,63," ")
  2754. show_hudmessage(id,"%s",msg)
  2755. return PLUGIN_CONTINUE;
  2756. }
  2757.  
  2758. format(msg,63,"Impedimento!.^n Quando alguem pegar a bola voce podera se mover")
  2759. show_hudmessage(id,"%s",msg)
  2760. set_task(1.0,"AvisoOffside", id)
  2761.  
  2762. return PLUGIN_CONTINUE
  2763. }
  2764.  
  2765.  
  2766. Paralize(id)
  2767. {
  2768. if(is_user_foul[id])
  2769. {
  2770. set_user_godmode(id, 1)
  2771. // set_pev(id, pev_solid, SOLID_NOT);
  2772. set_user_rendering(id,kRenderFxGlowShell,PlayerColors[18],PlayerColors[19],PlayerColors[20],kRenderNormal, PlayerColors[21])
  2773.  
  2774. // play_wav(id, FOULOFFSIDE);
  2775. play_wav(id, SoundDirect[26]);
  2776.  
  2777. // add a blue tint to their screen
  2778. message_begin(MSG_ONE, g_msgScreenFade, _, id);
  2779. write_short(~0); // duration
  2780. write_short(~0); // hold time
  2781. write_short(0x0004); // flags: FFADE_STAYOUT
  2782. write_byte(0); // red
  2783. write_byte(200); // green
  2784. write_byte(50); // blue
  2785. write_byte(100); // alpha
  2786. message_end();
  2787.  
  2788. // prevent from jumping
  2789. if (pev(id, pev_flags) & FL_ONGROUND)
  2790. set_pev(id, pev_gravity, 999999.9) // set really high
  2791. else
  2792. set_pev(id, pev_gravity, 0.000001) // no gravity
  2793. }
  2794. else if(is_offside[id])
  2795. {
  2796. set_user_godmode(id, 1)
  2797. // set_pev(id, pev_solid, SOLID_NOT);
  2798. set_user_rendering(id,kRenderFxGlowShell,PlayerColors[14],PlayerColors[15],PlayerColors[16], kRenderNormal, PlayerColors[17])
  2799.  
  2800. play_wav(id, SoundDirect[26]);
  2801.  
  2802. // add a blue tint to their screen
  2803. message_begin(MSG_ONE, g_msgScreenFade, _, id);
  2804. write_short(~0); // duration
  2805. write_short(~0); // hold time
  2806. write_short(0x0004); // flags: FFADE_STAYOUT
  2807. write_byte(0); // red
  2808. write_byte(200); // green
  2809. write_byte(50); // blue
  2810. write_byte(100); // alpha
  2811. message_end();
  2812.  
  2813. // prevent from jumping
  2814. if (pev(id, pev_flags) & FL_ONGROUND)
  2815. set_pev(id, pev_gravity, 999999.9) // set really high
  2816. else
  2817. set_pev(id, pev_gravity, 0.000001) // no gravity
  2818. }
  2819. }
  2820.  
  2821.  
  2822.  
  2823. public Event_StartRound()
  2824. {
  2825.  
  2826. if(!winner)
  2827. {
  2828. iassist[ 0 ] = 0
  2829.  
  2830. if(!is_valid_ent(aball))
  2831. createball()
  2832.  
  2833. moveBall(1)
  2834.  
  2835.  
  2836. new id
  2837. for(id=1; id<=maxplayers; id++)
  2838. {
  2839. if(is_user_connected(id) && !is_user_bot(id))
  2840. {
  2841. is_dead[id] = false
  2842. seconds[id] = 0
  2843. g_sprint[id] = 0
  2844. PressedAction[id] = 0
  2845. glow(id,0,0,0,0)
  2846. }
  2847. }
  2848.  
  2849.  
  2850. play_wav(0, SoundDirect[12])
  2851. // play_wav(0, ROUND_START)
  2852.  
  2853. set_task(1.0, "PostSetupRound", 0)
  2854. set_task(2.0, "PostPostSetupRound", 0)
  2855. }
  2856. else
  2857. {
  2858. set_task(2.0,"displayWinnerAwards",0)
  2859. set_task(20.0,"PostGame",0)
  2860. }
  2861. }
  2862.  
  2863. public PostSetupRound() {
  2864. new id
  2865. for(id=1; id<=maxplayers; id++)
  2866. {
  2867. if(is_user_alive(id) && !is_user_bot(id) && !soy_spec[id]){
  2868. give_knife(id)
  2869. mudarskin(id)
  2870. }
  2871. }
  2872. }
  2873. public Fwd_PlayerSpawn_Post(id) mudarskin(id)
  2874. public PostPostSetupRound() {
  2875. new id, kills, deaths
  2876. for(id=1; id<=maxplayers; id++) {
  2877. if(is_user_connected(id) && !is_user_bot(id)) {
  2878. kills = PlayerKills[id]
  2879. deaths = PlayerDeaths[id]
  2880. if(kills)
  2881. entity_set_float(id, EV_FL_frags, float(kills))
  2882. if(deaths)
  2883. cs_set_user_deaths(id,deaths)
  2884.  
  2885. setScoreInfo(id)
  2886. }
  2887. }
  2888. }
  2889.  
  2890. public Event_ResetHud(id)
  2891. {
  2892. if(ConfigPro[30])
  2893. {
  2894. if (is_user_alive(id) || !is_user_bot(id) )
  2895. {
  2896. UserHealth[id] = get_user_health(id)
  2897. // Remove HP and AP from screen, however radar is removed aswell
  2898. message_begin(MSG_ONE_UNRELIABLE, MsgHideWeapon, _, id)
  2899. write_byte(HIDE_HUD_HEALTH)
  2900. message_end()
  2901.  
  2902.  
  2903.  
  2904. }
  2905. }
  2906.  
  2907. goaldied[id] = 0;
  2908. is_user_foul[id] = false;
  2909. is_offside[id] = false;
  2910. user_foul_count[id] = 0;
  2911. set_task(1.0,"PostResetHud",id);
  2912. }
  2913.  
  2914. public PostResetHud(id) {
  2915. if(is_user_alive(id) && !is_user_bot(id))
  2916. {
  2917. new stam = PlayerUpgrades[id][STA]
  2918.  
  2919. if(!has_knife[id] && !soy_spec[id]) {
  2920. give_knife(id)
  2921. }
  2922.  
  2923. //compensate for our turbo
  2924. if(!g_sprint[id])
  2925. set_speedchange(id)
  2926.  
  2927. if(stam > 0)
  2928. entity_set_float(id, EV_FL_health, float(ConfigPro[5] + (stam * ConfigPro[16])))
  2929.  
  2930. ProcesTeam()
  2931. }
  2932. }
  2933.  
  2934. /*====================================================================================================
  2935. [Client Commands]
  2936.  
  2937. Purpose: $$
  2938.  
  2939. Comment: $$
  2940.  
  2941. ====================================================================================================*/
  2942. public Turbo(id)
  2943. {
  2944. if(is_user_alive(id))
  2945. g_sprint[id] = 1
  2946. return PLUGIN_HANDLED
  2947. }
  2948.  
  2949. public Adelantado(id)
  2950. {
  2951. if(ballowner > 0)
  2952. {
  2953. new Float:angles[3]
  2954. new pateoteam = get_user_team(ballowner)
  2955. entity_get_vector(ballowner, EV_VEC_angles, angles)
  2956. if(angles[0] > float(-25) && angles[0] < float(25))
  2957. {
  2958. if(pateoteam == 1)
  2959. {
  2960. if(angles[1] > float(0))
  2961. {
  2962. if(angles[1] > float(130))
  2963. {
  2964. if(Offside(id))
  2965. log_amx("Offside!")
  2966. }
  2967. }
  2968. else
  2969. {
  2970. if(angles[1] < float(-130))
  2971. {
  2972. if(Offside(id))
  2973. log_amx("Offside!")
  2974. }
  2975. }
  2976. }
  2977. else if(pateoteam == 2)
  2978. {
  2979. if(angles[1] > float(0))
  2980. {
  2981. if(angles[1] < float(50))
  2982. {
  2983. if(Offside(id))
  2984. log_amx("Offside!")
  2985. }
  2986. }
  2987. else
  2988. {
  2989. if(angles[1] > float(-50))
  2990. {
  2991. if(Offside(id))
  2992. log_amx("Offside!")
  2993. }
  2994. }
  2995. }
  2996. }
  2997. }
  2998. return true
  2999. }
  3000.  
  3001. public client_PreThink(id)
  3002. {
  3003. if( is_kickball && is_valid_ent(aball) && is_user_connected(id))
  3004. {
  3005. new button = entity_get_int(id, EV_INT_button)
  3006. new relode = (button & IN_RELOAD)
  3007. new usekey = (button & IN_USE)
  3008. new up = (button & IN_FORWARD)
  3009. new down = (button & IN_BACK)
  3010. new moveright = (button & IN_MOVERIGHT)
  3011. new moveleft = (button & IN_MOVELEFT)
  3012. new jump = (button & IN_JUMP)
  3013. new flags = entity_get_int(id, EV_INT_flags)
  3014. new onground = flags & FL_ONGROUND
  3015. if( (moveright || moveleft) && !up && !down && jump && onground && !g_sprint[id] && id != ballholder)
  3016. SideJump[id] = 1
  3017.  
  3018. if(!Coord_Off_Z_active)
  3019. {
  3020. if(onground)
  3021. {
  3022. new User_Origin[3]
  3023. get_user_origin(id, User_Origin)
  3024. Coord_Off_Z_active = 1
  3025. Coord_Off_Z = User_Origin[2] - 35
  3026. Coord_Off_Y = User_Origin[1]
  3027. }
  3028. }
  3029.  
  3030. if(ballholder > 0)
  3031. {
  3032. no_ball = 1
  3033. entity_set_float(aball,EV_FL_framerate,0.0)
  3034. entity_set_int(aball,EV_INT_sequence,0)
  3035. }
  3036. else
  3037. {
  3038. if(no_ball)
  3039. {
  3040. no_ball = 0
  3041. entity_set_int(aball, EV_INT_sequence, 2);
  3042. entity_set_float(aball, EV_FL_framerate, 22.0);
  3043. }
  3044. }
  3045.  
  3046.  
  3047.  
  3048. if(relode)
  3049. {
  3050.  
  3051. entity_set_float(id, EV_FL_framerate, 0.0); //FLY CHARGE
  3052. entity_set_int(id, EV_INT_sequence, 54);
  3053. entity_set_float(id, EV_FL_animtime, 1.0)
  3054. }
  3055.  
  3056.  
  3057.  
  3058. if(g_sprint[id])
  3059. entity_set_float(id, EV_FL_fuser2, 0.0)
  3060.  
  3061. if( id != ballholder )
  3062. PressedAction[id] = usekey
  3063. else
  3064. {
  3065. if( usekey && !PressedAction[id])
  3066. {
  3067. kickBall(ballholder, 0)
  3068.  
  3069. if(get_pcvar_num(CVAR_OFFSIDE))
  3070. Adelantado(id)
  3071. }
  3072. else if( !usekey && PressedAction[id])
  3073. PressedAction[id] = 0
  3074. }
  3075.  
  3076. if(soy_spec[id] || is_user_foul[id] || is_offside[id])
  3077. {
  3078. if((button & IN_ATTACK || button & IN_ATTACK2))
  3079. entity_set_int(id, EV_INT_button, (button & ~IN_ATTACK) & ~IN_ATTACK2)
  3080. }
  3081.  
  3082. /****************************************************************** FRAG O NO FRAG ************************************************************************/
  3083. new auxiliar = get_pcvar_num(CVAR_FRAG)
  3084. if(!auxiliar)
  3085. {
  3086. if( id != ballholder && (button & IN_ATTACK || button & IN_ATTACK2) )
  3087. {
  3088.  
  3089. /****************************************************************** FRAG EN AREA ************************************************************************/
  3090.  
  3091. static Float:maxdistance
  3092. static Float:maxdistancem
  3093. static ferencere
  3094. static distancemax
  3095.  
  3096. new fteam = get_user_team(id)
  3097.  
  3098. distancemax = Mascots[fteam]
  3099. maxdistancem = get_pcvar_float(CVAR_KILLNEARAREA)
  3100.  
  3101. if(!is_user_connected(id)) return;
  3102.  
  3103. if(ballholder > 0)
  3104. {
  3105. ferencere = ballholder
  3106. maxdistance = get_pcvar_float(CVAR_KILLNEARHOLDER)
  3107. }
  3108. else {
  3109. ferencere = aball
  3110. maxdistance = get_pcvar_float(CVAR_KILLNEARBALL)
  3111. }
  3112.  
  3113. if(!maxdistance)
  3114. return
  3115.  
  3116. if(entity_range(id, ferencere) > maxdistance && entity_range(id, distancemax) > maxdistancem)
  3117. entity_set_int(id, EV_INT_button, (button & ~IN_ATTACK) & ~IN_ATTACK2)
  3118. }
  3119. }
  3120. }
  3121. }
  3122.  
  3123. public client_PostThink(id)
  3124. {
  3125. if(is_kickball && is_user_connected(id)) {
  3126. new Float:gametime = get_gametime()
  3127. new button = entity_get_int(id, EV_INT_button)
  3128.  
  3129. new up = (button & IN_FORWARD)
  3130. new down = (button & IN_BACK)
  3131. new moveright = (button & IN_MOVERIGHT)
  3132. new moveleft = (button & IN_MOVELEFT)
  3133. new jump = (button & IN_JUMP)
  3134. new Float:vel[3]
  3135.  
  3136. entity_get_vector(id,EV_VEC_velocity,vel)
  3137.  
  3138. if( (gametime - SideJumpDelay[id] > 5.0) && SideJump[id] && jump && (moveright || moveleft) && !up && !down) {
  3139.  
  3140. vel[0] *= 2.0
  3141. vel[1] *= 2.0
  3142. vel[2] = 300.0
  3143.  
  3144. entity_set_vector(id,EV_VEC_velocity,vel)
  3145. SideJump[id] = 0
  3146. SideJumpDelay[id] = gametime
  3147. }
  3148. else
  3149. SideJump[id] = 0
  3150. }
  3151. }
  3152.  
  3153. public kickBall(id, velType)
  3154. {
  3155. remove_task(55555)
  3156. set_task(get_pcvar_float(CVAR_RESET),"clearBall",55555)
  3157.  
  3158. new team = get_user_team(id)
  3159. new a,x
  3160.  
  3161. //Give it some lift
  3162. ball_infront(id, 55.0)
  3163.  
  3164. testorigin[2] += 10
  3165.  
  3166. new Float:tempO[3], Float:returned[3]
  3167. new Float:dist2
  3168.  
  3169. entity_get_vector(id, EV_VEC_origin, tempO)
  3170. new tempEnt = trace_line( id, tempO, testorigin, returned )
  3171.  
  3172. dist2 = get_distance_f(testorigin, returned)
  3173.  
  3174. //ball_infront(id, 55.0)
  3175.  
  3176. if( point_contents(testorigin) != CONTENTS_EMPTY || (!is_user_connected(tempEnt) && dist2 ) )//|| tempDist < 65)
  3177. return PLUGIN_HANDLED
  3178. else
  3179. {
  3180. //Check Make sure our ball isnt inside a wall before kicking
  3181. new Float:ballF[3], Float:ballR[3], Float:ballL[3]
  3182. new Float:ballB[3], Float:ballTR[3], Float:ballTL[3]
  3183. new Float:ballBL[3], Float:ballBR[3]
  3184.  
  3185. for(x=0; x<3; x++) {
  3186. ballF[x] = testorigin[x]; ballR[x] = testorigin[x];
  3187. ballL[x] = testorigin[x]; ballB[x] = testorigin[x];
  3188. ballTR[x] = testorigin[x]; ballTL[x] = testorigin[x];
  3189. ballBL[x] = testorigin[x]; ballBR[x] = testorigin[x];
  3190. }
  3191.  
  3192. for(a=1; a<=6; a++) {
  3193.  
  3194. ballF[1] += 3.0; ballB[1] -= 3.0;
  3195. ballR[0] += 3.0; ballL[0] -= 3.0;
  3196.  
  3197. ballTL[0] -= 3.0; ballTL[1] += 3.0;
  3198. ballTR[0] += 3.0; ballTR[1] += 3.0;
  3199. ballBL[0] -= 3.0; ballBL[1] -= 3.0;
  3200. ballBR[0] += 3.0; ballBR[1] -= 3.0;
  3201.  
  3202. if(point_contents(ballF) != CONTENTS_EMPTY || point_contents(ballR) != CONTENTS_EMPTY ||
  3203. point_contents(ballL) != CONTENTS_EMPTY || point_contents(ballB) != CONTENTS_EMPTY ||
  3204. point_contents(ballTR) != CONTENTS_EMPTY || point_contents(ballTL) != CONTENTS_EMPTY ||
  3205. point_contents(ballBL) != CONTENTS_EMPTY || point_contents(ballBR) != CONTENTS_EMPTY)
  3206. return PLUGIN_HANDLED
  3207. }
  3208.  
  3209. new ent = -1
  3210. testorigin[2] += 35.0
  3211.  
  3212. while((ent = find_ent_in_sphere(ent, testorigin, 35.0)) != 0) {
  3213. if(ent > maxplayers)
  3214. {
  3215. new classname[MAX_PLAYER + 1]
  3216. entity_get_string(ent, EV_SZ_classname, classname, MAX_PLAYER)
  3217.  
  3218. if((contain(classname, "goalnet") != -1 || contain(classname, "func_") != -1) &&
  3219. !equal(classname, "func_water") && !equal(classname, "func_illusionary"))
  3220. return PLUGIN_HANDLED
  3221. }
  3222. }
  3223. testorigin[2] -= 35.0
  3224.  
  3225. }
  3226.  
  3227. new kickVel
  3228. if(!velType)
  3229. {
  3230. new str = (PlayerUpgrades[id][STR] * ConfigPro[17]) + (ConfigPro[14]*(PowerPlay*5))
  3231. kickVel = get_pcvar_num(CVAR_KICK) + str
  3232. kickVel += g_sprint[id] * 100
  3233.  
  3234. if(direction) {
  3235. entity_get_vector(id, EV_VEC_angles, BallSpinDirection)
  3236. curvecount = ConfigPro[10]
  3237. }
  3238. }
  3239. else {
  3240. curvecount = 0
  3241. direction = 0
  3242. kickVel = random_num(100, 600)
  3243. }
  3244.  
  3245. new Float:ballorig[3]
  3246. entity_get_vector(id,EV_VEC_origin,ballorig)
  3247. for(x=0; x<3; x++)
  3248. distorig[0][x] = floatround(ballorig[x])
  3249.  
  3250. velocity_by_aim(id, kickVel, velocity)
  3251.  
  3252. for(x=0; x<3; x++)
  3253. distorig[0][x] = floatround(ballorig[x])
  3254.  
  3255. /////////////////////WRITE ASSIST CODE HERE IF NEEDED///////////
  3256. if ( iassist[ 0 ] == team ) {
  3257. if ( iassist[ team ] == 15 )
  3258. iassist[ team ] = 0
  3259. }
  3260. else {
  3261. // clear the assist list
  3262. new ind
  3263. for(ind = 0; ind < 16; ind++ )
  3264. assist[ ind ] = 0
  3265. // clear the assist index
  3266. iassist[ team ] = 0
  3267. // set which team to track
  3268. iassist[ 0 ] = team
  3269. }
  3270. assist[ iassist[ team ]++ ] = id
  3271. /////////////////////WRITE ASSIST CODE HERE IF NEEDED///////////
  3272.  
  3273. ballowner = id
  3274. ballholder = 0
  3275. entity_set_origin(aball,testorigin)
  3276. entity_set_vector(aball,EV_VEC_velocity,velocity)
  3277.  
  3278. set_task(0.14 *2, "CurveBall", id)
  3279.  
  3280. emit_sound(aball, CHAN_ITEM, SoundDirect[17], 1.0, ATTN_NORM, 0, PITCH_NORM)
  3281. // emit_sound(aball, CHAN_ITEM, BALL_KICKED, 1.0, ATTN_NORM, 0, PITCH_NORM)
  3282.  
  3283. glow(id,0,0,0,0)
  3284.  
  3285. beam()
  3286.  
  3287. new aname[64]
  3288. get_user_name(id,aname,63)
  3289.  
  3290. if(!g_sprint[id])
  3291. set_speedchange(id)
  3292.  
  3293. format(temp1,63,"%s [%s] Chutou a bola!",TeamNames[team],aname)
  3294. //client_print(0,print_console,"%s",temp1)
  3295.  
  3296. return PLUGIN_HANDLED
  3297. }
  3298.  
  3299. /*====================================================================================================
  3300. [Command Blocks]
  3301.  
  3302. Purpose: $$
  3303.  
  3304. Comment: $$
  3305.  
  3306. ====================================================================================================*/
  3307. public client_kill(id) {
  3308. if(is_kickball)
  3309. return PLUGIN_HANDLED
  3310. return PLUGIN_CONTINUE
  3311. }
  3312.  
  3313. public client_command(id) {
  3314. if(!is_kickball) return PLUGIN_CONTINUE
  3315.  
  3316. new arg[13]
  3317. read_argv( 0, arg , 12 )
  3318.  
  3319. if ( equal("buy",arg) || equal("autobuy",arg) )
  3320. return PLUGIN_HANDLED
  3321.  
  3322. return PLUGIN_CONTINUE
  3323. }
  3324.  
  3325. //fix for an exploit.
  3326. public menuclass(id) {
  3327.  
  3328. // They changed teams
  3329. SetPlayerModel(id, 0xFF);
  3330. clcmd_changeteam(id)
  3331. }
  3332.  
  3333. GetPlayerModel(id)
  3334. {
  3335. if(!is_user_connected(id))
  3336. return 0;
  3337.  
  3338. return get_pdata_int(id, OFFSET_INTERNALMODEL, 5);
  3339. }
  3340.  
  3341. SetPlayerModel(id, int)
  3342. {
  3343. if(!is_user_connected(id))
  3344. return;
  3345.  
  3346. set_pdata_int(id, OFFSET_INTERNALMODEL, int, 5);
  3347. }
  3348.  
  3349. /*
  3350. public team_select(id, key) {
  3351. if(is_kickball)
  3352. {
  3353.  
  3354. cmdUnKeeper(id)
  3355. soy_spec[id] = false
  3356. new team = get_user_team(id)
  3357.  
  3358. if( (team == 1 || team == 2) && (key == team-1) )
  3359. {
  3360. new message[64]
  3361. format(message, 63, "No puedes volver a entrar al mismo equipo!")
  3362. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("StatusText"), {0, 0, 0}, id)
  3363. write_byte(0)
  3364. write_string(message)
  3365. message_end()
  3366. cmdUnKeeper(id)
  3367. soy_spec[id] = false
  3368. engclient_cmd(id,"chooseteam")
  3369. return PLUGIN_HANDLED
  3370. }
  3371. }
  3372. return PLUGIN_CONTINUE
  3373. }
  3374. */
  3375.  
  3376. public fullupdate(id)
  3377. return PLUGIN_HANDLED
  3378.  
  3379. /*====================================================================================================
  3380. [Upgrades]
  3381.  
  3382. Purpose: This handles the upgrade menu.
  3383.  
  3384. Comment: $$
  3385.  
  3386. ====================================================================================================*/
  3387. public BuyUpgrade(id) {
  3388.  
  3389. new level[65], num[11], mTitle[101]//, max_count
  3390. format(mTitle,100,"Levels - Skills:")
  3391.  
  3392. menu_upgrade[id] = menu_create(mTitle, "Upgrade_Handler")
  3393. new x
  3394. for(x=1; x<=UPGRADES; x++)
  3395. {
  3396. new price = ((PlayerUpgrades[id][x] * UpgradePrice[x]) / 2) + UpgradePrice[x]
  3397. if((PlayerUpgrades[id][x] + 1) > UpgradeMax[x]) {
  3398. //max_count++
  3399. format(level,64,"\r%s (FULL LVL: %i)",UpgradeTitles[x], UpgradeMax[x])
  3400. }
  3401. else {
  3402. format(level,64,"%s \r(Proximo Lvl: %i) \y-- \w%i XP",UpgradeTitles[x], PlayerUpgrades[id][x]+1, price)
  3403. }
  3404. format(num, 10,"%i",x)
  3405. menu_additem(menu_upgrade[id], level, num, 0)
  3406. }
  3407.  
  3408. menu_addblank(menu_upgrade[id], (UPGRADES+1))
  3409. menu_setprop(menu_upgrade[id], MPROP_EXIT, MEXIT_NORMAL)
  3410.  
  3411. menu_display(id, menu_upgrade[id], 0)
  3412. return PLUGIN_HANDLED
  3413. }
  3414.  
  3415. public Upgrade_Handler(id, menu, item) {
  3416.  
  3417. if(item == MENU_EXIT)
  3418. return PLUGIN_HANDLED
  3419.  
  3420. new cmd[6], iName[64]
  3421. new access, callback
  3422. menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
  3423.  
  3424. new upgrade = str_to_num(cmd)
  3425.  
  3426. new playerupgrade = PlayerUpgrades[id][upgrade]
  3427. new price = ((playerupgrade * UpgradePrice[upgrade]) / 2) + UpgradePrice[upgrade]
  3428. new maxupgrade = UpgradeMax[upgrade]
  3429.  
  3430. if(playerupgrade != maxupgrade && playerupgrade != maxupgrade+MAX_LVL_BONUS)
  3431. {
  3432. new needed = g_Experience[id] - price
  3433.  
  3434. if( (needed >= 0) )
  3435. {
  3436. if(playerupgrade < maxupgrade-1)
  3437. playerupgrade += 1
  3438. else
  3439. playerupgrade += MAX_LVL_BONUS+1
  3440.  
  3441. g_Experience[id] -= price
  3442.  
  3443. if(playerupgrade < maxupgrade)
  3444. ColorChat(id,YELLOW,"Voce subiu para o Lvl ^x03%i^x01 de ^x04%s^x01 usando ^x03%i^x01 de EXP.",playerupgrade,UpgradeTitles[upgrade],price)
  3445. else {
  3446. ColorChat(id,YELLOW,"Voce subiu para o Lvl ^x03%i^x01 de ^x04%s^x01 usando ^x03%i^x01 de EXP.",maxupgrade,UpgradeTitles[upgrade],price)
  3447. #if(MAX_LVL_BONUS > 1)
  3448. ColorChat(id,YELLOW,"Voce chegou ao Lvl maximo ^x04(%i)^x01! e Recebeu ^x03%i^x01 de extra level bonus!",maxupgrade,MAX_LVL_BONUS)
  3449. #else
  3450. ColorChat(id,YELLOW,"Voce chegou ao Lvl maximo ^x04(%i)^x01!",maxupgrade)
  3451. #endif
  3452.  
  3453. // play_wav(id, UPGRADED_MAX_LEVEL)
  3454. play_wav(id, SoundDirect[18])
  3455. }
  3456. switch(upgrade) {
  3457. case STA: {
  3458. new stam = playerupgrade * ConfigPro[16]
  3459. entity_set_float(id, EV_FL_health, float(ConfigPro[5] + stam))
  3460. }
  3461. case AGI: {
  3462. if(!g_sprint[id])
  3463. set_speedchange(id)
  3464. }
  3465. }
  3466. PlayerUpgrades[id][upgrade] = playerupgrade
  3467. }
  3468. else
  3469. ColorChat(id,YELLOW,"Faltam ^x04%i^x01 de EXP para Lvl ^x03%i^x01 de ^x04%s^x01!",(needed * -1),(playerupgrade+1),UpgradeTitles[upgrade])
  3470. }
  3471. else {
  3472. ColorChat(id,YELLOW,"^x04Voce^x01 chegou ao Lvl maximo de ^x03%s^x01 (^x04%i^x01)!",UpgradeTitles[upgrade],maxupgrade)
  3473. }
  3474. return PLUGIN_HANDLED
  3475. }
  3476.  
  3477. /*====================================================================================================
  3478. [Meters]
  3479.  
  3480. Purpose: This controls the turbo meter and curve angle meter.
  3481.  
  3482. Comment: $$
  3483.  
  3484. ====================================================================================================*/
  3485. public meter()
  3486. {
  3487. new id
  3488. new turboTitle[MAX_PLAYER + 1]
  3489. new sprintText[128], sec
  3490. new r, g, b, team
  3491. new len, x
  3492. new ndir = -(ConfigPro[11])
  3493. format(turboTitle, MAX_PLAYER,"[-TURBO-]");
  3494. for(id=1; id<=maxplayers; id++)
  3495. {
  3496. if(!is_user_connected(id) || !is_user_alive(id) || is_user_bot(id))
  3497. continue
  3498.  
  3499. sec = seconds[id]
  3500. team = get_user_team(id)
  3501. if(team == 1)
  3502. {
  3503. r = PlayerColors[25]
  3504. g = PlayerColors[26]
  3505. b = PlayerColors[27]
  3506. }
  3507. else if(team == 2)
  3508. {
  3509. r = PlayerColors[22]
  3510. g = PlayerColors[23]
  3511. b = PlayerColors[24]
  3512. }
  3513. else
  3514. {
  3515. r = 0
  3516. g = 0
  3517. b = 0
  3518. }
  3519.  
  3520. if(id == ballholder)
  3521. {
  3522.  
  3523. set_hudmessage(r, g, b, POS_X, 0.75, 0, 0.0, 0.6, 0.0, 0.0, 1)
  3524.  
  3525. len = format(sprintText, 127, "[-CURVA-]^n[")
  3526.  
  3527. for(x=ConfigPro[11]; x>=ndir; x--)
  3528. if(x==0)
  3529. len += format(sprintText[len], 127-len, "%s%s",direction==x?"0":"+", x==ndir?"]":" ")
  3530. else
  3531. len += format(sprintText[len], 127-len, "%s%s",direction==x?"0":"=", x==ndir?"]":" ")
  3532.  
  3533. show_hudmessage(id, "%s", sprintText)
  3534. }
  3535.  
  3536. set_hudmessage(r, g, b, POS_X, POS_Y, 0, 0.0, 0.6, 0.0, 0.0, 3)
  3537.  
  3538. if(Pro_Rank[id])
  3539. {
  3540. if(sec > 30)
  3541. {
  3542. sec -= 2
  3543. if(get_pcvar_num(CVAR_RANK))
  3544. format(sprintText, 127, " %s ^n[==============]^nRANK: %i",turboTitle, Pro_Rank[id])
  3545. else
  3546. format(sprintText, 127, " %s ^n[==============]",turboTitle)
  3547.  
  3548. set_speedchange(id)
  3549. g_sprint[id] = 0
  3550. }
  3551. else if(sec >= 0 && sec < 30 && g_sprint[id])
  3552. {
  3553. sec += 2
  3554. set_speedchange(id, 100.0)
  3555. }
  3556. }
  3557. else
  3558. {
  3559. if(sec > 30)
  3560. {
  3561. sec -= 2
  3562. if(get_pcvar_num(CVAR_RANK))
  3563. format(sprintText, 127, " %s ^n[==============]^nDigite /menu e registre-se para entrar no rank",turboTitle)
  3564. else
  3565. format(sprintText, 127, " %s ^n[==============]",turboTitle)
  3566.  
  3567. set_speedchange(id)
  3568. g_sprint[id] = 0
  3569. }
  3570. else if(sec >= 0 && sec < 30 && g_sprint[id])
  3571. {
  3572. sec += 2
  3573. set_speedchange(id, 100.0)
  3574. }
  3575. }
  3576.  
  3577. if(get_pcvar_num(CVAR_RANK))
  3578. {
  3579. if(Pro_Rank[id])
  3580. {
  3581. switch(sec)
  3582. {
  3583. case 0: format(sprintText, 127, " %s ^n[||||||||||||||]^nRANK: %i",turboTitle, Pro_Rank[id])
  3584. case 2: format(sprintText, 127, " %s ^n[|||||||||||||=]^nRANK: %i",turboTitle, Pro_Rank[id])
  3585. case 4: format(sprintText, 127, " %s ^n[||||||||||||==]^nRANK: %i",turboTitle, Pro_Rank[id])
  3586. case 6: format(sprintText, 127, " %s ^n[|||||||||||===]^nRANK: %i",turboTitle, Pro_Rank[id])
  3587. case 8: format(sprintText, 127, " %s ^n[||||||||||====]^nRANK: %i",turboTitle, Pro_Rank[id])
  3588. case 10: format(sprintText, 127, " %s ^n[|||||||||=====]^nRANK: %i",turboTitle, Pro_Rank[id])
  3589. case 12: format(sprintText, 127, " %s ^n[||||||||======]^nRANK: %i",turboTitle, Pro_Rank[id])
  3590. case 14: format(sprintText, 127, " %s ^n[|||||||=======]^nRANK: %i",turboTitle, Pro_Rank[id])
  3591. case 16: format(sprintText, 127, " %s ^n[||||||========]^nRANK: %i",turboTitle, Pro_Rank[id])
  3592. case 18: format(sprintText, 127, " %s ^n[|||||=========]^nRANK: %i",turboTitle, Pro_Rank[id])
  3593. case 20: format(sprintText, 127, " %s ^n[||||==========]^nRANK: %i",turboTitle, Pro_Rank[id])
  3594. case 22: format(sprintText, 127, " %s ^n[|||===========]^nRANK: %i",turboTitle, Pro_Rank[id])
  3595. case 24: format(sprintText, 127, " %s ^n[||============]^nRANK: %i",turboTitle, Pro_Rank[id])
  3596. case 26: format(sprintText, 127, " %s ^n[|=============]^nRANK: %i",turboTitle, Pro_Rank[id])
  3597. case 28: format(sprintText, 127, " %s ^n[==============]^nRANK: %i",turboTitle, Pro_Rank[id])
  3598. case 30:
  3599. {
  3600. format(sprintText, 128, " %s ^n[==============]^nRANK: %i",turboTitle, Pro_Rank[id])
  3601. sec = 92
  3602. }
  3603. case 32: sec = 0
  3604. }
  3605. }
  3606.  
  3607. else
  3608. {
  3609. switch(sec)
  3610. {
  3611. case 0: format(sprintText, 127, " %s ^n[||||||||||||||]^nDigite /menu e registre-se",turboTitle)
  3612. case 2: format(sprintText, 127, " %s ^n[|||||||||||||=]^nDigite /menu e registre-se",turboTitle)
  3613. case 4: format(sprintText, 127, " %s ^n[||||||||||||==]^nDigite /menu e registre-se",turboTitle)
  3614. case 6: format(sprintText, 127, " %s ^n[|||||||||||===]^nDigite /menu e registre-se",turboTitle)
  3615. case 8: format(sprintText, 127, " %s ^n[||||||||||====]^nDigite /menu e registre-se",turboTitle)
  3616. case 10: format(sprintText, 127, " %s ^n[|||||||||=====]^nDigite /menu e registre-se",turboTitle)
  3617. case 12: format(sprintText, 127, " %s ^n[||||||||======]^nDigite /menu e registre-se",turboTitle)
  3618. case 14: format(sprintText, 127, " %s ^n[|||||||=======]^nDigite /menu e registre-se",turboTitle)
  3619. case 16: format(sprintText, 127, " %s ^n[||||||========]^nDigite /menu e registre-se",turboTitle)
  3620. case 18: format(sprintText, 127, " %s ^n[|||||=========]^nDigite /menu e registre-se",turboTitle)
  3621. case 20: format(sprintText, 127, " %s ^n[||||==========]^nDigite /menu e registre-se",turboTitle)
  3622. case 22: format(sprintText, 127, " %s ^n[|||===========]^nDigite /menu e registre-se",turboTitle)
  3623. case 24: format(sprintText, 127, " %s ^n[||============]^nDigite /menu e registre-se",turboTitle)
  3624. case 26: format(sprintText, 127, " %s ^n[|=============]^nDigite /menu e registre-se",turboTitle)
  3625. case 28: format(sprintText, 127, " %s ^n[==============]^nDigite /menu e registre-se",turboTitle)
  3626. case 30:
  3627. {
  3628. format(sprintText, 128, " %s ^n[==============]^nDigite /menu e registre-se",turboTitle)
  3629. sec = 92
  3630. }
  3631. case 32: sec = 0
  3632. }
  3633. }
  3634. }
  3635. else
  3636. {
  3637. switch(sec)
  3638. {
  3639. case 0: format(sprintText, 127, " %s ^n[||||||||||||||]",turboTitle)
  3640. case 2: format(sprintText, 127, " %s ^n[|||||||||||||=]",turboTitle)
  3641. case 4: format(sprintText, 127, " %s ^n[||||||||||||==]",turboTitle)
  3642. case 6: format(sprintText, 127, " %s ^n[|||||||||||===]",turboTitle)
  3643. case 8: format(sprintText, 127, " %s ^n[||||||||||====]",turboTitle)
  3644. case 10: format(sprintText, 127, " %s ^n[|||||||||=====]",turboTitle)
  3645. case 12: format(sprintText, 127, " %s ^n[||||||||======]",turboTitle)
  3646. case 14: format(sprintText, 127, " %s ^n[|||||||=======]",turboTitle)
  3647. case 16: format(sprintText, 127, " %s ^n[||||||========]",turboTitle)
  3648. case 18: format(sprintText, 127, " %s ^n[|||||=========]",turboTitle)
  3649. case 20: format(sprintText, 127, " %s ^n[||||==========]",turboTitle)
  3650. case 22: format(sprintText, 127, " %s ^n[|||===========]",turboTitle)
  3651. case 24: format(sprintText, 127, " %s ^n[||============]",turboTitle)
  3652. case 26: format(sprintText, 127, " %s ^n[|=============]",turboTitle)
  3653. case 28: format(sprintText, 127, " %s ^n[==============]",turboTitle)
  3654. case 30:
  3655. {
  3656. format(sprintText, 128, " %s ^n[==============]",turboTitle)
  3657. sec = 92
  3658. }
  3659. case 32: sec = 0
  3660. }
  3661. }
  3662. seconds[id] = sec
  3663. show_hudmessage(id,"%s",sprintText)
  3664. }
  3665. }
  3666.  
  3667.  
  3668. /*====================================================================================================
  3669. [Misc.]
  3670.  
  3671. Purpose: $$
  3672.  
  3673. Comment: $$
  3674.  
  3675. ====================================================================================================*/
  3676. set_speedchange(id, Float:speed=0.0)
  3677. {
  3678. new Float:agi = float( (PlayerUpgrades[id][AGI] * ConfigPro[18]) + (id==ballholder?(ConfigPro[14] * (PowerPlay*2)):0) )
  3679. agi += (250.0 + speed)
  3680. entity_set_float(id,EV_FL_maxspeed, agi)
  3681. }
  3682.  
  3683. public give_knife(id) {
  3684. if(id > 1000)
  3685. id -= 1000
  3686.  
  3687. remove_task(id+1000)
  3688.  
  3689.  
  3690. give_item(id, "weapon_knife")
  3691. has_knife[id] = true;
  3692. }
  3693.  
  3694. Event_Record(id, recordtype, amt, exp) {
  3695. if(amt == -1)
  3696. MadeRecord[id][recordtype]++
  3697. else
  3698. MadeRecord[id][recordtype] = amt
  3699.  
  3700. new playerRecord = MadeRecord[id][recordtype]
  3701. if(playerRecord > TopPlayer[1][recordtype])
  3702. {
  3703. TopPlayer[0][recordtype] = id
  3704. TopPlayer[1][recordtype] = playerRecord
  3705. new name[MAX_PLAYER+1]
  3706. get_user_name(id,name,MAX_PLAYER)
  3707. format(TopPlayerName[recordtype],MAX_PLAYER,"%s",name)
  3708. }
  3709. g_Experience[id] += exp
  3710. }
  3711.  
  3712. Float:normalize(Float:nVel)
  3713. {
  3714. if(nVel > 360.0) {
  3715. nVel -= 360.0
  3716. }
  3717. else if(nVel < 0.0) {
  3718. nVel += 360.0
  3719. }
  3720.  
  3721. return nVel
  3722. }
  3723.  
  3724. print_message(id, msg[]) {
  3725. message_begin(MSG_ONE_UNRELIABLE, gmsgSayText, {0,0,0}, id)
  3726. write_byte(id)
  3727. write_string(msg)
  3728. message_end()
  3729. }
  3730.  
  3731. public editTextMsg()
  3732. {
  3733. new string[64], radio[64]
  3734. get_msg_arg_string(2, string, 63)
  3735.  
  3736. if( get_msg_args() > 2 )
  3737. get_msg_arg_string(3, radio, 63)
  3738.  
  3739. if(containi(string, "#Game_will_restart") != -1 || containi(radio, "#Game_radio") != -1)
  3740. return PLUGIN_HANDLED
  3741.  
  3742. return PLUGIN_CONTINUE
  3743. }
  3744.  
  3745. public client_connect(id)
  3746. {
  3747. if(is_kickball)
  3748. {
  3749. //Pro_Active[id] = 0 // version 5.06
  3750. soy_spec[id] = false
  3751. set_user_info(id,"_vgui_menus","1")
  3752. }
  3753. }
  3754.  
  3755.  
  3756. public AutoRespawn(id)
  3757. if(is_dead[id] && is_user_connected(id)) {
  3758. new team = get_user_team(id)
  3759. if(team == 1 || team == 2) {
  3760. spawn(id)
  3761. mudarskin(id)
  3762. }
  3763. else
  3764. is_dead[id] = false
  3765. }
  3766.  
  3767.  
  3768. public AutoRespawn2(id)
  3769. if(is_dead[id] && is_user_connected(id)) {
  3770. new team = get_user_team(id)
  3771. if(team == 1 || team == 2) {
  3772. spawn(id)
  3773. mudarskin(id)
  3774. if(has_knife[id] && soy_spec[id] == false)
  3775. give_knife(id)
  3776. }
  3777. //strip_user_weapons(id)
  3778. is_dead[id] = false
  3779. }
  3780.  
  3781. play_wav(id, wav[])
  3782. client_cmd(id,"spk %s",wav)
  3783.  
  3784.  
  3785. cmdSpectate(id)
  3786. {
  3787. if(get_pcvar_num(CVAR_SPEC))
  3788. {
  3789. if(is_user_alive(id))
  3790. {
  3791. cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE)
  3792. user_kill(id)
  3793. }
  3794. }
  3795. else
  3796. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Opcao desabilitada")
  3797. }
  3798.  
  3799.  
  3800. cmdSpectatemenu(id)
  3801. {
  3802. if(get_pcvar_num(CVAR_SPEC))
  3803. {
  3804. cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE)
  3805. user_kill(id)
  3806. }
  3807. else
  3808. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Opcao desabilitada")
  3809. }
  3810.  
  3811.  
  3812. increaseTeamXP(team, amt) {
  3813. new id
  3814. for(id=1; id<=maxplayers; id++)
  3815. if(get_user_team(id) == team && is_user_connected(id))
  3816. g_Experience[id] += amt
  3817. }
  3818.  
  3819. setScoreInfo(id) {
  3820. message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));
  3821. write_byte(id);
  3822. write_short(get_user_frags(id));
  3823. write_short(cs_get_user_deaths(id));
  3824. write_short(0);
  3825. write_short(get_user_team(id));
  3826. message_end();
  3827. }
  3828.  
  3829. // Erase our current temps (used for ball events)
  3830. public eraser(num) {
  3831. if(num == 3333)
  3832. format(temp1,63,"")
  3833. if(num == 4444)
  3834. format(temp2,63,"")
  3835. return PLUGIN_HANDLED
  3836. }
  3837. /*====================================================================================================
  3838. [Cleanup]
  3839.  
  3840. Purpose: $$
  3841.  
  3842. Comment: $$
  3843.  
  3844. ====================================================================================================*/
  3845. public client_disconnect(id)
  3846. {
  3847. if(is_kickball)
  3848. {
  3849. UserPassword[id] = false;
  3850. soy_spec[id] = false;
  3851. IsConnected[id] = false;
  3852.  
  3853. if(ActiveJoinTeam == 1 && sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  3854. {
  3855. new clase_tt = 0, clase_ct = 0, suma_player = 0;
  3856. for(new x = 1; x <= MAX_PLAYER; x++)
  3857. {
  3858. if(is_user_connected(x))
  3859. {
  3860. switch(TeamSelect[x])
  3861. {
  3862. case 1: clase_tt++
  3863. case 2: clase_ct++
  3864. }
  3865. }
  3866. }
  3867.  
  3868. suma_player = clase_tt + clase_ct
  3869. if(suma_player < ConfigPro[31])
  3870. {
  3871. sj_systemrank = 0
  3872. ColorChat(0,GREY,"[ a7x ' # TeaM ]^x04 Sistema de Rank desabilitado por ter menos de 9 players ON")
  3873. }
  3874. }
  3875.  
  3876. // Offside Clear
  3877.  
  3878. if(is_offside[id])
  3879. is_offside[id] = false;
  3880.  
  3881. // Foul clear
  3882.  
  3883. is_user_foul[id] = false;
  3884.  
  3885. if(get_pcvar_num(CVAR_RESEXP))
  3886. SavePlayerExp(id)
  3887.  
  3888. new x
  3889. for(x = 1; x<=RECORDS; x++)
  3890. MadeRecord[id][x] = 0
  3891.  
  3892. remove_task(id)
  3893. if(ballholder == id )
  3894. {
  3895. ballholder = 0
  3896. clearBall()
  3897. }
  3898. if(ballowner == id)
  3899. {
  3900. ballowner = 0
  3901. }
  3902.  
  3903. GoalyPoints[id] = 0
  3904. PlayerKills[id] = 0
  3905. PlayerDeaths[id] = 0
  3906. is_dead[id] = false
  3907. seconds[id] = 0
  3908. g_sprint[id] = 0
  3909. PressedAction[id] = 0
  3910. has_knife[id] = false;
  3911. g_Experience[id] = 0
  3912.  
  3913. for(x=1; x<=UPGRADES; x++)
  3914. PlayerUpgrades[id][x] = 0
  3915.  
  3916. Pro_Point[id] = 0
  3917. Pro_Goal[id] = 0
  3918. Pro_Steal[id] = 0
  3919. Pro_Asis[id] = 0
  3920. Pro_Contra[id] = 0
  3921. Pro_Disarm[id] = 0
  3922. Pro_Kill[id] = 0
  3923. Pro_teKill[id] = 0
  3924. Pro_teSteal[id] = 0
  3925. Pro_teDisarm[id] = 0
  3926. // Pro_Partidos[id] = 0 // version 5.06
  3927. // Pro_Active[id] = 0 // version 5.06
  3928.  
  3929. cmdUnKeeper(id)
  3930. }
  3931. }
  3932.  
  3933. cleanup() {
  3934. new x, id, m
  3935. for(x=1;x<=RECORDS;x++) {
  3936. TopPlayer[0][x] = 0
  3937. TopPlayer[1][x] = 0
  3938. TopPlayerName[x][0] = 0
  3939. }
  3940.  
  3941. for(id=1;id<=maxplayers;id++) {
  3942. PlayerDeaths[id] = 0
  3943. PlayerKills[id] = 0
  3944.  
  3945. //UsedExp[id] = 0
  3946. g_Experience[id] = 0
  3947.  
  3948. for(x=1;x<=UPGRADES;x++)
  3949. PlayerUpgrades[id][x] = 0
  3950.  
  3951. for(m = 1; m<=RECORDS; m++)
  3952. MadeRecord[id][m] = 0
  3953. }
  3954.  
  3955. PowerPlay = 0
  3956. winner = 0
  3957. score[T] = 0
  3958. score[CT] = 0
  3959. set_cvar_num("score_ct",0)
  3960. set_cvar_num("score_t",0)
  3961.  
  3962. for(x = 0;x<=cntCT;x++)
  3963. ct[x] = 0
  3964.  
  3965. for(x = 0; x<= cntT; x++)
  3966. terr[x] = 0
  3967.  
  3968. cntCT = 0
  3969. cntT = 0
  3970. }
  3971.  
  3972. /*====================================================================================================
  3973. [Help]
  3974.  
  3975. Purpose: $$
  3976.  
  3977. Comment: $$
  3978.  
  3979. ====================================================================================================*/
  3980. public client_putinserver(id) {
  3981.  
  3982. if(is_kickball)
  3983. {
  3984. // Pro_Active[id] = 0 // version 5.06
  3985.  
  3986. VerificarUser(id)
  3987.  
  3988. soy_spec[id] = false
  3989. IsConnected[id] = true;
  3990.  
  3991. new MapName[64]
  3992. set_task(20.0,"soccerjamHelp",id)
  3993.  
  3994. if(get_pcvar_num(CVAR_RESEXP))
  3995. set_task(10.0,"VerificarExist",id)
  3996. else
  3997. set_task(10.0,"LateJoinExp",id)
  3998.  
  3999.  
  4000. get_mapname(MapName,63)
  4001. if(equali(MapName,"sj_indoorx_small"))
  4002. set_task(2.0,"areas_indoorx",id)
  4003.  
  4004. if(equali(MapName,"sj_pro"))
  4005. set_task(2.0,"areas_pro",id)
  4006.  
  4007. if(equali(MapName,"sj_pro_small"))
  4008. set_task(2.0,"areas_pro_small",id)
  4009.  
  4010. if(equali(MapName,"soccerjam"))
  4011. set_task(2.0,"areas_soccerjam",id)
  4012.  
  4013. new flags = get_user_flags(id)
  4014. if(flags&ADMIN_KICK)
  4015. client_cmd(id, "bind / amx_sjmenu")
  4016.  
  4017. }
  4018. }
  4019.  
  4020. VerificarAccess(id, name[], password[])
  4021. {
  4022. new playername[MAX_PLAYER + 1];
  4023.  
  4024. if(name[0])
  4025. {
  4026. copy(playername, 31, name)
  4027. }
  4028. else
  4029. {
  4030. get_user_name(id, playername, 31)
  4031. }
  4032.  
  4033. new result = 0
  4034.  
  4035. rankVault = nvault_open(VAULTNAMERANK);
  4036. topVault = nvault_open(VAULTNAMETOP);
  4037.  
  4038. new vaultkey[64], vaultdata[64], timestamp;
  4039.  
  4040. new rank_pw[MAX_PLAYER + 1],rank_points[MAX_PLAYER + 1], rank_goles[MAX_PLAYER + 1], rank_robos[MAX_PLAYER + 1], rank_asis[MAX_PLAYER + 1], rank_encontra[MAX_PLAYER + 1], rank_disarm[MAX_PLAYER + 1], rank_kill[MAX_PLAYER + 1], rank_tekill[MAX_PLAYER + 1], rank_terobos[MAX_PLAYER + 1], rank_tedisarm[MAX_PLAYER + 1], rank_rank[MAX_PLAYER + 1];
  4041. format(vaultkey, 63, "^"%s^"", playername);
  4042. if(nvault_lookup(rankVault, vaultkey, vaultdata, 1500, timestamp))
  4043. {
  4044. parse(vaultdata, rank_pw, MAX_PLAYER, rank_points, MAX_PLAYER, rank_goles, MAX_PLAYER, rank_robos, MAX_PLAYER, rank_asis, MAX_PLAYER, rank_encontra, MAX_PLAYER, rank_disarm, MAX_PLAYER, rank_kill, MAX_PLAYER, rank_tekill, MAX_PLAYER, rank_terobos, MAX_PLAYER, rank_tedisarm, MAX_PLAYER, rank_rank, MAX_PLAYER);
  4045. if(equali(rank_pw, password))
  4046. {
  4047. Pro_Point[id] = str_to_num(rank_points);
  4048. Pro_Goal[id] = str_to_num(rank_goles);
  4049. Pro_Steal[id] = str_to_num(rank_robos);
  4050. Pro_Asis[id] = str_to_num(rank_asis);
  4051. Pro_Contra[id] = str_to_num(rank_encontra);
  4052. Pro_Disarm[id] = str_to_num(rank_disarm);
  4053. Pro_Kill[id] = str_to_num(rank_kill);
  4054. Pro_teKill[id] = str_to_num(rank_tekill);
  4055. Pro_teSteal[id] = str_to_num(rank_terobos);
  4056. Pro_teDisarm[id] = str_to_num(rank_tedisarm);
  4057. Pro_Rank[id] = str_to_num(rank_rank);
  4058.  
  4059. result = 1
  4060. }
  4061. else
  4062. result = 2
  4063. }
  4064. else
  4065. result = 3
  4066.  
  4067.  
  4068. nvault_close(rankVault);
  4069. nvault_close(topVault);
  4070.  
  4071. return result
  4072. }
  4073.  
  4074.  
  4075. VerificarUser(id, name[] = "")
  4076. {
  4077. new password[32], passfield[32], username[32]
  4078.  
  4079. if (name[0])
  4080. {
  4081. copy(username, 31, name)
  4082. }
  4083. else
  4084. {
  4085. get_user_name(id, username, 31)
  4086. }
  4087.  
  4088. get_pcvar_string(sj_password_field, passfield, 31)
  4089. get_user_info(id, passfield, password, 31)
  4090. new result = VerificarAccess(id, username, password)
  4091.  
  4092. if (result == 1)
  4093. {
  4094. UserPassword[id] = true;
  4095. client_cmd(id, "echo ^"[Sj-Pro] Has sido logueado correctamente^"")
  4096. }
  4097.  
  4098. if (result == 2)
  4099. {
  4100. UserPassword[id] = true;
  4101. ClearTask(id)
  4102. client_cmd(id, "echo ^"[Sj-Pro] Contrasenia incorrecta^"")
  4103. }
  4104.  
  4105. if (result == 3)
  4106. {
  4107. UserPassword[id] = false;
  4108. ClearTask(id)
  4109. client_cmd(id, "echo ^"[Sj-Pro] Debes crearte una cuenta para estar en el rank, tipea help para mas info^"")
  4110. }
  4111.  
  4112. return PLUGIN_CONTINUE
  4113. }
  4114.  
  4115. public client_infochanged(id)
  4116. {
  4117. if(!is_user_connected(id))
  4118. {
  4119. return PLUGIN_CONTINUE
  4120. }
  4121.  
  4122. new newname[32], oldname[32]
  4123.  
  4124. get_user_name(id, oldname, 31)
  4125. get_user_info(id, "name", newname, 31)
  4126.  
  4127. if (!equali(newname, oldname))
  4128. {
  4129. VerificarUser(id, newname)
  4130. }
  4131.  
  4132. return PLUGIN_CONTINUE
  4133. }
  4134.  
  4135. public soccerjamHelp(id)
  4136. {
  4137. if(!is_user_connected(id))
  4138. return
  4139.  
  4140. new name[MAX_PLAYER + 1]
  4141. get_user_name(id,name, MAX_PLAYER)
  4142. ColorChat(id,YELLOW," ")
  4143. ColorChat(id,YELLOW,"^x04- [ a7x ' # TeaM SoccerJam] ^x03 2.0 ^x01- by^x03 NcN")
  4144. ColorChat(id,YELLOW,"Bem-Vindo ^x03%s^x01, voce entrou na partida!",name)
  4145. ColorChat(id,YELLOW,"Boa sorte e bom jogo.")
  4146. }
  4147.  
  4148. public LateJoinExp(id)
  4149. {
  4150. if(!is_user_connected(id))
  4151. return
  4152.  
  4153. new total = (score[T] + score[CT]) * ConfigPro[13]
  4154. if(total)
  4155. {
  4156. g_Experience[id] = total
  4157. ColorChat(id, YELLOW, "Voce recebeu ^x04%i^x01 de EXP por entrar depois!",total)
  4158. }
  4159. }
  4160.  
  4161. public handle_say(id)
  4162. {
  4163. new name[MAX_PLAYER + 1]
  4164. get_user_name(id,name, MAX_PLAYER)
  4165. new said[192], help[7]
  4166. read_args(said,192)
  4167. remove_quotes(said)
  4168. strcat(help,said,6)
  4169. if((containi(help, "help") != -1))
  4170. sjmenuhelp(id)
  4171. if((contain(help, "spec") != -1))
  4172. {
  4173. if(get_pcvar_num(CVAR_SPEC))
  4174. {
  4175. cmdUnKeeper(id)
  4176. cmdSpectate(id)
  4177. ColorChat(0,TEAM_COLOR,"%s^x01: ^x04spec",name)
  4178. return PLUGIN_HANDLED
  4179. }
  4180. else
  4181. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Opcao desabilitada")
  4182. }
  4183.  
  4184. if((contain(help, "/spec") != -1) ) {
  4185. return PLUGIN_HANDLED
  4186. }
  4187. if(soy_spec[id] == true)
  4188. {
  4189. new sayspec[192]
  4190. read_args(sayspec,192)
  4191. if (equal(sayspec, ""))
  4192. return PLUGIN_HANDLED
  4193.  
  4194. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Somente say_team ou say adm")
  4195. client_cmd(id,"say_team %s",sayspec)
  4196. return PLUGIN_HANDLED
  4197. }
  4198.  
  4199. return PLUGIN_CONTINUE
  4200. }
  4201.  
  4202. /*====================================================================================================
  4203. [Post Game]
  4204.  
  4205. Purpose: $$
  4206.  
  4207. Comment: $$
  4208.  
  4209. ====================================================================================================*/
  4210. public showhud_winner() {
  4211. set_hudmessage(255, 0, 20, -1.0, 0.35, 1, 1.0, 1.5, 0.1, 0.1, HUD_CHANNEL)
  4212. show_hudmessage(0,"%s",scoreboard)
  4213. server_cmd("amx_rtv")
  4214. server_cmd("gal_startvote")
  4215.  
  4216.  
  4217. }
  4218. public displayWinnerAwards()
  4219. {
  4220. //If NO steal/assist was made, set name to Nobody
  4221. new x
  4222. for(x=1;x<=RECORDS;x++)
  4223. if(!TopPlayer[0][x])
  4224. format(TopPlayerName[x],MAX_PLAYER,"Ninguem")
  4225.  
  4226. //Display our Winning Team, with Awards, and kill Comm Chair of opponent
  4227. new awards[513]
  4228. new len = 0
  4229. len += format(awards[len], 512-len, "%s VENCEU!^n", (winner == 1 ? "Terrorist" : "CT"))
  4230. len += format(awards[len], 512-len, "%s - %i | %s - %i^n^n", TeamNames[T],score[T],TeamNames[CT],score[CT])
  4231. len += format(awards[len], 512-len, " -- Premios --^n")
  4232. len += format(awards[len], 512-len, "%i Gols -- %s^n", TopPlayer[1][GOAL], TopPlayerName[GOAL])
  4233. len += format(awards[len], 512-len, "%i Roubos -- %s^n", TopPlayer[1][STEAL], TopPlayerName[STEAL])
  4234. len += format(awards[len], 512-len, "%i Assistencias -- %s^n", TopPlayer[1][ASSIST], TopPlayerName[ASSIST])
  4235. len += format(awards[len], 512-len, "%i Boladas -- %s^n", TopPlayer[1][KILL], TopPlayerName[KILL])
  4236. len += format(awards[len], 512-len, "%i Metros (Gol mais longe) -- %s^n", TopPlayer[1][DISTANCE], TopPlayerName[DISTANCE])
  4237. len += format(awards[len], 512-len, "%i Desarme -- %s^n", TopPlayer[1][DISARMS], TopPlayerName[DISARMS])
  4238. len += format(awards[len], 512-len, "%i Gols Contra -- %s^n", TopPlayer[1][ENCONTRA], TopPlayerName[ENCONTRA])
  4239.  
  4240. set_hudmessage(250, 130, 20, 0.4, 0.35, 0, 1.0, 10.0, 0.1, 0.1, 2)
  4241. show_hudmessage(0, "%s", awards)
  4242. }
  4243.  
  4244. public PostGame() {
  4245. new randomize = get_pcvar_num(CVAR_RANDOM)
  4246. if(randomize)
  4247. {
  4248. set_hudmessage(20, 250, 20, -1.0, 0.55, 1, 1.0, 3.0, 1.0, 0.5, 2)
  4249. show_hudmessage(0, "...Misturando Equipes...")
  4250. set_task(3.0,"randomize_teams",0)
  4251. }
  4252. else
  4253. BeginCountdown()
  4254. }
  4255.  
  4256. public BeginCountdown() {
  4257. if(!timer) {
  4258. timer = ConfigPro[7]
  4259. cleanup()
  4260. }
  4261. else {
  4262. new output[MAX_PLAYER + 1]
  4263. num_to_word(timer,output, MAX_PLAYER)
  4264. client_cmd(0,"spk vox/%s.wav",output)
  4265.  
  4266. if(timer > (ConfigPro[7] / 2))
  4267. set_hudmessage(0, 255, 255, -1.0, 0.55, 1, 1.0, 1.0, 1.0, 0.5, 2)
  4268. else
  4269. set_hudmessage(255, 255, 0, -1.0, 0.55, 1, 1.0, 1.0, 1.0, 0.5, 2)
  4270.  
  4271. if(timer > (ConfigPro[7] - 2))
  4272. show_hudmessage(0, "A Partida comeca em...^n%i",timer)
  4273. else
  4274. show_hudmessage(0, "%i",timer)
  4275.  
  4276. if(timer < ConfigPro[7])
  4277. server_cmd("reset_score")
  4278.  
  4279. if(timer == 1)
  4280. {
  4281. server_cmd("sv_restart 1")
  4282. server_cmd("start_score")
  4283. }
  4284. timer--
  4285. set_task(0.9,"BeginCountdown",0)
  4286. }
  4287. }
  4288.  
  4289.  
  4290. /*====================================================================================================
  4291. [Team Randomizer]
  4292.  
  4293. Purpose: $$
  4294.  
  4295. Comment: $$
  4296.  
  4297. ====================================================================================================*/
  4298. public randomize_teams()
  4299. {
  4300. new terr, ct, id, team, cnt, temp, x, pl_temp
  4301. new teams[3][MAX_PLAYER + 1], player_list[MAX_PLAYER + 1]
  4302. new shuff_t, shuff_ct
  4303. new shuffle = random_num(10,30)
  4304.  
  4305. //Put all players in one big list
  4306. for(id=1; id<=maxplayers; id++)
  4307. if(is_user_connected(id) && !is_user_bot(id)) {
  4308. team = get_user_team(id)
  4309. if(team == 1 || team == 2)
  4310. player_list[cnt++] = id
  4311. }
  4312.  
  4313. cnt--
  4314.  
  4315. //Make a list of Terr and CT players
  4316. while(cnt >= 0)
  4317. {
  4318. if(cnt % 2 == 0)
  4319. teams[1][terr++] = player_list[cnt--]
  4320. else
  4321. teams[2][ct++] = player_list[cnt--]
  4322. }
  4323.  
  4324. //Shuffle the players
  4325. for(x=0;x<=shuffle;x++) {
  4326. shuff_t = random_num(0,terr-1);
  4327. shuff_ct = random_num(0,ct-1);
  4328. temp = teams[1][shuff_t];
  4329. teams[1][shuff_t] = teams[2][shuff_ct];
  4330. teams[2][shuff_ct] = temp;
  4331. }
  4332.  
  4333. //Put Players in their team.
  4334. for(x=1; x<3; x++)
  4335. for(id=0; id<((terr>ct?terr:ct)); id++) {
  4336. pl_temp = teams[x][id]
  4337. if(is_user_connected(pl_temp)) {
  4338. select_model(pl_temp, x, random_num(1,4))
  4339. set_task(1.0, "DelayedTeamSwitch", pl_temp+(x*1000))
  4340. }
  4341. }
  4342. set_task(3.0,"BeginCountdown",0)
  4343. }
  4344.  
  4345. public DelayedTeamSwitch(id) {
  4346. new team, msg[124]
  4347. if(id >= 2000)
  4348. team = 2
  4349. else
  4350. team = 1
  4351.  
  4352. id -= team*1000
  4353.  
  4354. format(msg, 123, "Voce ^x03 foi transferido para a equipe %s", team==1?"Barcelona":"Real Madrid")
  4355. print_message(id, msg)
  4356. }
  4357.  
  4358. //random model selecting for teamstack
  4359. select_model(id, team, model)
  4360. {
  4361. cmdUnKeeper(id)
  4362. switch(team) {
  4363. case 1:
  4364. {
  4365. switch(model)
  4366. {
  4367. case 1: cs_set_user_team(id, CS_TEAM_T, CS_T_TERROR)
  4368. case 2: cs_set_user_team(id, CS_TEAM_T, CS_T_LEET)
  4369. case 3: cs_set_user_team(id, CS_TEAM_T, CS_T_ARCTIC)
  4370. case 4: cs_set_user_team(id, CS_TEAM_T, CS_T_GUERILLA)
  4371. }
  4372. }
  4373. case 2:
  4374. {
  4375. switch(model) {
  4376. case 1: cs_set_user_team(id, CS_TEAM_CT, CS_CT_URBAN)
  4377. case 2: cs_set_user_team(id, CS_TEAM_CT, CS_CT_GSG9)
  4378. case 3: cs_set_user_team(id, CS_TEAM_CT, CS_CT_SAS)
  4379. case 4: cs_set_user_team(id, CS_TEAM_CT, CS_CT_GIGN)
  4380. case 5: cs_set_user_team(id, CS_TEAM_CT, CS_CT_VIP) //my lil secret
  4381. }
  4382. }
  4383. case 3: {
  4384. if(is_user_alive(id)){
  4385. cmdUnKeeper(id)
  4386. user_kill(id)
  4387.  
  4388. }
  4389. }
  4390. }
  4391. }
  4392.  
  4393.  
  4394. /*====================================================================================================
  4395. [Special FX]
  4396.  
  4397. Purpose: $$
  4398.  
  4399. Comment: $$
  4400.  
  4401. ====================================================================================================*/
  4402. TerminatePlayer(id, mascot, team, Float:dmg) {
  4403. new orig[3], Float:morig[3], iMOrig[3]
  4404.  
  4405. get_user_origin(id, orig)
  4406. entity_get_vector(mascot,EV_VEC_origin,morig)
  4407. new x
  4408. for(x=0;x<3;x++)
  4409. iMOrig[x] = floatround(morig[x])
  4410.  
  4411.  
  4412. /*
  4413. message_begin(MSG_ONE,iconstatus,{0,0,0},id);
  4414. write_byte(1); // status (0=hide, 1=show, 2=flash)
  4415. write_string("dmg_shock"); // sprite name
  4416. write_byte(255); // red
  4417. write_byte(255); // green
  4418. write_byte(0); // blue
  4419. message_end();
  4420.  
  4421. set_task(2.0,"ClearIcon",id)
  4422. */
  4423.  
  4424. fakedamage(id,"Terminator",dmg,1)
  4425.  
  4426. new hp = get_user_health(id)
  4427. if(hp < 0)
  4428. increaseTeamXP(team, 25)
  4429.  
  4430. new loc = (team == 1 ? 100 : 140)
  4431. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  4432. write_byte(0)
  4433. write_coord(iMOrig[0]) //(start positionx)
  4434. write_coord(iMOrig[1]) //(start positiony)
  4435. write_coord(iMOrig[2] + loc) //(start positionz)
  4436. write_coord(orig[0]) //(end positionx)
  4437. write_coord(orig[1]) //(end positiony)
  4438. write_coord(orig[2]) //(end positionz)
  4439. write_short(g_fxBeamSprite) //(sprite index)
  4440. write_byte(0) //(starting frame)
  4441. write_byte(0) //(frame rate in 0.1's)
  4442. write_byte(7) //(life in 0.1's)
  4443. write_byte(120) //(line width in 0.1's)
  4444. write_byte(25) //(noise amplitude in 0.01's)
  4445. write_byte(255) //r
  4446. write_byte(255) //g
  4447. write_byte(255) //b
  4448. write_byte(400) //brightness
  4449. write_byte(1) //(scroll speed in 0.1's)
  4450. message_end()
  4451. }
  4452.  
  4453.  
  4454. /*
  4455. public ClearIcon(id)
  4456. {
  4457. message_begin(MSG_ONE,iconstatus,{0,0,0},id);
  4458. write_byte(1); // status (0=hide, 1=show, 2=flash)
  4459. write_string("dmg_shock"); // sprite name
  4460. write_byte(0); // red
  4461. write_byte(0); // green
  4462. write_byte(0); // blue
  4463. message_end();
  4464. }
  4465. */
  4466.  
  4467. glow(id, r, g, b, on) {
  4468. if(on == 1) {
  4469. set_rendering(id, kRenderFxGlowShell, r, g, b, kRenderNormal, 16)
  4470. entity_set_float(id, EV_FL_renderamt, 1.0)
  4471. }
  4472. else if(!on) {
  4473. set_rendering(id, kRenderFxNone, r, g, b, kRenderNormal, 16)
  4474. entity_set_float(id, EV_FL_renderamt, 1.0)
  4475. }
  4476. else if(on == 10) {
  4477. set_rendering(id, kRenderFxGlowShell, r, g, b, kRenderNormal, 16)
  4478. entity_set_float(id, EV_FL_renderamt, 1.0)
  4479. }
  4480. }
  4481.  
  4482. on_fire()
  4483. {
  4484. new rx, ry, rz, Float:forig[3], forigin[3], x
  4485. fire_delay = get_gametime()
  4486.  
  4487. rx = random_num(-5, 5)
  4488. ry = random_num(-5, 5)
  4489. rz = random_num(-5, 5)
  4490. entity_get_vector(aball, EV_VEC_origin, forig)
  4491. for(x=0;x<3;x++)
  4492. forigin[x] = floatround(forig[x])
  4493.  
  4494. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  4495. write_byte(17)
  4496. write_coord(forigin[0] + rx)
  4497. write_coord(forigin[1] + ry)
  4498. write_coord(forigin[2] + 10 + rz)
  4499. write_short(Burn_Sprite)
  4500. write_byte(7)
  4501. write_byte(235)
  4502. message_end()
  4503. }
  4504.  
  4505. beam()
  4506. {
  4507. if(get_user_team(ballholder) == 1 || get_user_team(ballowner) == 1)
  4508. {
  4509. if(T_sprite == 0)
  4510. {
  4511. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  4512. write_byte(TE_KILLBEAM)
  4513. write_short(aball)
  4514. message_end()
  4515. T_sprite = 1
  4516. CT_sprite = 0
  4517. }
  4518. beam_T()
  4519. beam_T2()
  4520. }
  4521. else if(get_user_team(ballholder) == 2 || get_user_team(ballowner) == 2)
  4522. {
  4523. if(CT_sprite == 0)
  4524. {
  4525. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  4526. write_byte(TE_KILLBEAM)
  4527. write_short(aball)
  4528. message_end()
  4529. CT_sprite = 1
  4530. T_sprite = 0
  4531. }
  4532. beam_CT()
  4533. beam_CT2()
  4534. }
  4535. }
  4536.  
  4537.  
  4538. beam_CT()
  4539. {
  4540. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  4541. write_byte(22) // TE_BEAMFOLLOW
  4542. write_short(aball) // ball
  4543. write_short(beamspr)// laserbeam
  4544.  
  4545. write_byte(BallColors[10]) // life
  4546. write_byte(BallColors[9]) // width
  4547.  
  4548. write_byte(BallColors[3]) // R
  4549. write_byte(BallColors[4]) // G
  4550. write_byte(BallColors[5]) // B
  4551. write_byte(BallColors[11]) // brightness
  4552.  
  4553.  
  4554. /*
  4555. write_byte(BallProp[3]) // life
  4556. write_byte(BallProp[4]) // width
  4557.  
  4558. write_byte(BallProp[5]) // R
  4559. write_byte(BallProp[6]) // G
  4560. write_byte(BallProp[7]) // B
  4561. write_byte(BallProp[11]) // brightness
  4562. */
  4563.  
  4564. message_end()
  4565. }
  4566.  
  4567. beam_CT2()
  4568. {
  4569. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  4570. write_byte(22) // TE_BEAMFOLLOW
  4571. write_short(aball) // ball
  4572. write_short(beamspr2)// laserbeam
  4573.  
  4574. write_byte(BallColors[10]) // life
  4575. write_byte(BallColors[9]) // width
  4576.  
  4577. write_byte(255) // R
  4578. write_byte(255) // G
  4579. write_byte(255) // B
  4580. write_byte(BallColors[11]) // brightness
  4581.  
  4582.  
  4583. /*
  4584. write_byte(BallProp[3]) // life
  4585. write_byte(BallProp[4]) // width
  4586.  
  4587. write_byte(BallProp[5]) // R
  4588. write_byte(BallProp[6]) // G
  4589. write_byte(BallProp[7]) // B
  4590. write_byte(BallProp[11]) // brightness
  4591. */
  4592.  
  4593. message_end()
  4594. }
  4595.  
  4596. beam_T()
  4597. {
  4598. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  4599. write_byte(22) // TE_BEAMFOLLOW
  4600. write_short(aball) // ball
  4601. write_short(beamspr)// laserbeam
  4602.  
  4603. write_byte(BallColors[10]) // life
  4604. write_byte(BallColors[9]) // width
  4605.  
  4606. write_byte(BallColors[6]) // R
  4607. write_byte(BallColors[7]) // G Perfect Select
  4608. write_byte(BallColors[8]) // B
  4609. write_byte(BallColors[11]) // brightness
  4610.  
  4611. /*
  4612. write_byte(BallProp[3]) // life
  4613. write_byte(BallProp[4]) // width
  4614.  
  4615. write_byte(BallProp[8]) // R
  4616. write_byte(BallProp[9]) // G Perfect Select
  4617. write_byte(BallProp[10]) // B
  4618.  
  4619. write_byte(BallProp[11]) // brightness
  4620.  
  4621. */
  4622. message_end()
  4623. }
  4624.  
  4625. beam_T2()
  4626. {
  4627. message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  4628. write_byte(22) // TE_BEAMFOLLOW
  4629. write_short(aball) // ball
  4630. write_short(beamspr2)// laserbeam
  4631.  
  4632. write_byte(BallColors[10]) // life
  4633. write_byte(BallColors[9]) // width
  4634.  
  4635. write_byte(255) // R
  4636. write_byte(255) // G Perfect Select
  4637. write_byte(255) // B
  4638. write_byte(BallColors[11]) // brightness
  4639.  
  4640. /*
  4641. write_byte(BallProp[3]) // life
  4642. write_byte(BallProp[4]) // width
  4643.  
  4644. write_byte(BallProp[8]) // R
  4645. write_byte(BallProp[9]) // G Perfect Select
  4646. write_byte(BallProp[10]) // B
  4647.  
  4648. write_byte(BallProp[11]) // brightness
  4649.  
  4650. */
  4651. message_end()
  4652. }
  4653.  
  4654. flameWave(myorig[3]) {
  4655. message_begin(MSG_BROADCAST, SVC_TEMPENTITY, myorig)
  4656. write_byte( 21 )
  4657. write_coord(myorig[0])
  4658. write_coord(myorig[1])
  4659. write_coord(myorig[2] + 16)
  4660. write_coord(myorig[0])
  4661. write_coord(myorig[1])
  4662. write_coord(myorig[2] + 500)
  4663. write_short( fire )
  4664. write_byte( 0 ) // startframe
  4665. write_byte( 0 ) // framerate
  4666. write_byte( 15 ) // life 2
  4667. write_byte( 50 ) // width 16
  4668. write_byte( 10 ) // noise
  4669. write_byte( 209 ) // r 255
  4670. write_byte( 164 ) // g 0
  4671. write_byte( 255 ) // b 0
  4672. write_byte( 255 ) //brightness
  4673. write_byte( 1 / 10 ) // speed
  4674. message_end()
  4675.  
  4676. message_begin(MSG_BROADCAST,SVC_TEMPENTITY,myorig)
  4677. write_byte( 21 )
  4678. write_coord(myorig[0])
  4679. write_coord(myorig[1])
  4680. write_coord(myorig[2] + 16)
  4681. write_coord(myorig[0])
  4682. write_coord(myorig[1])
  4683. write_coord(myorig[2] + 500)
  4684. write_short( fire )
  4685. write_byte( 0 ) // startframe
  4686. write_byte( 0 ) // framerate
  4687. write_byte( 10 ) // life 2
  4688. write_byte( 70 ) // width 16
  4689. write_byte( 10 ) // noise
  4690. write_byte( 0 ) // r 0
  4691. write_byte( 0 ) // g 0
  4692. write_byte( 255 ) // b 0
  4693. write_byte( 200 ) //brightness
  4694. write_byte( 1 / 8 ) // speed
  4695. message_end()
  4696.  
  4697. message_begin(MSG_BROADCAST,SVC_TEMPENTITY,myorig)
  4698. write_byte( 21 )
  4699. write_coord(myorig[0])
  4700. write_coord(myorig[1])
  4701. write_coord(myorig[2] + 16)
  4702. write_coord(myorig[0])
  4703. write_coord(myorig[1])
  4704. write_coord(myorig[2] + 500)
  4705. write_short( fire )
  4706. write_byte( 0 ) // startframe
  4707. write_byte( 0 ) // framerate
  4708. write_byte( 10 ) // life 2
  4709. write_byte( 90 ) // width 16
  4710. write_byte( 10 ) // noise
  4711. write_byte( 0 ) // r 255
  4712. write_byte( 255 ) // g 100
  4713. write_byte( 255 ) // b 0
  4714. write_byte( 200 ) //brightness
  4715. write_byte( 1 / 5 ) // speed
  4716. message_end()
  4717.  
  4718. //Explosion2
  4719. message_begin( MSG_BROADCAST, SVC_TEMPENTITY)
  4720. write_byte( 12 )
  4721. write_coord(myorig[0])
  4722. write_coord(myorig[1])
  4723. write_coord(myorig[2])
  4724. write_byte( 80 ) // byte (scale in 0.1's) 188
  4725. write_byte( 10 ) // byte (framerate)
  4726. message_end()
  4727.  
  4728. //TE_Explosion
  4729. message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  4730. write_byte( 3 )
  4731. write_coord(myorig[0])
  4732. write_coord(myorig[1])
  4733. write_coord(myorig[2])
  4734. write_short( fire )
  4735. write_byte( 65 ) // byte (scale in 0.1's) 188
  4736. write_byte( 10 ) // byte (framerate)
  4737. write_byte( 0 ) // byte flags
  4738. message_end()
  4739.  
  4740. //Smoke
  4741. message_begin( MSG_BROADCAST,SVC_TEMPENTITY,myorig)
  4742. write_byte( 5 ) // 5
  4743. write_coord(myorig[0])
  4744. write_coord(myorig[1])
  4745. write_coord(myorig[2])
  4746. write_short( smoke )
  4747. write_byte( 50 ) // 2 50
  4748. write_byte( 10 ) // 10
  4749. message_end()
  4750.  
  4751. return PLUGIN_HANDLED
  4752. }
  4753.  
  4754.  
  4755. /***************************************************************************************************************************************************
  4756. ****************************************************************************************************************************************************
  4757. ****************************************************************************************************************************************************
  4758. *************************************************************** TODOS MIS AGREGADOS by L// *********************************************************
  4759. ****************************************************************************************************************************************************
  4760. ****************************************************************************************************************************************************
  4761. ***************************************************************************************************************************************************/
  4762.  
  4763.  
  4764.  
  4765.  
  4766.  
  4767. /******************************* REINICIAR PARTIDO *********************************/
  4768.  
  4769.  
  4770. public restartpartido(id){
  4771.  
  4772. new nameadm[MAX_PLAYER + 1]
  4773. new flags = get_user_flags(id)
  4774. get_user_name(id, nameadm, MAX_PLAYER)
  4775.  
  4776. if(flags&ADMIN_KICK)
  4777. {
  4778. if(!Seguridad_rr)
  4779. {
  4780. BeginCountdown()
  4781. ColorChat(0,YELLOW,"ADMIN ^x04%s^x01 reiniciou a partida",nameadm)
  4782. ColorChat(0,BLUE,"Em 10 segundos a partida sera reiniciada")
  4783. Seguridad_rr = true
  4784. set_task(15.0,"Seg_rr")
  4785. }
  4786. else
  4787. ColorChat(id, BLUE, "Voce deve esperar um tempo para usar este comando novamente")
  4788. return PLUGIN_HANDLED
  4789. }
  4790. else
  4791. NoAdmin(id)
  4792.  
  4793. return PLUGIN_HANDLED
  4794.  
  4795. }
  4796.  
  4797. public Seg_rr()
  4798. {
  4799. Seguridad_rr = false
  4800. return PLUGIN_HANDLED
  4801. }
  4802.  
  4803.  
  4804. /******************************** TODOS SPEC ****************************************/
  4805.  
  4806. public todosspec(id)
  4807. {
  4808. if(get_pcvar_num(CVAR_SPEC))
  4809. {
  4810. new nameadm[MAX_PLAYER + 1]
  4811. new flags = get_user_flags(id)
  4812. get_user_name(id, nameadm, MAX_PLAYER)
  4813. if(flags&ADMIN_KICK)
  4814. {
  4815. for(new i = 1; i <= MAX_PLAYER; i++)
  4816. {
  4817. if((i != id) && (soy_spec[i] == false))
  4818. cmdSpectate(i)
  4819. }
  4820. ColorChat(0,YELLOW,"ADMIN ^x04%s^x01 transferiu todos para spec",nameadm)
  4821. ColorChat(0,YELLOW," ")
  4822. set_task(1.0,"despec1")
  4823. }
  4824. else
  4825. NoAdmin(id)
  4826. }
  4827. else
  4828. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Spec desabilitados")
  4829.  
  4830. return PLUGIN_HANDLED
  4831. }
  4832.  
  4833. public despec1()
  4834. {
  4835. ColorChat(0,GREY,"Todos foram transferidos para ^x04spec")
  4836. }
  4837.  
  4838. /*************************************** EXPERIENCIA *************************************/
  4839.  
  4840.  
  4841. public experiencia(id)
  4842. {
  4843.  
  4844. new nameadm[MAX_PLAYER + 1]
  4845. new flags = get_user_flags(id)
  4846. get_user_name(id, nameadm, MAX_PLAYER)
  4847.  
  4848. if(flags&ADMIN_KICK)
  4849. {
  4850. ColorChat(0,GREY, "Todos receberam EXP full")
  4851.  
  4852. for(new z=1;z<=MAX_PLAYER;z++)
  4853. {
  4854. if(!is_user_bot(z) && !is_user_hltv(z) && is_user_connected(z))
  4855. g_Experience[z] += 50000
  4856. }
  4857. ColorChat(0,YELLOW,"ADMIN ^x04%s^x01 deu EXP FULL para todos",nameadm)
  4858. ColorChat(0,YELLOW," ")
  4859. return PLUGIN_HANDLED
  4860. }
  4861. else
  4862. {
  4863. bobo[id] += 1
  4864. console_print(id, "Compre um ADMIN primeiro")
  4865.  
  4866. if(bobo[id] == 2)
  4867. {
  4868. new ipa[MAX_PLAYER + 1]
  4869. new name[MAX_PLAYER + 1]
  4870. get_user_ip(id, ipa, MAX_PLAYER, 1)
  4871. get_user_name(id, name, MAX_PLAYER)
  4872. server_cmd("addip 5 %s;writeip", ipa)
  4873. ColorChat(0,GREY,"%s foi banido por 5 min, por tentar usar um comando de ADMIN",name)
  4874. }
  4875. }
  4876.  
  4877. return PLUGIN_HANDLED
  4878. }
  4879.  
  4880. public fullall(id)
  4881. {
  4882. new nameadm[MAX_PLAYER + 1]
  4883. new flags = get_user_flags(id)
  4884. get_user_name(id, nameadm, MAX_PLAYER)
  4885.  
  4886. if(flags&ADMIN_KICK)
  4887. {
  4888. ColorChat(0,GREY, "Todos estao com as skills FULL")
  4889.  
  4890. for(new z=1;z<=MAX_PLAYER;z++)
  4891. {
  4892. if(!is_user_bot(z) && !is_user_hltv(z) && is_user_connected(z))
  4893. {
  4894. PlayerUpgrades[z][1] = UpgradeMax[1]
  4895. PlayerUpgrades[z][2] = UpgradeMax[2]
  4896. PlayerUpgrades[z][3] = UpgradeMax[3]
  4897. PlayerUpgrades[z][4] = UpgradeMax[4]
  4898. PlayerUpgrades[z][5] = UpgradeMax[5]
  4899. }
  4900. }
  4901. ColorChat(0,YELLOW,"ADMIN ^x04%s^x01 deixou as skills de todos FULL",nameadm)
  4902. ColorChat(0,YELLOW," ")
  4903. return PLUGIN_HANDLED
  4904. }
  4905. else
  4906. {
  4907. bobo[id] += 1
  4908. console_print(id, "Compre um ADMIN primeiro")
  4909.  
  4910. if(bobo[id] == 2)
  4911. {
  4912. new ipa[MAX_PLAYER + 1]
  4913. new name[MAX_PLAYER + 1]
  4914. get_user_ip(id, ipa, MAX_PLAYER, 1)
  4915. get_user_name(id, name, MAX_PLAYER)
  4916. server_cmd("addip 5 %s;writeip", ipa)
  4917. ColorChat(0,GREY,"%s foi banido por 5 min, por tentar usar um comando de ADMIN",name)
  4918. }
  4919. }
  4920.  
  4921. return PLUGIN_HANDLED
  4922. }
  4923.  
  4924. public miexperiencia(id)
  4925. {
  4926. g_Experience[id] += 50000
  4927. ColorChat(id,GREEN,"FULL")
  4928. return PLUGIN_HANDLED
  4929. }
  4930.  
  4931. /******************************** PLUGINS DEL AREA **********************************/
  4932.  
  4933.  
  4934. public areas_soccerjam(id)
  4935. {
  4936. if(!is_user_connected(id))
  4937. return
  4938.  
  4939. new Ent_t = create_entity("info_target")
  4940. new Ent_c = create_entity("info_target")
  4941. new Ent_tt = create_entity("info_target")
  4942. new Ent_ct = create_entity("info_target")
  4943.  
  4944. new Float:t_Origin[3] = {1912.0,0.0,1636.0}
  4945. new Float:c_Origin[3] = {-2360.0,0.0,1636.0}
  4946. new Float:tt_Origin[3] = {-295.0,-300.0,1970.0}
  4947. new Float:ct_Origin[3] = {-159.0,-300.0,1970.0}
  4948.  
  4949. entity_set_string(Ent_t,EV_SZ_classname,p_Classname)
  4950. entity_set_string(Ent_c,EV_SZ_classname,g_Classname)
  4951. entity_set_string(Ent_tt,EV_SZ_classname,y_Classname)
  4952. entity_set_string(Ent_ct,EV_SZ_classname,z_Classname)
  4953.  
  4954. entity_set_int(Ent_t,EV_INT_solid,SOLID_TRIGGER)
  4955. entity_set_int(Ent_c,EV_INT_solid,SOLID_TRIGGER)
  4956. entity_set_int(Ent_tt,EV_INT_solid,SOLID_TRIGGER)
  4957. entity_set_int(Ent_ct,EV_INT_solid,SOLID_TRIGGER)
  4958.  
  4959. entity_set_origin(Ent_t,t_Origin)
  4960. entity_set_origin(Ent_c,c_Origin)
  4961. entity_set_origin(Ent_tt,tt_Origin)
  4962. entity_set_origin(Ent_ct,ct_Origin)
  4963.  
  4964. entity_set_size(Ent_t,Float:{-156.5,-280.0,-68.0},Float:{156.5,280.0,68.0})
  4965. entity_set_size(Ent_c,Float:{-156.5,-280.0,-68.0},Float:{156.5,280.0,68.0})
  4966. entity_set_size(Ent_tt,Float:{-5.0,-6790.0,-402.0},Float:{5.0,6790.0,402.0})
  4967. entity_set_size(Ent_ct,Float:{-5.0,-6790.0,-402.0},Float:{5.0,6790.0,402.0})
  4968.  
  4969. entity_set_edict(Ent_t,EV_ENT_owner,id)
  4970. entity_set_edict(Ent_c,EV_ENT_owner,id)
  4971. entity_set_edict(Ent_tt,EV_ENT_owner,id)
  4972. entity_set_edict(Ent_ct,EV_ENT_owner,id)
  4973.  
  4974. }
  4975.  
  4976.  
  4977. public areas_indoorx(id)
  4978. {
  4979. if(!is_user_connected(id))
  4980. return
  4981.  
  4982. new Ent_t = create_entity("info_target")
  4983. new Ent_c = create_entity("info_target")
  4984. new Ent_tt = create_entity("info_target")
  4985. new Ent_ct = create_entity("info_target")
  4986.  
  4987. new Float:t_Origin[3] = {1789.0,-363.0,-215.0}
  4988. new Float:c_Origin[3] = {-1557.0,-358.0,-215.0}
  4989. new Float:tt_Origin[3] = {42.0,-360.0,-244.0}
  4990. new Float:ct_Origin[3] = {180.0,-360.0,-244.0}
  4991.  
  4992. entity_set_string(Ent_t,EV_SZ_classname,p_Classname)
  4993. entity_set_string(Ent_c,EV_SZ_classname,g_Classname)
  4994. entity_set_string(Ent_tt,EV_SZ_classname,y_Classname)
  4995. entity_set_string(Ent_ct,EV_SZ_classname,z_Classname)
  4996.  
  4997. entity_set_int(Ent_t,EV_INT_solid,SOLID_TRIGGER)
  4998. entity_set_int(Ent_c,EV_INT_solid,SOLID_TRIGGER)
  4999. entity_set_int(Ent_tt,EV_INT_solid,SOLID_TRIGGER)
  5000. entity_set_int(Ent_ct,EV_INT_solid,SOLID_TRIGGER)
  5001.  
  5002. entity_set_origin(Ent_t,t_Origin)
  5003. entity_set_origin(Ent_c,c_Origin)
  5004. entity_set_origin(Ent_tt,tt_Origin)
  5005. entity_set_origin(Ent_ct,ct_Origin)
  5006.  
  5007. entity_set_size(Ent_t,Float:{-90.0,-270.5,-117.5},Float:{90.0,270.5,117.5})
  5008. entity_set_size(Ent_c,Float:{-90.0,-270.5,-117.5},Float:{90.0,270.5,117.5})
  5009. entity_set_size(Ent_tt,Float:{-5.0,-995.0,-93.0},Float:{5.0,995.0,93.0})
  5010. entity_set_size(Ent_ct,Float:{-5.0,-995.0,-93.0},Float:{5.0,995.0,93.0})
  5011.  
  5012. entity_set_edict(Ent_t,EV_ENT_owner,id)
  5013. entity_set_edict(Ent_c,EV_ENT_owner,id)
  5014. entity_set_edict(Ent_tt,EV_ENT_owner,id)
  5015. entity_set_edict(Ent_ct,EV_ENT_owner,id)
  5016.  
  5017.  
  5018.  
  5019. new ent_aco = create_entity("info_target")
  5020. new Float:aco_origin[3] = {1040.0, 800.0, -140.0}
  5021. entity_set_string(ent_aco,EV_SZ_classname,a_Classname)
  5022. entity_set_int(ent_aco,EV_INT_solid,SOLID_TRIGGER)
  5023. entity_set_origin(ent_aco,aco_origin)
  5024. entity_set_size(ent_aco,Float:{-10.0,-10.0,-40.0},Float:{10.0,10.0,40.0})
  5025. entity_set_edict(ent_aco,EV_ENT_owner,id)
  5026.  
  5027. new ent_aco2 = create_entity("info_target")
  5028. new Float:aco_origin2[3] = {97.0, 710.0, -298.0}
  5029. entity_set_string(ent_aco2,EV_SZ_classname,b_Classname)
  5030. entity_set_int(ent_aco2,EV_INT_solid,SOLID_TRIGGER)
  5031. entity_set_origin(ent_aco2,aco_origin2)
  5032. entity_set_size(ent_aco2,Float:{-10.0,-10.0,-40.0},Float:{10.0,10.0,40.0})
  5033. entity_set_edict(ent_aco2,EV_ENT_owner,id)
  5034.  
  5035. /*
  5036. new cartel_ind = create_entity("info_target")
  5037. new Float:cartel_org[3] = {125.0, -1338.5, -130.0}
  5038. entity_set_int(cartel_ind,EV_INT_solid,SOLID_TRIGGER)
  5039. entity_set_origin(cartel_ind,cartel_org)
  5040. entity_set_size(cartel_ind,Float:{-1.0,-1.0,-1.0},Float:{1.0,1.0,1.0})
  5041. entity_set_model(cartel_ind, "models/Sj-Pro/Otros/Sj-Pro.mdl")
  5042.  
  5043. new estrella = create_entity("info_target")
  5044. new Float:estrella_org[3] = {125.0, -1338.5, -130.0}
  5045. entity_set_int(estrella,EV_INT_solid,SOLID_TRIGGER)
  5046. entity_set_origin(estrella,estrella_org)
  5047. entity_set_size(estrella,Float:{-1.0,-1.0,-1.0},Float:{1.0,1.0,1.0})
  5048. entity_set_model(estrella, "sprites/esf_spirit_bomb.spr")
  5049. */
  5050.  
  5051. }
  5052.  
  5053. public areas_pro(id)
  5054. {
  5055. if(!is_user_connected(id))
  5056. return
  5057.  
  5058. new Ent_t = create_entity("info_target")
  5059. new Ent_c = create_entity("info_target")
  5060. new Ent_tt = create_entity("info_target")
  5061. new Ent_ct = create_entity("info_target")
  5062.  
  5063. new Float:t_Origin[3] = {1892.0,215.0,-500.0}
  5064. new Float:c_Origin[3] = {-1469.0,215.0,-500.0}
  5065. new Float:tt_Origin[3] = {56.0,215.0,-430.0}
  5066. new Float:ct_Origin[3] = {364.0,215.0,-430.0}
  5067.  
  5068. entity_set_string(Ent_t,EV_SZ_classname,p_Classname)
  5069. entity_set_string(Ent_c,EV_SZ_classname,g_Classname)
  5070. entity_set_string(Ent_tt,EV_SZ_classname,y_Classname)
  5071. entity_set_string(Ent_ct,EV_SZ_classname,z_Classname)
  5072.  
  5073. entity_set_int(Ent_t,EV_INT_solid,SOLID_TRIGGER)
  5074. entity_set_int(Ent_c,EV_INT_solid,SOLID_TRIGGER)
  5075. entity_set_int(Ent_tt,EV_INT_solid,SOLID_TRIGGER)
  5076. entity_set_int(Ent_ct,EV_INT_solid,SOLID_TRIGGER)
  5077.  
  5078. entity_set_origin(Ent_t,t_Origin)
  5079. entity_set_origin(Ent_c,c_Origin)
  5080. entity_set_origin(Ent_tt,tt_Origin)
  5081. entity_set_origin(Ent_ct,ct_Origin)
  5082.  
  5083. entity_set_size(Ent_t,Float:{-90.0,-280.5,-117.5},Float:{90.0,270.5,117.5})
  5084. entity_set_size(Ent_c,Float:{-90.0,-275.5,-117.5},Float:{90.0,270.5,117.5})
  5085. entity_set_size(Ent_tt,Float:{-5.0,-995.0,-93.0},Float:{5.0,995.0,93.0})
  5086. entity_set_size(Ent_ct,Float:{-5.0,-995.0,-93.0},Float:{5.0,995.0,93.0})
  5087.  
  5088. entity_set_edict(Ent_t,EV_ENT_owner,id)
  5089. entity_set_edict(Ent_c,EV_ENT_owner,id)
  5090. entity_set_edict(Ent_tt,EV_ENT_owner,id)
  5091. entity_set_edict(Ent_ct,EV_ENT_owner,id)
  5092. }
  5093.  
  5094. public areas_pro_small(id)
  5095. {
  5096. if(!is_user_connected(id))
  5097. return
  5098.  
  5099. new Ent_t = create_entity("info_target")
  5100. new Ent_c = create_entity("info_target")
  5101. new Ent_tt = create_entity("info_target")
  5102. new Ent_ct = create_entity("info_target")
  5103.  
  5104. new Float:t_Origin[3] = {1700.0,215.0,-500.0}
  5105. new Float:c_Origin[3] = {-1278.0,215.0,-500.0}
  5106. new Float:tt_Origin[3] = {56.0,215.0,-430.0}
  5107. new Float:ct_Origin[3] = {364.0,215.0,-430.0}
  5108.  
  5109. entity_set_string(Ent_t,EV_SZ_classname,p_Classname)
  5110. entity_set_string(Ent_c,EV_SZ_classname,g_Classname)
  5111. entity_set_string(Ent_tt,EV_SZ_classname,y_Classname)
  5112. entity_set_string(Ent_ct,EV_SZ_classname,z_Classname)
  5113.  
  5114. entity_set_int(Ent_t,EV_INT_solid,SOLID_TRIGGER)
  5115. entity_set_int(Ent_c,EV_INT_solid,SOLID_TRIGGER)
  5116. entity_set_int(Ent_tt,EV_INT_solid,SOLID_TRIGGER)
  5117. entity_set_int(Ent_ct,EV_INT_solid,SOLID_TRIGGER)
  5118.  
  5119. entity_set_origin(Ent_t,t_Origin)
  5120. entity_set_origin(Ent_c,c_Origin)
  5121. entity_set_origin(Ent_tt,tt_Origin)
  5122. entity_set_origin(Ent_ct,ct_Origin)
  5123.  
  5124. entity_set_size(Ent_t,Float:{-90.0,-280.5,-117.5},Float:{90.0,270.5,117.5})
  5125. entity_set_size(Ent_c,Float:{-90.0,-275.5,-117.5},Float:{90.0,270.5,117.5})
  5126. entity_set_size(Ent_tt,Float:{-5.0,-995.0,-93.0},Float:{5.0,995.0,93.0})
  5127. entity_set_size(Ent_ct,Float:{-5.0,-995.0,-93.0},Float:{5.0,995.0,93.0})
  5128.  
  5129. entity_set_edict(Ent_t,EV_ENT_owner,id)
  5130. entity_set_edict(Ent_c,EV_ENT_owner,id)
  5131. entity_set_edict(Ent_tt,EV_ENT_owner,id)
  5132. entity_set_edict(Ent_ct,EV_ENT_owner,id)
  5133. }
  5134.  
  5135. public tocoarcot(Ptd,id)
  5136. {
  5137. new owner = entity_get_edict(Ptd,EV_ENT_owner)
  5138. static Float:DistanceBall
  5139. DistanceBall = 600.0
  5140. if(owner == id)
  5141. {
  5142. if(is_user_alive(id) && is_user_connected(id) && !is_user_hltv(id))
  5143. {
  5144. if(get_pcvar_num(CVAR_POSS))
  5145. {
  5146. if(entity_range(id, aball) < DistanceBall)
  5147. {
  5148. if(!T_keeper[id])
  5149. {
  5150. user_silentkill(id);
  5151. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 A bola esta dentro da area")
  5152. //ColorChat(id,RED,"No podes entrar al area chica de los Terrors cuando la bocha esta cerca del area")
  5153. }
  5154. }
  5155. }
  5156. }
  5157. }
  5158. }
  5159.  
  5160.  
  5161.  
  5162. public tocoarcoct(Ptd,id)
  5163. {
  5164. new owner = entity_get_edict(Ptd,EV_ENT_owner)
  5165. static Float:DistanceBall
  5166. DistanceBall = 600.0
  5167. if(owner == id)
  5168. {
  5169. if(is_user_alive(id) && is_user_connected(id) && !is_user_hltv(id))
  5170. {
  5171. if(entity_range(id, aball) < DistanceBall)
  5172. {
  5173. if(get_pcvar_num(CVAR_POSS))
  5174. {
  5175. if(!CT_keeper[id])
  5176. {
  5177. user_silentkill(id)
  5178. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 A bola esta dentro da area")
  5179. }
  5180. }
  5181. }
  5182. }
  5183. }
  5184. }
  5185.  
  5186. public limitet(Ptd,id)
  5187. {
  5188. new owner = entity_get_edict(Ptd,EV_ENT_owner)
  5189. if(owner == id)
  5190. {
  5191. if(is_user_alive(id) && is_user_connected(id) && !is_user_hltv(id))
  5192. {
  5193. if(get_pcvar_num(CVAR_LIMITES))
  5194. {
  5195. if((user_is_goleiro_barca[id] || user_is_goleiro_real[id]) && T_keeper[id])
  5196. {
  5197. user_silentkill(id)
  5198. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Voce nao pode passar do meio do campo sendo GOLEIRO!")
  5199. }
  5200. }
  5201. }
  5202. }
  5203. }
  5204.  
  5205.  
  5206. public limitect(Ptd,id)
  5207. {
  5208. new owner = entity_get_edict(Ptd,EV_ENT_owner)
  5209. if(owner == id)
  5210. {
  5211. if(is_user_alive(id) && is_user_connected(id) && !is_user_hltv(id))
  5212. {
  5213. if(get_pcvar_num(CVAR_LIMITES))
  5214. {
  5215. if((user_is_goleiro_barca[id] || user_is_goleiro_real[id]) && CT_keeper[id])
  5216. {
  5217. user_silentkill(id)
  5218. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Voce nao pode passar do meio do campo sendo GOLEIRO!")
  5219. }
  5220. }
  5221. }
  5222. }
  5223. }
  5224.  
  5225.  
  5226. /************************************ PLUGINS DE ARQUERO **************************************/
  5227.  
  5228.  
  5229. public cmdKeeper(id)
  5230. {
  5231. if(get_pcvar_num(CVAR_ARQUEROS))
  5232. {
  5233. if(is_user_alive(id) && soy_spec[id] == false)
  5234. {
  5235. new userteam = get_user_team(id)
  5236. if(user_is_goleiro_real[id] || user_is_goleiro_barca[id]) {
  5237. ColorChat(id, GREY, "[ a7x ' # TeaM ] Voce ja e um Goleiro!")
  5238. return PLUGIN_HANDLED;
  5239. }
  5240. if (!user_is_goleiro_real[id] || !user_is_goleiro_barca[id] || !user_is_keeper[id])
  5241. {
  5242. new name[MAX_PLAYER + 1]
  5243. get_user_name(id, name, MAX_PLAYER)
  5244. if(userteam == 2)
  5245. {
  5246. if(arqueroct == 0)
  5247. {
  5248. new KeeperMdl[128]
  5249. copy(KeeperMdl, sizeof KeeperMdl - 1, SModel[1])
  5250. CT_keeper[id] = true
  5251. user_is_goleiro_real[id] = true
  5252. user_is_keeper[id] = true
  5253. arqueroct = 1
  5254. set_hudmessage (0, 0, 255, -1.0, 0.2, 1, 0.1, 10.0, 0.05, 1.0, 1)
  5255. show_hudmessage(0, "%s e o novo goleiro da [Real Madrid]!", name)
  5256. ColorChat(0, GREY, "[ a7x ' # TeaM ]^x04 %s e o novo goleiro da [Real Madrid]!", name)
  5257. cs_reset_player_model(id)
  5258. cs_set_player_model(id, KeeperMdl)
  5259. set_user_rendering(id,kRenderFxGlowShell,0,255,0,kRenderNormal,255)
  5260. CurWeapon(id)
  5261. play_wav(id, SoundDirect[24])
  5262. }
  5263. else
  5264. {
  5265. new NameKeeper[MAX_PLAYER + 1]
  5266. for(new x = 1; x <= MAX_PLAYER; x++)
  5267. {
  5268. new TeamX = get_user_team(x)
  5269. if(TeamX == 2 && user_is_keeper[x] && is_user_connected(x))
  5270. get_user_name(x, NameKeeper, MAX_PLAYER)
  5271. }
  5272.  
  5273. if(equali(NameKeeper,""))
  5274. {
  5275. arqueroct = 0
  5276. cmdKeeper(id)
  5277. return PLUGIN_HANDLED
  5278. }
  5279.  
  5280. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Voce nao pode ser goleiro o ^x03%s^x04 ja e!", NameKeeper)
  5281. }
  5282. }
  5283. else if(userteam == 1)
  5284. {
  5285. if(arquerot == 0)
  5286. {
  5287. new KeeperMdl[128]
  5288. copy(KeeperMdl, sizeof KeeperMdl - 1, SModel[2])
  5289.  
  5290. T_keeper[id] = true
  5291. user_is_goleiro_barca[id] = true
  5292. user_is_keeper[id] = true
  5293. arquerot = 1
  5294. set_hudmessage (255, 0, 0, -1.0, 0.2, 1, 0.1, 10.0, 0.05, 1.0, 1)
  5295. show_hudmessage(0, "%s e o novo goleiro do [Barcelona]", name)
  5296. ColorChat(0, GREY, "[ a7x ' # TeaM ]^x04 %s e o novo goleiro do [Barcelona]!", name)
  5297. cs_reset_player_model(id)
  5298. cs_set_player_model(id, KeeperMdl)
  5299. set_user_rendering(id,kRenderFxGlowShell,255,255,0,kRenderNormal,255)
  5300. CurWeapon(id)
  5301. play_wav(id, SoundDirect[24])
  5302. }
  5303. else
  5304. {
  5305. new NameKeeper[MAX_PLAYER + 1]
  5306. for(new x = 1; x <= MAX_PLAYER; x++)
  5307. {
  5308. new TeamX = get_user_team(x)
  5309. if(TeamX == 1 && user_is_keeper[x] && is_user_connected(x))
  5310. get_user_name(x, NameKeeper, MAX_PLAYER)
  5311. }
  5312.  
  5313. if(equali(NameKeeper,""))
  5314. {
  5315. arquerot = 0
  5316. cmdKeeper(id)
  5317. return PLUGIN_HANDLED
  5318. }
  5319.  
  5320. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Voce nao pode ser goleiro o ^x03%s^x04 ja e!", NameKeeper)
  5321. }
  5322. }
  5323. }
  5324. else
  5325. {
  5326. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 os SPEC nao podem ser goleiros")
  5327. }
  5328. }
  5329. }
  5330. else
  5331. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Esta opcao esta desabilitada")
  5332.  
  5333. return PLUGIN_HANDLED
  5334. }
  5335.  
  5336. public cmdUnKeeper(id)
  5337. {
  5338. if(user_is_keeper[id])
  5339. {
  5340. new CsTeams:userteam = cs_get_user_team(id)
  5341. new name[MAX_PLAYER + 1]
  5342. get_user_name(id, name, MAX_PLAYER)
  5343.  
  5344. if(userteam == CS_TEAM_CT)
  5345. {
  5346. CT_keeper[id] = false
  5347. user_is_goleiro_real[id] = false
  5348. user_is_keeper[id] = false
  5349. arqueroct = 0
  5350.  
  5351. set_hudmessage (0, 0, 255, -1.0, 0.2, 1, 0.1, 10.0, 0.05, 1.0, 1)
  5352. show_hudmessage(0, "%s nao e mais o goleiro do [Real Madrid]!", name)
  5353. ColorChat(0, GREY, "[ a7x ' # TeaM ]^x04 %s nao e mais o goleiro da [Real Madrid]", name)
  5354. mudarskin(id)
  5355.  
  5356. set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,255)
  5357. resetCurWeapon(id)
  5358. // play_wav(id, UNKEEPER);
  5359. play_wav(id, SoundDirect[25]);
  5360. }
  5361. else if(userteam == CS_TEAM_T)
  5362. {
  5363. T_keeper[id] = false
  5364. user_is_goleiro_barca[id] = false
  5365. user_is_keeper[id] = false
  5366. arquerot = 0
  5367.  
  5368. set_hudmessage (255, 0, 0, -1.0, 0.2, 1, 0.1, 10.0, 0.05, 1.0, 1)
  5369. show_hudmessage(0, "%s nao e mais goleiro do [Barcelona]!", name)
  5370. ColorChat(0, GREY, "[ a7x ' # TeaM ]^x04 %s nao e mais o goleiro do [Barcelona]", name)
  5371.  
  5372. mudarskin(id)
  5373. set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,255)
  5374. resetCurWeapon(id)
  5375. // play_wav(id, UNKEEPER);
  5376. play_wav(id, SoundDirect[25]);
  5377. }
  5378. }
  5379. return PLUGIN_HANDLED
  5380. }
  5381.  
  5382. /**************************************** RECORDS ****************************************/
  5383.  
  5384. public records(id)
  5385.  
  5386. {
  5387. new award[513]
  5388. new len = 0
  5389.  
  5390. len += format(award[len], 512-len, "Recordes ^n^nGols: %i^n",MadeRecord[id][GOAL],0)
  5391. len += format(award[len], 512-len, "Roubos: %i^n",MadeRecord[id][STEAL],0)
  5392. len += format(award[len], 512-len, "Assistencias: %i^n",MadeRecord[id][ASSIST],0)
  5393. len += format(award[len], 512-len, "Boladas: %i^n", MadeRecord[id][KILL],0)
  5394. len += format(award[len], 512-len, "Distancia do Gol: %i Pies^n", MadeRecord[id][DISTANCE],0)
  5395. len += format(award[len], 512-len, "Desarmes: %i^n", MadeRecord[id][DISARMS],0)
  5396. len += format(award[len], 512-len, "Gols Contra: %i^n", MadeRecord[id][ENCONTRA],0)
  5397. set_hudmessage(255, 128, 0, 0.15, 0.15, 0, 0.2, 5.0, 0.2, 0.1, 2)
  5398. show_hudmessage(id, "%s", award)
  5399.  
  5400. return PLUGIN_HANDLED
  5401. }
  5402.  
  5403.  
  5404.  
  5405. /************************************** GLOWS ********************************************/
  5406.  
  5407. public glow_del_player(id)
  5408. {
  5409. if(!user_is_keeper[id] && id == ballholder && !is_user_foul[id] && !is_offside[id])
  5410. {
  5411. if(cs_get_user_team(id) == CS_TEAM_CT)
  5412. {
  5413. set_user_rendering(id, kRenderFxGlowShell, PlayerColors[0], PlayerColors[1], PlayerColors[2], kRenderNormal, PlayerColors[12])
  5414. entity_set_float(id, EV_FL_renderamt, 1.0)
  5415.  
  5416. }
  5417.  
  5418. else if(cs_get_user_team(id) == CS_TEAM_T)
  5419. {
  5420. set_user_rendering(id, kRenderFxGlowShell, PlayerColors[3], PlayerColors[4], PlayerColors[5], kRenderNormal, PlayerColors[12])
  5421. entity_set_float(id, EV_FL_renderamt, 1.0)
  5422. }
  5423. }
  5424. else if(id == ballholder)
  5425. {
  5426. if(cs_get_user_team(id) == CS_TEAM_CT)
  5427. {
  5428. set_user_rendering(id, kRenderFxGlowShell, PlayerColors[6], PlayerColors[7], PlayerColors[8], kRenderNormal, PlayerColors[13])
  5429. entity_set_float(id, EV_FL_renderamt, 1.0)
  5430. }
  5431.  
  5432. else if(cs_get_user_team(id) == CS_TEAM_T)
  5433. {
  5434. set_user_rendering(id, kRenderFxGlowShell, PlayerColors[9], PlayerColors[10], PlayerColors[11], kRenderNormal, PlayerColors[13])
  5435. entity_set_float(id, EV_FL_renderamt, 1.0)
  5436. }
  5437. }
  5438.  
  5439. // Set Player MaxSpeed
  5440. if (is_user_foul[id] || is_offside[id])
  5441. {
  5442. set_pev(id, pev_velocity, Float:{0.0,0.0,0.0}) // stop motion
  5443. set_pev(id, pev_maxspeed, 1.0) // prevent from moving
  5444. }
  5445. else
  5446. {
  5447. if(!g_sprint[id])
  5448. set_speedchange(id)
  5449. }
  5450. }
  5451.  
  5452.  
  5453. /************************************** MOD NAME *****************************************/
  5454.  
  5455. /*
  5456. public GameDesc()
  5457. {
  5458. forward_return(FMV_STRING, mod_name)
  5459. return FMRES_SUPERCEDE
  5460. }
  5461. */
  5462. /*********************************** MENUS PARA ADM *************************************/
  5463.  
  5464.  
  5465. public menu_pro(id){
  5466.  
  5467. new flags = get_user_flags(id)
  5468.  
  5469. if(flags&ADMIN_KICK)
  5470. {
  5471. new soccermenu = menu_create("Menu Sj-Pro", "handSoccerMenu")
  5472.  
  5473. menu_additem(soccermenu, "CFG's", "1",0)
  5474. menu_additem(soccermenu, "Mapas","2",0)
  5475. menu_additem(soccermenu, "Comandos","3",0)
  5476. menu_additem(soccermenu, "Cvars","4",0)
  5477. menu_additem(soccermenu, "Help para Admins","5",0)
  5478. menu_addblank(soccermenu,1)
  5479. menu_display(id, soccermenu, 0)
  5480. }
  5481.  
  5482. return PLUGIN_HANDLED
  5483.  
  5484. }
  5485.  
  5486.  
  5487. public handSoccerMenu(id, menu, item)
  5488. {
  5489. if(item == MENU_EXIT)
  5490. {
  5491. return PLUGIN_HANDLED
  5492. }
  5493.  
  5494. if( item == 0)
  5495. {
  5496. displaysoccercfg(id);
  5497. }
  5498.  
  5499. if( item == 1)
  5500. {
  5501. displaysoccercambiar(id);
  5502. }
  5503.  
  5504. if( item == 2)
  5505. {
  5506. comandos_utiles(id)
  5507. }
  5508.  
  5509. if( item == 3)
  5510. {
  5511. cvars_utiles(id, 0)
  5512. }
  5513.  
  5514. if( item == 4)
  5515. {
  5516. client_cmd(id,"help_pro")
  5517. }
  5518.  
  5519. return PLUGIN_HANDLED;
  5520. }
  5521.  
  5522. /*====================================================================================================
  5523. [CVARS MENU]
  5524.  
  5525. Purpose: Advance Cvars
  5526.  
  5527. Comment: $$
  5528.  
  5529. ====================================================================================================*/
  5530.  
  5531.  
  5532. public cvars_utiles(id, select)
  5533. {
  5534. new menucvars = menu_create("Cvars ...", "menudecvars")
  5535. new auxiliar = get_pcvar_num(CVAR_POSS)
  5536.  
  5537. if (auxiliar)
  5538. menu_additem(menucvars, "Poss areas: ON", "1", 0)
  5539. else
  5540. menu_additem(menucvars, "Poss areas: OFF", "1", 0)
  5541.  
  5542. auxiliar = get_pcvar_num(CVAR_LIMITES)
  5543.  
  5544. if (auxiliar)
  5545. menu_additem(menucvars, "Limites dos Goleiros: ON", "2", 0)
  5546. else
  5547. menu_additem(menucvars, "Limites dos Goleiros: OFF", "2", 0)
  5548.  
  5549. auxiliar = get_pcvar_num(CVAR_ARQUEROS)
  5550.  
  5551. if (auxiliar)
  5552. menu_additem(menucvars, "Sistema de Goleiros: ON", "3", 0)
  5553. else
  5554. menu_additem(menucvars, "Sistema de Goleiros: OFF", "3", 0)
  5555.  
  5556. auxiliar = get_pcvar_num(CVAR_FRAG)
  5557.  
  5558. if (auxiliar)
  5559. menu_additem(menucvars, "Anti-Frag: OFF", "4", 0)
  5560. else
  5561. menu_additem(menucvars, "Anti-Frag: ON", "4", 0)
  5562.  
  5563. auxiliar = get_pcvar_num(CVAR_ENCONTRA)
  5564.  
  5565. if (auxiliar)
  5566. menu_additem(menucvars, "Gols contra: ON", "5", 0)
  5567. else
  5568. menu_additem(menucvars, "Gols contra: OFF", "5", 0)
  5569.  
  5570. auxiliar = get_pcvar_num(CVAR_OFFSIDE)
  5571.  
  5572. if (auxiliar)
  5573. menu_additem(menucvars, "Impedimento: ON", "5", 0)
  5574. else
  5575. menu_additem(menucvars, "Impedimento: OFF", "5", 0)
  5576.  
  5577. auxiliar = get_pcvar_num(CVAR_FOUL)
  5578.  
  5579. if (auxiliar)
  5580. menu_additem(menucvars, "Faltas: ON", "5", 0)
  5581. else
  5582. menu_additem(menucvars, "Faltas: OFF", "5", 0)
  5583.  
  5584. auxiliar = get_pcvar_num(CVAR_SPEC)
  5585.  
  5586. if (auxiliar)
  5587. menu_additem(menucvars, "Spec: ON", "5", 0)
  5588. else
  5589. menu_additem(menucvars, "Spec: OFF", "5", 0)
  5590.  
  5591. auxiliar = get_pcvar_num(CVAR_SPEC_CABINAS)
  5592.  
  5593. if (auxiliar)
  5594. menu_additem(menucvars, "Cabines: ON", "5", 0)
  5595. else
  5596. menu_additem(menucvars, "Cabines: OFF", "5", 0)
  5597.  
  5598.  
  5599. menu_setprop(menucvars , MPROP_BACKNAME , "Voltar...");
  5600. menu_setprop(menucvars , MPROP_NEXTNAME , "Proximo...");
  5601. menu_setprop(menucvars , MPROP_EXITNAME , "Sair");
  5602. menu_setprop(menucvars , MPROP_PERPAGE , 6);
  5603. menu_setprop(menucvars , MPROP_EXIT , MEXIT_ALL);
  5604.  
  5605. menu_addblank(menucvars,1)
  5606. menu_display(id,menucvars,select)
  5607.  
  5608. return PLUGIN_HANDLED
  5609.  
  5610. }
  5611.  
  5612.  
  5613. public menudecvars(id, menu, item){
  5614.  
  5615.  
  5616. if(item == MENU_EXIT)
  5617. return PLUGIN_HANDLED
  5618.  
  5619. switch(item)
  5620. {
  5621. case 0: if (get_pcvar_num(CVAR_POSS))
  5622. set_cvar_num("sj_poss_areas",0)
  5623. else
  5624. set_cvar_num("sj_poss_areas",1)
  5625.  
  5626. case 1: if (get_pcvar_num(CVAR_LIMITES))
  5627. set_cvar_num("sj_limites",0)
  5628. else
  5629. set_cvar_num("sj_limites",1)
  5630.  
  5631. case 2: if (get_pcvar_num(CVAR_ARQUEROS))
  5632. set_cvar_num("sj_goleiros",0)
  5633. else
  5634. set_cvar_num("sj_goleiros",1)
  5635.  
  5636. case 3: if (get_pcvar_num(CVAR_FRAG))
  5637. set_cvar_num("sj_frag",0)
  5638. else
  5639. set_cvar_num("sj_frag",1)
  5640.  
  5641. case 4: if (get_pcvar_num(CVAR_ENCONTRA))
  5642. set_cvar_num("sj_golscontra",0)
  5643. else
  5644. set_cvar_num("sj_golscontra",1)
  5645.  
  5646. case 5: if (get_pcvar_num(CVAR_OFFSIDE))
  5647. set_cvar_num("sj_impedimento",0)
  5648. else
  5649. set_cvar_num("sj_impedimento",1)
  5650.  
  5651. case 6: if (get_pcvar_num(CVAR_FOUL))
  5652. set_cvar_num("sj_falta",0)
  5653. else
  5654. set_cvar_num("sj_falta",1)
  5655.  
  5656. case 7: if (get_pcvar_num(CVAR_SPEC))
  5657. set_cvar_num("sj_spec",0)
  5658. else
  5659. set_cvar_num("sj_spec",1)
  5660.  
  5661. case 8: if (get_pcvar_num(CVAR_SPEC_CABINAS))
  5662. set_cvar_num("sj_spec_cabines",0)
  5663. else
  5664. set_cvar_num("sj_spec_cabines",1)
  5665. }
  5666.  
  5667. if(item < 6)
  5668. cvars_utiles(id, 0)
  5669. else
  5670. cvars_utiles(id, 1)
  5671.  
  5672. return PLUGIN_HANDLED
  5673. }
  5674.  
  5675.  
  5676. /*====================================================================================================
  5677. [CFG MENU]
  5678.  
  5679. Purpose: Un sencillo menu de cfgs
  5680.  
  5681. Comment: $$
  5682.  
  5683. ====================================================================================================*/
  5684.  
  5685.  
  5686. public displaysoccercfg(id)
  5687. {
  5688. new menusoccercfg = menu_create("Executar CFG ...", "handsoccercfg")
  5689.  
  5690. menu_additem(menusoccercfg, "Publico", "1", 0)
  5691. menu_additem(menusoccercfg, "Cerrado", "2", 0)
  5692. menu_additem(menusoccercfg, "Vale!", "3", 0)
  5693. menu_additem(menusoccercfg, "Frag Arqueros", "4", 0)
  5694.  
  5695. menu_addblank(menusoccercfg,1)
  5696. menu_display(id,menusoccercfg,0)
  5697.  
  5698. return PLUGIN_HANDLED
  5699.  
  5700. }
  5701.  
  5702.  
  5703. public handsoccercfg(id, menu, item){
  5704.  
  5705.  
  5706. if(item == MENU_EXIT)
  5707. {
  5708. return PLUGIN_HANDLED
  5709. }
  5710.  
  5711. switch(item)
  5712. {
  5713. case 0: client_cmd(id,"sj_publico")
  5714. case 1: client_cmd(id,"sj_cerrado")
  5715. case 2: client_cmd(id,"sj_vale")
  5716. case 3: client_cmd(id,"sj_fragarqueros")
  5717. }
  5718. displaysoccercfg(id);
  5719. return PLUGIN_HANDLED
  5720. }
  5721.  
  5722.  
  5723. /*====================================================================================================
  5724. [CAMBIAR MAPA MENU]
  5725.  
  5726. Purpose: Un sencillo menu para cambiar mapas pre definidos
  5727.  
  5728. Comment: $$
  5729.  
  5730. ====================================================================================================*/
  5731.  
  5732.  
  5733. public displaysoccercambiar(id){
  5734.  
  5735.  
  5736. new menusoccercambiar = menu_create("Mudar o mapa...","handsoccercambiar")
  5737.  
  5738.  
  5739. menu_additem(menusoccercambiar, "Soccerjam", "1", 0)
  5740. menu_additem(menusoccercambiar, "Indoorx", "2", 0)
  5741.  
  5742. menu_addblank(menusoccercambiar,1)
  5743. menu_display(id,menusoccercambiar,0)
  5744.  
  5745. return PLUGIN_HANDLED
  5746.  
  5747. }
  5748.  
  5749.  
  5750. public handsoccercambiar(id, menu, item){
  5751.  
  5752.  
  5753. if(item == MENU_EXIT)
  5754. {
  5755. return PLUGIN_HANDLED
  5756. }
  5757.  
  5758. switch(item)
  5759. {
  5760. case 0: client_cmd(id,"amx_map soccerjam")
  5761. case 1: client_cmd(id,"amx_map sj_indoorx_small")
  5762. }
  5763. return PLUGIN_HANDLED
  5764. }
  5765.  
  5766.  
  5767. /*====================================================================================================
  5768. [COMANDOS UTILES]
  5769.  
  5770. Purpose: Un sencillo menu para visualizar los comandos
  5771.  
  5772. Comment: $$
  5773.  
  5774. ====================================================================================================*/
  5775.  
  5776.  
  5777. public comandos_utiles(id){
  5778.  
  5779.  
  5780. new menucomandos = menu_create("Comandos...","menudecomandos")
  5781.  
  5782. menu_additem(menucomandos, "Todos spec!", "1", 0)
  5783. menu_additem(menucomandos, "Full EXP", "2", 0)
  5784. menu_additem(menucomandos, "Full SKILLS", "3", 0)
  5785. menu_additem(menucomandos, "Reiniciar partida", "4", 0)
  5786. menu_additem(menucomandos, "Desbugar goleiros", "5", 0)
  5787.  
  5788. menu_addblank(menucomandos,1)
  5789. menu_display(id,menucomandos,0)
  5790.  
  5791. }
  5792.  
  5793. public menudecomandos(id, menu, item){
  5794.  
  5795.  
  5796. if(item == MENU_EXIT)
  5797. {
  5798. return PLUGIN_HANDLED
  5799. }
  5800.  
  5801. switch(item)
  5802. {
  5803. case 0: client_cmd(id,"amx_spec")
  5804. case 1: client_cmd(id,"amx_exp")
  5805. case 2: client_cmd(id,"amx_full")
  5806. case 3: client_cmd(id,"amx_start")
  5807. }
  5808.  
  5809. if(item == 4)
  5810. {
  5811. desbuguear_arqueros(id)
  5812. }
  5813. comandos_utiles(id);
  5814. return PLUGIN_HANDLED
  5815. }
  5816.  
  5817. public desbuguear_arqueros(id)
  5818. {
  5819. if(arqueroct == 1)
  5820. arqueroct = 0
  5821. if(arquerot == 1)
  5822. arquerot = 0
  5823.  
  5824. ColorChat(id,GREEN,"Goleiros desbugados!")
  5825. return PLUGIN_HANDLED
  5826. }
  5827.  
  5828. public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
  5829. {
  5830. static message[256];
  5831.  
  5832. switch(type)
  5833. {
  5834. case YELLOW: // Yellow
  5835. {
  5836. message[0] = 0x01;
  5837. }
  5838. case GREEN: // Green
  5839. {
  5840. message[0] = 0x04;
  5841. }
  5842. default: // White, Red, Blue
  5843. {
  5844. message[0] = 0x03;
  5845. }
  5846. }
  5847.  
  5848. vformat(message[1], 251, msg, 4);
  5849.  
  5850. // Make sure message is not longer than 192 character. Will crash the server.
  5851. message[192] = '^0';
  5852.  
  5853. new team, ColorChange, index, MSG_Type;
  5854.  
  5855. if(!id)
  5856. {
  5857. index = FindPlayer();
  5858. MSG_Type = MSG_ALL;
  5859.  
  5860. } else {
  5861. MSG_Type = MSG_ONE;
  5862. index = id;
  5863. }
  5864.  
  5865. team = get_user_team(index);
  5866. ColorChange = ColorSelection(index, MSG_Type, type);
  5867.  
  5868. ShowColorMessage(index, MSG_Type, message);
  5869.  
  5870. if(ColorChange)
  5871. {
  5872. Team_Info(index, MSG_Type, TeamName[team]);
  5873. }
  5874. }
  5875.  
  5876. ShowColorMessage(id, type, message[])
  5877. {
  5878. message_begin(type, SayText, _, id);
  5879. write_byte(id)
  5880. write_string(message);
  5881. message_end();
  5882. }
  5883.  
  5884. Team_Info(id, type, team[])
  5885. {
  5886. message_begin(type, TeamInfo, _, id);
  5887. write_byte(id);
  5888. write_string(team);
  5889. message_end();
  5890.  
  5891. return 1;
  5892. }
  5893.  
  5894. ColorSelection(index, type, Color:Type)
  5895. {
  5896. switch(Type)
  5897. {
  5898. case RED:
  5899. {
  5900. return Team_Info(index, type, TeamName[1]);
  5901. }
  5902. case BLUE:
  5903. {
  5904. return Team_Info(index, type, TeamName[2]);
  5905. }
  5906. case GREY:
  5907. {
  5908. return Team_Info(index, type, TeamName[0]);
  5909. }
  5910. }
  5911.  
  5912. return 0;
  5913. }
  5914.  
  5915. FindPlayer()
  5916. {
  5917. new i = -1;
  5918.  
  5919. while(i <= MaxSlots)
  5920. {
  5921. if(IsConnected[++i])
  5922. {
  5923. return i;
  5924. }
  5925. }
  5926.  
  5927. return -1;
  5928. }
  5929.  
  5930.  
  5931. public spec_cabina(id)
  5932. {
  5933. new nombredelmap[64]
  5934. get_mapname(nombredelmap,63)
  5935. new origin[3]
  5936. new z = 100
  5937.  
  5938. if(equali(nombredelmap,"sj_indoorx_small") || equali(nombredelmap,"sj_pro") || equali(nombredelmap,"sj_pro_small"))
  5939. {
  5940. if(get_pcvar_num(CVAR_SPEC_CABINAS))
  5941. {
  5942. if(is_user_alive(id) && !is_user_bot(id) && is_user_connected(id) && !is_user_hltv(id) && id != ballholder && !user_is_keeper[id])
  5943. {
  5944. cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE)
  5945.  
  5946. if(equali(nombredelmap,"sj_indoorx_small"))
  5947. {
  5948. origin[0] = -820
  5949. origin[1] = 680
  5950. origin[2] = -75
  5951. }
  5952.  
  5953. else if(equali(nombredelmap,"sj_pro"))
  5954. {
  5955. origin[0] = -700
  5956. origin[1] = 1310
  5957. origin[2] = -290
  5958. }
  5959.  
  5960. else if(equali(nombredelmap,"sj_pro_small"))
  5961. {
  5962. origin[0] = -690
  5963. origin[1] = 1260
  5964. origin[2] = -290
  5965. }
  5966.  
  5967. switch(espectadores)
  5968. {
  5969. case 0: origin[0] = origin[0] + z*0
  5970. case 1: origin[0] = origin[0] + z*1
  5971. case 2: origin[0] = origin[0] + z*2
  5972. case 3: origin[0] = origin[0] + z*3
  5973. case 4: origin[0] = origin[0] + z*4
  5974. case 5: origin[0] = origin[0] + z*5
  5975. case 6: origin[0] = origin[0] + z*6
  5976. case 7: origin[0] = origin[0] + z*7
  5977. case 8: origin[0] = origin[0] + z*8
  5978. case 9: origin[0] = origin[0] + z*9
  5979. case 10: origin[0] = origin[0] + z*10
  5980. case 11: origin[0] = origin[0] + z*11
  5981. case 12: origin[0] = origin[0] + z*12
  5982. case 13: origin[0] = origin[0] + z*13
  5983. case 14: origin[0] = origin[0] + z*14
  5984. case 15: origin[0] = origin[0] + z*15
  5985. case 16: origin[0] = origin[0] + z*16
  5986. case 17: origin[0] = origin[0] + z*17
  5987. case 18: origin[0] = origin[0] + z*18
  5988. }
  5989. if(espectadores < 18)
  5990. espectadores++
  5991. else
  5992. espectadores = 0
  5993.  
  5994. // strip_user_weapons (id)
  5995.  
  5996. set_user_origin(id, origin)
  5997.  
  5998. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Voce foi para a cabine dos specs")
  5999.  
  6000. soy_spec[id] = true
  6001. }
  6002. else
  6003. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Voce deve estar vivo e sem a bola para ir a cabine dos specs")
  6004. }
  6005. else
  6006. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Opcao desabilitada")
  6007.  
  6008. }
  6009.  
  6010. else if(equali(nombredelmap,"soccerjam"))
  6011. {
  6012. if(get_pcvar_num(CVAR_SPEC_CABINAS))
  6013. {
  6014. if(is_user_alive(id) && !is_user_bot(id) && is_user_connected(id) && !is_user_hltv(id) && id != ballholder && !user_is_keeper[id])
  6015. {
  6016. cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE)
  6017.  
  6018. origin[0] = -1600
  6019. origin[1] = 3250
  6020. origin[2] = 1975
  6021.  
  6022. switch(espectadores)
  6023. {
  6024. case 0:
  6025. {
  6026. origin[0] = origin[0] - z*0
  6027. origin[1] = origin[1] - z*0
  6028. }
  6029. case 1:
  6030. {
  6031. origin[0] = origin[0] - z*0
  6032. origin[1] = origin[1] - z*1
  6033. }
  6034. case 2:
  6035. {
  6036. origin[0] = origin[0] - z*0
  6037. origin[1] = origin[1] - z*2
  6038. }
  6039. case 3:
  6040. {
  6041. origin[0] = origin[0] - z*0
  6042. origin[1] = origin[1] - z*3
  6043. }
  6044. case 4:
  6045. {
  6046. origin[0] = origin[0] - z*1
  6047. origin[1] = origin[1] - z*0
  6048. }
  6049. case 5:
  6050. {
  6051. origin[0] = origin[0] - z*1
  6052. origin[1] = origin[1] - z*1
  6053. }
  6054. case 6:
  6055. {
  6056. origin[0] = origin[0] - z*1
  6057. origin[1] = origin[1] - z*2
  6058. }
  6059. case 7:
  6060. {
  6061. origin[0] = origin[0] - z*1
  6062. origin[1] = origin[1] - z*3
  6063. }
  6064. case 8:
  6065. {
  6066. origin[0] = origin[0] - z*2
  6067. origin[1] = origin[1] - z*0
  6068. }
  6069. case 9:
  6070. {
  6071. origin[0] = origin[0] - z*2
  6072. origin[1] = origin[1] - z*1
  6073. }
  6074. case 10:
  6075. {
  6076. origin[0] = origin[0] - z*2
  6077. origin[1] = origin[1] - z*2
  6078. }
  6079. case 11:
  6080. {
  6081. origin[0] = origin[0] - z*2
  6082. origin[1] = origin[1] - z*3
  6083. }
  6084. case 12:
  6085. {
  6086. origin[0] = origin[0] - z*3
  6087. origin[1] = origin[1] - z*0
  6088. }
  6089. case 13:
  6090. {
  6091. origin[0] = origin[0] - z*3
  6092. origin[1] = origin[1] - z*1
  6093. }
  6094. case 14:
  6095. {
  6096. origin[0] = origin[0] - z*3
  6097. origin[1] = origin[1] - z*2
  6098. }
  6099. case 15:
  6100. {
  6101. origin[0] = origin[0] - z*3
  6102. origin[1] = origin[1] - z*3
  6103. }
  6104. case 16:
  6105. {
  6106. origin[0] = -2290
  6107. origin[1] = 3160
  6108. }
  6109. case 17:
  6110. {
  6111. origin[0] = -2290
  6112. origin[1] = 3260
  6113. }
  6114. }
  6115. if(espectadores < 17)
  6116. espectadores++
  6117. else
  6118. espectadores = 0
  6119.  
  6120. // strip_user_weapons (id)
  6121.  
  6122. set_user_origin(id, origin)
  6123.  
  6124. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Voce foi para a cabine dos specs")
  6125.  
  6126. soy_spec[id] = true
  6127. }
  6128. else
  6129. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Voce deve estar vivo e sem a bola para ir a cabine dos specs")
  6130. }
  6131. else
  6132. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Opcao desabilitada")
  6133.  
  6134. }
  6135. else
  6136. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Somente em indoorx, soccerjam, sj_pro e sj_pro_small")
  6137.  
  6138. return PLUGIN_HANDLED
  6139. }
  6140.  
  6141.  
  6142. public spec_cabina_menu(id)
  6143. {
  6144. new nombredelmap[64]
  6145. get_mapname(nombredelmap,63)
  6146. new origin[3]
  6147. new z = 100
  6148.  
  6149. if(equali(nombredelmap,"sj_indoorx_small") || equali(nombredelmap,"sj_pro") || equali(nombredelmap,"sj_pro_small"))
  6150. {
  6151. if(get_pcvar_num(CVAR_SPEC_CABINAS))
  6152. {
  6153. if(!is_user_bot(id) && is_user_connected(id) && !is_user_hltv(id) && id != ballholder && !user_is_keeper[id])
  6154. {
  6155. if(!is_user_alive(id))
  6156. spawn(id)
  6157.  
  6158. cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE)
  6159.  
  6160. if(equali(nombredelmap,"sj_indoorx_small"))
  6161. {
  6162. origin[0] = -820
  6163. origin[1] = 680
  6164. origin[2] = -75
  6165. }
  6166.  
  6167. else if(equali(nombredelmap,"sj_pro"))
  6168. {
  6169. origin[0] = -700
  6170. origin[1] = 1310
  6171. origin[2] = -290
  6172. }
  6173.  
  6174. else if(equali(nombredelmap,"sj_pro_small"))
  6175. {
  6176. origin[0] = -690
  6177. origin[1] = 1260
  6178. origin[2] = -290
  6179. }
  6180.  
  6181. switch(espectadores)
  6182. {
  6183. case 0: origin[0] = origin[0] + z*0
  6184. case 1: origin[0] = origin[0] + z*1
  6185. case 2: origin[0] = origin[0] + z*2
  6186. case 3: origin[0] = origin[0] + z*3
  6187. case 4: origin[0] = origin[0] + z*4
  6188. case 5: origin[0] = origin[0] + z*5
  6189. case 6: origin[0] = origin[0] + z*6
  6190. case 7: origin[0] = origin[0] + z*7
  6191. case 8: origin[0] = origin[0] + z*8
  6192. case 9: origin[0] = origin[0] + z*9
  6193. case 10: origin[0] = origin[0] + z*10
  6194. case 11: origin[0] = origin[0] + z*11
  6195. case 12: origin[0] = origin[0] + z*12
  6196. case 13: origin[0] = origin[0] + z*13
  6197. case 14: origin[0] = origin[0] + z*14
  6198. case 15: origin[0] = origin[0] + z*15
  6199. case 16: origin[0] = origin[0] + z*16
  6200. case 17: origin[0] = origin[0] + z*17
  6201. case 18: origin[0] = origin[0] + z*18
  6202. }
  6203.  
  6204. if(espectadores < 18)
  6205. espectadores++
  6206. else
  6207. espectadores = 0
  6208.  
  6209. // strip_user_weapons (id)
  6210.  
  6211. set_user_origin(id, origin)
  6212.  
  6213. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Voce foi para a cabine dos specs")
  6214.  
  6215. soy_spec[id] = true
  6216. }
  6217. else
  6218. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Voce deve estar vivo e sem a bola para ir a cabine dos specs")
  6219. }
  6220. else
  6221. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Opcao desabilitada")
  6222.  
  6223. }
  6224.  
  6225. else if(equali(nombredelmap,"soccerjam"))
  6226. {
  6227. if(get_pcvar_num(CVAR_SPEC_CABINAS))
  6228. {
  6229. if(!is_user_bot(id) && is_user_connected(id) && !is_user_hltv(id) && id != ballholder && !user_is_keeper[id])
  6230. {
  6231. if(!is_user_alive(id))
  6232. spawn(id)
  6233.  
  6234. cs_set_user_team(id, CS_TEAM_SPECTATOR, CS_DONTCHANGE)
  6235.  
  6236. origin[0] = -1600
  6237. origin[1] = 3250
  6238. origin[2] = 1975
  6239.  
  6240. switch(espectadores)
  6241. {
  6242. case 0:
  6243. {
  6244. origin[0] = origin[0] - z*0
  6245. origin[1] = origin[1] - z*0
  6246. }
  6247. case 1:
  6248. {
  6249. origin[0] = origin[0] - z*0
  6250. origin[1] = origin[1] - z*1
  6251. }
  6252. case 2:
  6253. {
  6254. origin[0] = origin[0] - z*0
  6255. origin[1] = origin[1] - z*2
  6256. }
  6257. case 3:
  6258. {
  6259. origin[0] = origin[0] - z*0
  6260. origin[1] = origin[1] - z*3
  6261. }
  6262. case 4:
  6263. {
  6264. origin[0] = origin[0] - z*1
  6265. origin[1] = origin[1] - z*0
  6266. }
  6267. case 5:
  6268. {
  6269. origin[0] = origin[0] - z*1
  6270. origin[1] = origin[1] - z*1
  6271. }
  6272. case 6:
  6273. {
  6274. origin[0] = origin[0] - z*1
  6275. origin[1] = origin[1] - z*2
  6276. }
  6277. case 7:
  6278. {
  6279. origin[0] = origin[0] - z*1
  6280. origin[1] = origin[1] - z*3
  6281. }
  6282. case 8:
  6283. {
  6284. origin[0] = origin[0] - z*2
  6285. origin[1] = origin[1] - z*0
  6286. }
  6287. case 9:
  6288. {
  6289. origin[0] = origin[0] - z*2
  6290. origin[1] = origin[1] - z*1
  6291. }
  6292. case 10:
  6293. {
  6294. origin[0] = origin[0] - z*2
  6295. origin[1] = origin[1] - z*2
  6296. }
  6297. case 11:
  6298. {
  6299. origin[0] = origin[0] - z*2
  6300. origin[1] = origin[1] - z*3
  6301. }
  6302. case 12:
  6303. {
  6304. origin[0] = origin[0] - z*3
  6305. origin[1] = origin[1] - z*0
  6306. }
  6307. case 13:
  6308. {
  6309. origin[0] = origin[0] - z*3
  6310. origin[1] = origin[1] - z*1
  6311. }
  6312. case 14:
  6313. {
  6314. origin[0] = origin[0] - z*3
  6315. origin[1] = origin[1] - z*2
  6316. }
  6317. case 15:
  6318. {
  6319. origin[0] = origin[0] - z*3
  6320. origin[1] = origin[1] - z*3
  6321. }
  6322. case 16:
  6323. {
  6324. origin[0] = -2290
  6325. origin[1] = 3160
  6326. }
  6327. case 17:
  6328. {
  6329. origin[0] = -2290
  6330. origin[1] = 3260
  6331. }
  6332. }
  6333. if(espectadores < 17)
  6334. espectadores++
  6335. else
  6336. espectadores = 0
  6337.  
  6338. // strip_user_weapons (id)
  6339.  
  6340. set_user_origin(id, origin)
  6341.  
  6342. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Voce foi para a cabine dos specs")
  6343.  
  6344. soy_spec[id] = true
  6345. }
  6346. else
  6347. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Voce deve estar vivo e sem a bola para ir a cabine dos specs")
  6348. }
  6349. else
  6350. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Opcao desabilitada")
  6351.  
  6352. }
  6353. else
  6354. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Somente em indoorx, soccerjam, sj_pro e sj_pro_small")
  6355.  
  6356. return PLUGIN_HANDLED
  6357. }
  6358.  
  6359. public teleport_aco(Ptd,id)
  6360. {
  6361. new owner = entity_get_edict(Ptd,EV_ENT_owner)
  6362. if(owner == id)
  6363. {
  6364. new origin_aco[3]
  6365. origin_aco[0] = 222
  6366. origin_aco[1] = 770
  6367. origin_aco[2] = -290
  6368. set_user_origin(id,origin_aco)
  6369. // play_wav(id, TELEPORT)
  6370. play_wav(id, SoundDirect[21])
  6371. }
  6372. }
  6373.  
  6374. public teleport_2(Ptd,id)
  6375. {
  6376. new owner = entity_get_edict(Ptd,EV_ENT_owner)
  6377. if(owner == id)
  6378. {
  6379. new origin[3]
  6380. new z = 100
  6381. origin[0] = -820
  6382. origin[1] = 680
  6383. origin[2] = -75
  6384. switch(espectadores)
  6385. {
  6386. case 0: origin[0] = origin[0] + z*0
  6387. case 1: origin[0] = origin[0] + z*1
  6388. case 2: origin[0] = origin[0] + z*2
  6389. case 3: origin[0] = origin[0] + z*3
  6390. case 4: origin[0] = origin[0] + z*4
  6391. case 5: origin[0] = origin[0] + z*5
  6392. case 6: origin[0] = origin[0] + z*6
  6393. case 7: origin[0] = origin[0] + z*7
  6394. case 8: origin[0] = origin[0] + z*8
  6395. case 9: origin[0] = origin[0] + z*9
  6396. case 10: origin[0] = origin[0] + z*10
  6397. case 11: origin[0] = origin[0] + z*11
  6398. case 12: origin[0] = origin[0] + z*12
  6399. case 13: origin[0] = origin[0] + z*13
  6400. case 14: origin[0] = origin[0] + z*14
  6401. case 15: origin[0] = origin[0] + z*15
  6402. case 16: origin[0] = origin[0] + z*16
  6403. case 17: origin[0] = origin[0] + z*17
  6404. case 18: origin[0] = origin[0] + z*18
  6405. }
  6406. if(espectadores < 18)
  6407. espectadores++
  6408. else
  6409. espectadores = 0
  6410.  
  6411. set_user_origin(id, origin)
  6412. // play_wav(id, TELEPORT)
  6413. play_wav(id, SoundDirect[21])
  6414. }
  6415. }
  6416.  
  6417. public resetCurWeapon(id)
  6418. {
  6419. new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)
  6420. if ( Weapon != CSW_KNIFE )
  6421. return PLUGIN_HANDLED
  6422.  
  6423. new vModel[56],pModel[56]
  6424.  
  6425. format(vModel,55,"models/%s.mdl", SModel[5])
  6426. format(pModel,55,"models/%s.mdl", SModel[6])
  6427.  
  6428. entity_set_string(id, EV_SZ_viewmodel, vModel)
  6429. entity_set_string(id, EV_SZ_weaponmodel, pModel)
  6430.  
  6431. return PLUGIN_HANDLED
  6432. }
  6433.  
  6434. public CurWeapon(id)
  6435. {
  6436. new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)
  6437. if ( Weapon != CSW_KNIFE )
  6438. return PLUGIN_HANDLED
  6439.  
  6440. new vModel[56],pModel[56]
  6441.  
  6442. if(user_is_keeper[id])
  6443. {
  6444. format(vModel,55,"models/a7x_sj/Facas/%s.mdl", SModel[3])
  6445. format(pModel,55,"models/a7x_sj/Facas/%s.mdl", SModel[4])
  6446. }
  6447. else
  6448. {
  6449. format(vModel,55,"models/%s.mdl", SModel[5])
  6450. format(pModel,55,"models/%s.mdl", SModel[6])
  6451. }
  6452. entity_set_string(id, EV_SZ_viewmodel, vModel)
  6453. entity_set_string(id, EV_SZ_weaponmodel, pModel)
  6454.  
  6455. return PLUGIN_HANDLED
  6456. }
  6457.  
  6458. public Gol_Sprite_Barca(id)
  6459. {
  6460. message_begin(MSG_ALL,SVC_TEMPENTITY)
  6461. write_byte(124)
  6462. write_byte(id)
  6463. write_coord(65)
  6464. write_short(SpriteGolBarca)
  6465. write_short(40)
  6466. message_end()
  6467. }
  6468.  
  6469. public Gol_Sprite_Real(id)
  6470. {
  6471. message_begin(MSG_ALL,SVC_TEMPENTITY)
  6472. write_byte(124)
  6473. write_byte(id)
  6474. write_coord(65)
  6475. write_short(SpriteGolReal)
  6476. write_short(40)
  6477. message_end()
  6478. }
  6479.  
  6480. public Encontra_Sprite(id)
  6481. {
  6482. message_begin(MSG_ALL,SVC_TEMPENTITY)
  6483. write_byte(124)
  6484. write_byte(id)
  6485. write_coord(65)
  6486. write_short(SpriteGolContra)
  6487. write_short(40)
  6488. message_end()
  6489. }
  6490.  
  6491. public AutoRestart()
  6492. {
  6493. server_cmd("sv_restartround 1")
  6494. }
  6495.  
  6496. public SvCerrado(id)
  6497. {
  6498. new mapname[64]
  6499. new flags = get_user_flags(id)
  6500.  
  6501. get_mapname(mapname,63)
  6502.  
  6503. if(flags&ADMIN_KICK)
  6504. {
  6505. if(!Seguridad_cfg)
  6506. {
  6507. Seguridad_cfg = true
  6508. set_task(5.0,"Seg_cfg")
  6509. new nameadm[MAX_PLAYER + 1]
  6510. new configfile[32]
  6511.  
  6512. format(configfile, 31, "sjcerrado.cfg")
  6513.  
  6514. if(!file_exists(configfile))
  6515. {
  6516. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Nao foi possivel encontrar a CFG ^x03%s^x04", configfile)
  6517. return PLUGIN_HANDLED;
  6518. }
  6519.  
  6520. server_cmd("exec %s", configfile)
  6521.  
  6522. get_user_name(id, nameadm, MAX_PLAYER)
  6523.  
  6524. set_cvar_num("sv_allowupload", 1)
  6525. set_cvar_num("sv_allowdownload", 1)
  6526.  
  6527. ActiveJoinTeam = 0;
  6528.  
  6529. set_hudmessage(0, 0, 255, 0.42, 0.40, 2, 6.0, 4.0, 0.1, 0.2, -1)
  6530. show_hudmessage(0, "-- SERVER EN CFG CERRADO --")
  6531. ColorChat(0,BLUE,"-- SERVER EN CFG CERRADO --")
  6532. ColorChat(0,BLUE,"-- SERVER EN CFG CERRADO --")
  6533. ColorChat(0,BLUE,"-- SERVER EN CFG CERRADO --")
  6534. ColorChat(0,BLUE,"-- SERVER EN CFG CERRADO --")
  6535. ColorChat(0,BLUE,"-- SERVER EN CFG CERRADO --")
  6536.  
  6537. if(equali(mapname,"soccerjam"))
  6538. set_cvar_num("sj_score", 20)
  6539.  
  6540. if(equali(mapname,"sj_indoorx_small"))
  6541. set_cvar_num("sj_score", 30)
  6542.  
  6543. new i
  6544. for(i = 1; i <= MAX_PLAYER; i++)
  6545. {
  6546. if(user_is_keeper[i])
  6547. cmdUnKeeper(i)
  6548. }
  6549. arqueroct = 0
  6550. arquerot = 0
  6551.  
  6552. ColorChat(0, YELLOW, "ADMIN ^x04%s^x01 executou a cfg de cerrado",nameadm)
  6553. set_task(5.0,"ayuda_atajar")
  6554. }
  6555. else
  6556. ColorChat(id,RED,"Voce deve esperar 5 seg para executar uma CFG")
  6557. }
  6558. else
  6559. NoAdmin(id)
  6560.  
  6561. return PLUGIN_HANDLED
  6562. }
  6563.  
  6564. public SvPublico(id)
  6565. {
  6566. new mapname[64]
  6567. new flags = get_user_flags(id)
  6568.  
  6569. get_mapname(mapname,63)
  6570.  
  6571. if(flags&ADMIN_KICK)
  6572. {
  6573. if(!Seguridad_cfg)
  6574. {
  6575. Seguridad_cfg = true
  6576. set_task(5.0,"Seg_cfg")
  6577. new nameadm[MAX_PLAYER + 1]
  6578.  
  6579. new configfile[32]
  6580.  
  6581. format(configfile, 31, "sjpublico.cfg")
  6582.  
  6583. if(!file_exists(configfile))
  6584. {
  6585. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Nao foi possivel encontrar a CFG ^x03%s^x04", configfile)
  6586. return PLUGIN_HANDLED;
  6587. }
  6588.  
  6589. server_cmd("exec %s", configfile)
  6590.  
  6591. get_user_name(id, nameadm, MAX_PLAYER)
  6592. set_cvar_num("sv_allowupload", 1)
  6593. set_cvar_num("sv_allowdownload", 1)
  6594.  
  6595. set_hudmessage(255, 0, 0, 0.42, 0.53, 2, 6.0, 4.0, 0.1, 0.2, -1)
  6596. show_hudmessage(0, "-- SERVER EN CFG PUBLICO --")
  6597. ColorChat(0,GREY,"-- SERVER EN CFG PUBLICO --")
  6598. ColorChat(0,GREY,"-- SERVER EN CFG PUBLICO --")
  6599. ColorChat(0,GREY,"-- SERVER EN CFG PUBLICO --")
  6600. ColorChat(0,GREY,"-- SERVER EN CFG PUBLICO --")
  6601. ColorChat(0,GREY,"-- SERVER EN CFG PUBLICO --")
  6602.  
  6603. ActiveJoinTeam = 0;
  6604.  
  6605. if(equali(mapname,"soccerjam"))
  6606. set_cvar_num("sj_score", 20)
  6607.  
  6608. if(equali(mapname,"sj_indoorx_small"))
  6609. set_cvar_num("sj_score", 30)
  6610.  
  6611. new i
  6612. for(i = 1; i <= MAX_PLAYER; i++)
  6613. {
  6614. if(user_is_keeper[i])
  6615. {
  6616. if(CT_keeper[i])
  6617. CT_keeper[i] = false
  6618. if(T_keeper[i])
  6619. T_keeper[i] = false
  6620.  
  6621. user_is_keeper[i] = false
  6622.  
  6623. }
  6624. // if(is_user_connected(i))
  6625. // Pro_Active[i] = 0; // version 5.06
  6626. }
  6627. arqueroct = 0
  6628. arquerot = 0
  6629.  
  6630. // set_cvar_num("sj_systemexp", 0)
  6631. sj_systemrank = 0
  6632. BorrarSistemExp()
  6633.  
  6634. ColorChat(0, YELLOW, "ADMIN ^x04%s^x01 executou a cfg de publico", nameadm)
  6635. }
  6636. else
  6637. ColorChat(id,RED,"Voce deve esperar 5 seg para executar uma CFG")
  6638. }
  6639. else
  6640. NoAdmin(id)
  6641.  
  6642. return PLUGIN_HANDLED
  6643. }
  6644.  
  6645. public SvVale(id)
  6646. {
  6647. new flags = get_user_flags(id)
  6648. if(flags&ADMIN_KICK)
  6649. {
  6650. if(!Seguridad_cfg)
  6651. {
  6652. Seguridad_cfg = true
  6653. set_task(10.0,"Seg_cfg")
  6654. BeginCountdown()
  6655.  
  6656. new configfile[32]
  6657.  
  6658. format(configfile, 31, "sjvale.cfg")
  6659.  
  6660. if(!file_exists(configfile))
  6661. {
  6662. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Nao se encuentra la cfg ^x03%s^x04", configfile)
  6663. return PLUGIN_HANDLED;
  6664. }
  6665.  
  6666. server_cmd("exec %s", configfile)
  6667.  
  6668. new nameadm[MAX_PLAYER + 1]
  6669. get_user_name(id, nameadm, MAX_PLAYER)
  6670. set_cvar_num("sv_allowupload", 1)
  6671. set_cvar_num("sv_allowdownload", 1)
  6672.  
  6673.  
  6674. /*
  6675. set_cvar_num("sj_limites", 1)
  6676. set_cvar_num("sv_alltalk", 0)
  6677. set_cvar_num("sj_kick", 650)
  6678. set_cvar_num("sj_goalsafety", 650)
  6679. set_cvar_num("sj_frag", 1)
  6680. set_cvar_num("sj_areas", 700)
  6681. set_cvar_num("sj_golesencontra", 1)
  6682. set_cvar_num("sj_foul", 0)
  6683. set_cvar_num("sj_offside", 1)
  6684. */
  6685.  
  6686. set_task(12.0,"vale1",0)
  6687.  
  6688. ColorChat(0,GREEN,"En 10 segundos comienza el cerrado/rjt")
  6689. ColorChat(0,GREEN,"En 10 segundos comienza el cerrado/rjt")
  6690. ColorChat(0,GREEN,"En 10 segundos comienza el cerrado/rjt")
  6691. ColorChat(0,GREEN,"En 10 segundos comienza el cerrado/rjt")
  6692. ColorChat(0,GREEN,"En 10 segundos comienza el cerrado/rjt")
  6693.  
  6694. ColorChat(0, YELLOW, "ADMIN ^x04%s^x01 ejecuto la cfg de vale", nameadm)
  6695.  
  6696. ActiveJoinTeam = 0;
  6697.  
  6698. moveBall(0)
  6699.  
  6700. return PLUGIN_HANDLED
  6701. }
  6702. else
  6703. ColorChat(id,RED,"Debes esperar 10 seg para ejecutar una cfg")
  6704. }
  6705. else
  6706. NoAdmin(id)
  6707.  
  6708. return PLUGIN_HANDLED
  6709. }
  6710.  
  6711. public vale1()
  6712. {
  6713. new clase_tt = 0, clase_ct = 0, suma_player = 0;
  6714. for(new x = 1; x <= MAX_PLAYER; x++)
  6715. {
  6716. if(is_user_connected(x))
  6717. {
  6718. switch(TeamSelect[x])
  6719. {
  6720. case 1: clase_tt++
  6721. case 2: clase_ct++
  6722. }
  6723. }
  6724. }
  6725.  
  6726. suma_player = clase_tt + clase_ct
  6727.  
  6728. set_hudmessage(0, 225, 255, 0.42, 0.40, 2, 6.0, 4.0, 0.1, 0.2, -1)
  6729. show_hudmessage(0, "VALE! VALE! VALE!")
  6730.  
  6731. BorrarSistemExp()
  6732.  
  6733. // set_cvar_num("sj_systemexp", 1)
  6734.  
  6735. if(suma_player >= ConfigPro[31])
  6736. sj_systemrank = 1
  6737. else
  6738. sj_systemrank = 0
  6739.  
  6740. ActiveJoinTeam = 1;
  6741.  
  6742. ColorChat(0,GREEN,"-- VALE! --")
  6743. ColorChat(0,GREEN,"-- VALE! --")
  6744. ColorChat(0,GREEN,"-- VALE! --")
  6745. ColorChat(0,GREEN,"-- VALE! --")
  6746. ColorChat(0,GREEN,"-- VALE! --")
  6747.  
  6748. set_task(5.0,"vale2")
  6749. }
  6750.  
  6751. public vale2()
  6752. {
  6753. if(get_pcvar_num(CVAR_RESEXP))
  6754. ColorChat(0,GREY,"Sistema save game ^x04ON")
  6755. else
  6756. ColorChat(0,TEAM_COLOR,"Sistema save game OFF")
  6757.  
  6758. if(sj_systemrank == 1 && get_pcvar_num(CVAR_RANK))
  6759. ColorChat(0,GREY,"Sistema de rank ^x04ON")
  6760. else
  6761. ColorChat(0,TEAM_COLOR,"Sistema de rank OFF")
  6762. }
  6763.  
  6764. public SvFrag(id)
  6765. {
  6766. new flags = get_user_flags(id)
  6767. if(flags&ADMIN_KICK)
  6768. {
  6769. if(!Seguridad_cfg)
  6770. {
  6771. Seguridad_cfg = true
  6772. set_task(10.0,"Seg_cfg")
  6773. new nameadm[MAX_PLAYER + 1]
  6774. get_user_name(id, nameadm, MAX_PLAYER)
  6775. BeginCountdown()
  6776.  
  6777. new configfile[32]
  6778.  
  6779. format(configfile, 31, "sjfragarqueros.cfg")
  6780.  
  6781. if(!file_exists(configfile))
  6782. {
  6783. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Nao foi possivel encontrar a CFG ^x03%s^x04", configfile)
  6784. return PLUGIN_HANDLED;
  6785. }
  6786.  
  6787. server_cmd("exec %s", configfile)
  6788. /*
  6789. set_cvar_num("sj_limites", 0)
  6790. set_cvar_num("sj_frag", 1)
  6791. */
  6792. set_task(12.0,"frag1",0)
  6793. ColorChat(0, YELLOW, "ADMIN ^x04%s^x01 ejecuto la cfg de frag-arqueros", nameadm)
  6794. ColorChat(0,GREY,"[ a7x ' # TeaM ]^x04 En 10 seg los arqueros deberan fraguearse")
  6795. ActiveJoinTeam = 0;
  6796.  
  6797. return PLUGIN_HANDLED
  6798. }
  6799. else
  6800. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04 Debes esperar 10 seg para ejecutar una cfg")
  6801. }
  6802. else
  6803. NoAdmin(id)
  6804.  
  6805. return PLUGIN_HANDLED
  6806. }
  6807.  
  6808. public Seg_cfg()
  6809. {
  6810. Seguridad_cfg = false
  6811. return PLUGIN_HANDLED
  6812. }
  6813.  
  6814. public frag1()
  6815. {
  6816. set_hudmessage(255, 180, 60, 0.42, 0.53, 2, 6.0, 4.0, 0.1, 0.2, -1)
  6817. show_hudmessage(0, "FRAG ARQUEROS!")
  6818. ColorChat(0,RED,"-- FRAG ARQUEROS! --")
  6819. ColorChat(0,RED,"-- FRAG ARQUEROS! --")
  6820. ColorChat(0,RED,"-- FRAG ARQUEROS! --")
  6821. ColorChat(0,RED,"-- FRAG ARQUEROS! --")
  6822. ColorChat(0,RED,"-- FRAG ARQUEROS! --")
  6823. }
  6824.  
  6825. public ayuda_atajar()
  6826. {
  6827. ColorChat(0,YELLOW,"Escreva no say ^x04/goleiro^x01 ou ^x04/gk^x01 para ser o goleiro da equipe")
  6828. ColorChat(0,YELLOW,"Escreva no say ^x04/sairgoleiro^x01 ou ^x04/sairgk^x01 para deixar de ser o goleiro da equipe")
  6829. }
  6830.  
  6831. public NoAdmin(id)
  6832. {
  6833. bobo[id] += 1
  6834. console_print(id, "Compre um ADMIN primeiro")
  6835.  
  6836. if(bobo[id] == 2)
  6837. {
  6838. new ipa[MAX_PLAYER + 1]
  6839. new name[MAX_PLAYER + 1]
  6840. get_user_ip(id, ipa, MAX_PLAYER, 1)
  6841. get_user_name(id, name, MAX_PLAYER)
  6842. server_cmd("addip 5 %s;writeip", ipa)
  6843. ColorChat(0,GREY,"[ a7x ' # TeaM ]^x04 %s foi banido por 5 min por tentar usar um comando de ADM",name)
  6844. }
  6845. }
  6846.  
  6847.  
  6848.  
  6849. /*
  6850. public apuntado(id)
  6851. {
  6852. new name[MAX_PLAYER + 1]
  6853. new aimed, body, team1, team2, hp;
  6854. get_user_aiming(id, aimed, body);
  6855. team1 = get_user_team(id);
  6856. team2 = get_user_team(aimed);
  6857. get_user_name(aimed,name, MAX_PLAYER)
  6858.  
  6859. if(team1 == team2)
  6860. {
  6861. hp = get_user_health(aimed)
  6862. if(team1 == 1)
  6863. set_hudmessage(255, 255, 0, -1.0, 0.2, 1, 6.0, 12.0, 0.0, 0.0, 1)
  6864. else if(team1 == 2)
  6865. set_hudmessage(0, 255, 255, -1.0, 0.2, 1, 6.0, 12.0, 0.0, 0.0, 1)
  6866.  
  6867. show_hudmessage(id, "%s - HP: %i", name, hp)
  6868. }
  6869. else
  6870. {
  6871. if(team2 == 1)
  6872. set_hudmessage(255, 255, 0, -1.0, 0.2, 1, 6.0, 12.0, 0.0, 0.0, 1)
  6873. else if(team2 == 2)
  6874. set_hudmessage(0, 255, 255, -1.0, 0.2, 1, 6.0, 12.0, 0.0, 0.0, 1)
  6875.  
  6876. show_hudmessage(id, "%s", name)
  6877. }
  6878. }
  6879. */
  6880.  
  6881. /*
  6882. public porro(id)
  6883. {
  6884. new ent_porro = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  6885. engfunc(EngFunc_SetModel, ent_porro, "models/Sj-Pro/Accesorios/Sj-Pro_1.mdl");
  6886. set_pev(ent_porro, pev_movetype, MOVETYPE_FOLLOW);
  6887. set_pev(ent_porro, pev_aiment, id);
  6888. return PLUGIN_HANDLED
  6889. }
  6890.  
  6891. public noporro(id)
  6892. {
  6893. remove_entity(ent_porro)
  6894. return PLUGIN_HANDLED
  6895. }
  6896.  
  6897.  
  6898. public diablo(id)
  6899. {
  6900. ent_diablo = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  6901. engfunc(EngFunc_SetModel, ent_diablo, "models/Sj-Pro_Models/diablo.mdl");
  6902. set_pev(ent_diablo, pev_movetype, MOVETYPE_FOLLOW);
  6903. set_pev(ent_diablo, pev_aiment, id);
  6904. return PLUGIN_HANDLED
  6905. }
  6906.  
  6907. public angel(id)
  6908. {
  6909. ent_angel = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  6910. engfunc(EngFunc_SetModel, ent_angel, "models/Sj-Pro_Models/angel.mdl");
  6911. set_pev(ent_angel, pev_movetype, MOVETYPE_FOLLOW);
  6912. set_pev(ent_angel, pev_aiment, id);
  6913. return PLUGIN_HANDLED
  6914. }
  6915.  
  6916. public gorra(id)
  6917. {
  6918. ent_gorra = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  6919. engfunc(EngFunc_SetModel, ent_gorra, "models/Sj-Pro_Models/gorra.mdl");
  6920. set_pev(ent_gorra, pev_movetype, MOVETYPE_FOLLOW);
  6921. set_pev(ent_gorra, pev_aiment, id);
  6922. return PLUGIN_HANDLED
  6923. }
  6924.  
  6925.  
  6926.  
  6927. public capucha(id)
  6928. {
  6929. ent_capucha = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  6930. engfunc(EngFunc_SetModel, ent_capucha, "models/Sj-Pro_Models/capucha.mdl");
  6931. set_pev(ent_capucha, pev_movetype, MOVETYPE_FOLLOW);
  6932. set_pev(ent_capucha, pev_aiment, id);
  6933. return PLUGIN_HANDLED
  6934. }
  6935.  
  6936. public nogorra(id)
  6937. {
  6938. remove_entity(ent_gorra)
  6939. return PLUGIN_HANDLED
  6940. }
  6941.  
  6942. public nodiablo(id)
  6943. {
  6944. remove_entity(ent_diablo)
  6945. return PLUGIN_HANDLED
  6946. }
  6947.  
  6948. public noangel(id)
  6949. {
  6950. remove_entity(ent_angel)
  6951. return PLUGIN_HANDLED
  6952. }
  6953.  
  6954.  
  6955.  
  6956. public nocapucha(id)
  6957. {
  6958. remove_entity(ent_capucha)
  6959. return PLUGIN_HANDLED
  6960. }
  6961.  
  6962. */
  6963.  
  6964.  
  6965. Offside(id)
  6966. {
  6967. new RestUser = 0, alive = 0, teamoff
  6968. new origin_x[3], PossCancha[MAX_PLAYER + 1][3]
  6969.  
  6970. for(new x = 1; x <= MAX_PLAYER; x++)
  6971. {
  6972. if(is_user_alive(x) && !is_user_bot(x) && !is_user_hltv(x) && is_user_connected(x) && !user_is_keeper[x] && !soy_spec[x])
  6973. {
  6974. alive++
  6975. get_user_origin(x, origin_x)
  6976. teamoff = get_user_team(x)
  6977. PossCancha[x - RestUser][0] = x
  6978. PossCancha[x - RestUser][1] = origin_x[0]
  6979. PossCancha[x - RestUser][2] = teamoff
  6980. }
  6981. else
  6982. RestUser++
  6983. }
  6984.  
  6985. if(alive >= 3)
  6986. {
  6987. new pateoteam = get_user_team(ballowner)
  6988. new auxiliar0, auxiliar1, auxiliar2, finish
  6989. if(pateoteam == 1)
  6990. {
  6991. do
  6992. {
  6993. finish = 0
  6994. for(new x = 1; x <= alive; x++)
  6995. {
  6996. if(PossCancha[x][1] > PossCancha[x + 1][1])
  6997. {
  6998. auxiliar0 = PossCancha[x][0]
  6999. PossCancha[x][0] = PossCancha[x + 1][0]
  7000. PossCancha[x + 1][0] = auxiliar0
  7001.  
  7002. auxiliar1 = PossCancha[x][1]
  7003. PossCancha[x][1] = PossCancha[x + 1][1]
  7004. PossCancha[x + 1][1] = auxiliar1
  7005.  
  7006. auxiliar2 = PossCancha[x][2]
  7007. PossCancha[x][2] = PossCancha[x + 1][2]
  7008. PossCancha[x + 1][2] = auxiliar2
  7009.  
  7010. finish = 1
  7011. }
  7012. }
  7013. }
  7014. while(finish)
  7015. }
  7016. else if(pateoteam == 2)
  7017. {
  7018. do
  7019. {
  7020. finish = 0
  7021. for(new x = 1; x <= alive; x++)
  7022. {
  7023. if(PossCancha[x][1] < PossCancha[x + 1][1])
  7024. {
  7025. auxiliar0 = PossCancha[x][0]
  7026. PossCancha[x][0] = PossCancha[x + 1][0]
  7027. PossCancha[x + 1][0] = auxiliar0
  7028.  
  7029. auxiliar1 = PossCancha[x][1]
  7030. PossCancha[x][1] = PossCancha[x + 1][1]
  7031. PossCancha[x + 1][1] = auxiliar1
  7032.  
  7033. auxiliar2 = PossCancha[x][2]
  7034. PossCancha[x][2] = PossCancha[x + 1][2]
  7035. PossCancha[x + 1][2] = auxiliar2
  7036.  
  7037. finish = 1
  7038. }
  7039. }
  7040. }
  7041. while(finish)
  7042. }
  7043.  
  7044. if(pateoteam != PossCancha[1][2])
  7045. return false;
  7046.  
  7047. if(id == PossCancha[1][0])
  7048. return false;
  7049.  
  7050. if((pateoteam == PossCancha[1][2]) && (pateoteam != PossCancha[2][2]))
  7051. {
  7052. SentenceOffside(PossCancha[1][0], PossCancha[2][0], PossCancha[1][1], PossCancha[2][1])
  7053. }
  7054. else if((pateoteam == PossCancha[1][2]) && (pateoteam == PossCancha[2][2]) && (pateoteam != PossCancha[3][2]))
  7055. {
  7056. SentenceOffside(PossCancha[1][0], PossCancha[3][0], PossCancha[1][1], PossCancha[3][1])
  7057. }
  7058. else if((pateoteam == PossCancha[1][2]) && (pateoteam == PossCancha[2][2]) && (pateoteam == PossCancha[3][2]) && (pateoteam != PossCancha[4][2]))
  7059. {
  7060. SentenceOffside(PossCancha[1][0], PossCancha[4][0], PossCancha[1][1], PossCancha[4][1])
  7061. }
  7062. else
  7063. return false;
  7064. }
  7065. else
  7066. return false;
  7067.  
  7068. return true;
  7069. }
  7070.  
  7071. public SentenceOffside(idoff, idhabil, originoff, originhabil)
  7072. {
  7073. off_1 = idoff
  7074. is_offside[idoff] = true
  7075. Paralize(idoff)
  7076. create_line_off_red(originoff)
  7077. create_line_off_green(originhabil)
  7078. PrintOffside(idoff, idhabil)
  7079. AvisoOffside(idoff)
  7080. }
  7081.  
  7082. public PrintOffside(idoff, idhabil)
  7083. {
  7084. new name_off1[MAX_PLAYER + 1],name_off2[MAX_PLAYER + 1]
  7085. get_user_name(idoff,name_off1, MAX_PLAYER)
  7086. get_user_name(idhabil,name_off2, MAX_PLAYER)
  7087.  
  7088. if(idhabil)
  7089. ColorChat(0,YELLOW,"^x04%s^x01 esta adiantado por ^x04%s^x01",name_off1,name_off2)
  7090. else
  7091. ColorChat(0,YELLOW,"^x04%s^x01 esta adiantado",name_off1)
  7092. }
  7093.  
  7094. public niOffSide()
  7095. {
  7096. if(off_1 > 0)
  7097. {
  7098. if(is_offside[off_1])
  7099. {
  7100. is_offside[off_1] = false
  7101. remove_foul(off_1)
  7102. }
  7103. }
  7104. }
  7105.  
  7106.  
  7107.  
  7108. remove_foul(id)
  7109. {
  7110. // set_pev(id, pev_solid, SOLID_BBOX);
  7111. set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
  7112. set_user_godmode(id, 0)
  7113.  
  7114. // restore normal gravity
  7115.  
  7116. set_pev(id, pev_gravity, 1.0)
  7117.  
  7118. // clear screen fade
  7119. message_begin(MSG_ONE, g_msgScreenFade, _, id);
  7120. write_short(0); // duration
  7121. write_short(0); // hold time
  7122. write_short(0); // flags
  7123. write_byte(0); // red
  7124. write_byte(0); // green
  7125. write_byte(0); // blue
  7126. write_byte(0); // alpha
  7127. message_end();
  7128.  
  7129. return PLUGIN_CONTINUE;
  7130. }
  7131.  
  7132.  
  7133.  
  7134. /**************************************************************
  7135.  
  7136. public plugin_init() {
  7137. register_plugin(PLUGIN, VERSION, AUTHOR)
  7138. set_task(1.0, "getAimed", 0, "", 0, "b");
  7139. }
  7140.  
  7141. public getAimed(id) {
  7142. if(!is_user_alive(id)) {
  7143. return PLUGIN_HANDLED;
  7144. }
  7145.  
  7146. new ent, body;
  7147. get_user_aiming(id, ent, body);
  7148.  
  7149. if(is_valid_ent(ent)) {
  7150. new classname[50];
  7151. entity_get_string(ent,EV_SZ_classname,classname,49);
  7152.  
  7153. if(equal(classname,"player")) {
  7154. if(!is_user_alive(ent)) {
  7155. return PLUGIN_HANDLED;
  7156. }
  7157.  
  7158. showPlayerHud(id, ent);
  7159. }
  7160. }
  7161.  
  7162. return PLUGIN_CONTINUE;
  7163. }
  7164.  
  7165. public showPlayerHud(id, ent) {
  7166. new name[50];
  7167.  
  7168. get_user_name(ent, name, 49);
  7169. set_hudmessage(0, 100, 200, -1.0, 0.35, 0, 4.0, 0.9, 0.1, 0.2, 2);
  7170. show_hudmessage(id, "You are looking at %s", name);
  7171. }
  7172.  
  7173. *///////////////////////////////////////////////////////////////
  7174.  
  7175.  
  7176. public BorrarSistemExp()
  7177. {
  7178. new datadir[128]
  7179. new jivault[256]
  7180. get_datadir(datadir, 127 )
  7181. format(jivault, 255, "%s/vault/Sj-Pro_Exp.vault",datadir)
  7182. if(file_exists(jivault))
  7183. delete_file(jivault);
  7184.  
  7185. return PLUGIN_HANDLED
  7186. }
  7187.  
  7188. public SavePlayerExp(id)
  7189. {
  7190. if(!is_user_connected(id))
  7191. return PLUGIN_HANDLED;
  7192.  
  7193. nameVault = nvault_open(VAULTNAMEEXP);
  7194.  
  7195. new playername[MAX_PLAYER + 1];
  7196. get_user_name(id, playername, MAX_PLAYER);
  7197.  
  7198. new vaultkey[64], vaultdata[64];
  7199. new exp_goles, exp_robos, exp_asis, exp_encontra, exp_disarm, exp_bk, upgrade1, upgrade2, upgrade3, upgrade4, upgrade5, TotalExp;
  7200.  
  7201. exp_goles = MadeRecord[id][GOAL];
  7202. exp_robos = MadeRecord[id][STEAL];
  7203. exp_asis = MadeRecord[id][ASSIST];
  7204. exp_encontra = MadeRecord[id][ENCONTRA]
  7205. exp_disarm = MadeRecord[id][DISARMS]
  7206. exp_bk = MadeRecord[id][KILL]
  7207.  
  7208. upgrade1 = PlayerUpgrades[id][1]
  7209. upgrade2 = PlayerUpgrades[id][2]
  7210. upgrade3 = PlayerUpgrades[id][3]
  7211. upgrade4 = PlayerUpgrades[id][4]
  7212. upgrade5 = PlayerUpgrades[id][5]
  7213.  
  7214. TotalExp = g_Experience[id]
  7215.  
  7216. format(vaultkey, 63, "^"%s^"", playername);
  7217. format(vaultdata, 63, "%i %i %i %i %i %i %i %i %i %i %i %i", exp_goles, exp_robos, exp_asis, exp_encontra, exp_disarm, exp_bk, upgrade1, upgrade2, upgrade3, upgrade4, upgrade5, TotalExp)
  7218. nvault_set(nameVault, vaultkey, vaultdata);
  7219.  
  7220. nvault_close(nameVault);
  7221.  
  7222. return PLUGIN_CONTINUE;
  7223. }
  7224.  
  7225. public LoadPlayerExp(id)
  7226. {
  7227. nameVault = nvault_open(VAULTNAMEEXP);
  7228.  
  7229. if(!is_user_connected(id))
  7230. return PLUGIN_HANDLED;
  7231.  
  7232. new playername[MAX_PLAYER + 1];
  7233. get_user_name(id, playername, MAX_PLAYER);
  7234.  
  7235. new vaultkey[64], vaultdata[64], timestamp;
  7236.  
  7237. new ex_goles[MAX_PLAYER + 1], ex_robos[MAX_PLAYER + 1], ex_asis[MAX_PLAYER + 1], ex_encontra[MAX_PLAYER + 1], ex_disarm[MAX_PLAYER + 1], ex_bk[MAX_PLAYER + 1], upgrad1[MAX_PLAYER + 1], upgrad2[MAX_PLAYER + 1], upgrad3[MAX_PLAYER + 1], upgrad4[MAX_PLAYER + 1], upgrad5[MAX_PLAYER + 1], TotalEx[MAX_PLAYER + 1];
  7238. new exp_goles, exp_robos, exp_asis, exp_encontra, exp_disarm, exp_bk, upgrade1, upgrade2, upgrade3, upgrade4, upgrade5, TotalExp;
  7239.  
  7240. format(vaultkey, 63, "^"%s^"", playername);
  7241. nvault_lookup(nameVault, vaultkey, vaultdata, 1500, timestamp)
  7242.  
  7243. parse(vaultdata,ex_goles, MAX_PLAYER, ex_robos, MAX_PLAYER, ex_asis, MAX_PLAYER, ex_encontra, MAX_PLAYER, ex_disarm, MAX_PLAYER, ex_bk, MAX_PLAYER, upgrad1, MAX_PLAYER, upgrad2, MAX_PLAYER, upgrad3, MAX_PLAYER, upgrad4, MAX_PLAYER, upgrad5, MAX_PLAYER, TotalEx, MAX_PLAYER);
  7244. exp_goles = str_to_num(ex_goles);
  7245. exp_robos = str_to_num(ex_robos);
  7246. exp_asis = str_to_num(ex_asis);
  7247. exp_encontra = str_to_num(ex_encontra);
  7248. exp_disarm = str_to_num(ex_disarm);
  7249. exp_bk = str_to_num(ex_bk);
  7250. upgrade1 = str_to_num(upgrad1);
  7251. upgrade2 = str_to_num(upgrad2);
  7252. upgrade3 = str_to_num(upgrad3);
  7253. upgrade4 = str_to_num(upgrad4);
  7254. upgrade5 = str_to_num(upgrad5);
  7255. TotalExp = str_to_num(TotalEx);
  7256.  
  7257. MadeRecord[id][GOAL] = exp_goles
  7258. MadeRecord[id][STEAL] = exp_robos
  7259. MadeRecord[id][ASSIST] = exp_asis
  7260. MadeRecord[id][ENCONTRA] = exp_encontra
  7261. MadeRecord[id][DISARMS] = exp_disarm
  7262. MadeRecord[id][KILL] = exp_bk
  7263.  
  7264. PlayerUpgrades[id][1] = upgrade1
  7265. PlayerUpgrades[id][2] = upgrade2
  7266. PlayerUpgrades[id][3] = upgrade3
  7267. PlayerUpgrades[id][4] = upgrade4
  7268. PlayerUpgrades[id][5] = upgrade5
  7269.  
  7270. g_Experience[id] = TotalExp
  7271.  
  7272. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Voce recuperou sua EXP")
  7273.  
  7274. nvault_close(nameVault);
  7275. return PLUGIN_CONTINUE;
  7276. }
  7277.  
  7278. /*
  7279. public GuardarExp()
  7280. {
  7281. nameVault = nvault_open(VAULTNAMEEXP);
  7282. new playername[MAX_PLAYER + 1];
  7283. new vaultkey[64], vaultdata[64];
  7284. new exp_goles, exp_robos, exp_asis, exp_encontra, exp_disarm, exp_bk, upgrade1, upgrade2, upgrade3, upgrade4, upgrade5, TotalExp;
  7285.  
  7286. for(new x = 1; x <= MAX_PLAYER ; x++)
  7287. {
  7288. if(!is_user_connected(x))
  7289. {
  7290. get_user_name(x, playername, MAX_PLAYER);
  7291.  
  7292. exp_goles = MadeRecord[x][GOAL];
  7293. exp_robos = MadeRecord[x][STEAL];
  7294. exp_asis = MadeRecord[x][ASSIST];
  7295. exp_encontra = MadeRecord[x][ENCONTRA]
  7296. exp_disarm = MadeRecord[x][DISARMS]
  7297. exp_bk = MadeRecord[x][KILL]
  7298.  
  7299. upgrade1 = PlayerUpgrades[x][1]
  7300. upgrade2 = PlayerUpgrades[x][2]
  7301. upgrade3 = PlayerUpgrades[x][3]
  7302. upgrade4 = PlayerUpgrades[x][4]
  7303. upgrade5 = PlayerUpgrades[x][5]
  7304.  
  7305. TotalExp = g_Experience[x]
  7306.  
  7307. format(vaultkey, 63, "%s", playername);
  7308. format(vaultdata, 63, "%i %i %i %i %i %i %i %i %i %i %i %i", exp_goles, exp_robos, exp_asis, exp_encontra, exp_disarm, exp_bk, upgrade1, upgrade2, upgrade3, upgrade4, upgrade5, TotalExp)
  7309. nvault_set(nameVault, vaultkey,vaultdata);
  7310. }
  7311. }
  7312. nvault_close(nameVault);
  7313.  
  7314. return PLUGIN_HANDLED;
  7315. }
  7316. */
  7317.  
  7318. public PossSpawnSjPro()
  7319. {
  7320. if (file_exists(SpawnSjPro))
  7321. {
  7322. new ent_T, ent_CT
  7323. new Data[128], len, line = 0
  7324. new team[8], p_origin[3][8], p_angles[3][8]
  7325. new Float:origin[3], Float:angles[3]
  7326.  
  7327. while((line = read_file(SpawnSjPro, line, Data, 127, len)) != 0 )
  7328. {
  7329. if (strlen(Data)<2) continue
  7330. parse(Data, team,7, p_origin[0],7, p_origin[1],7, p_origin[2],7, p_angles[0],7, p_angles[1],7, p_angles[2],7)
  7331.  
  7332. origin[0] = str_to_float(p_origin[0]); origin[1] = str_to_float(p_origin[1]); origin[2] = str_to_float(p_origin[2]);
  7333. angles[0] = str_to_float(p_angles[0]); angles[1] = str_to_float(p_angles[1]); angles[2] = str_to_float(p_angles[2]);
  7334. if (equali(team,"T"))
  7335. {
  7336. ent_T = find_ent_by_class(ent_T, "info_player_deathmatch")
  7337. if (ent_T>0)
  7338. {
  7339. entity_set_int(ent_T,EV_INT_iuser1,1)
  7340. entity_set_origin(ent_T,origin)
  7341. entity_set_vector(ent_T, EV_VEC_angles, angles)
  7342. }
  7343. }
  7344. else if (equali(team,"CT"))
  7345. {
  7346. ent_CT = find_ent_by_class(ent_CT, "info_player_start")
  7347. if (ent_CT>0)
  7348. {
  7349. entity_set_int(ent_CT,EV_INT_iuser1,1)
  7350. entity_set_origin(ent_CT,origin)
  7351. entity_set_vector(ent_CT, EV_VEC_angles, angles)
  7352. }
  7353. }
  7354. }
  7355. return 1
  7356. }
  7357. return 0
  7358. }
  7359.  
  7360. SavePlayerRank(id)
  7361. {
  7362. if(!is_user_connected(id))
  7363. return false;
  7364.  
  7365. rankVault = nvault_open(VAULTNAMERANK);
  7366. topVault = nvault_open(VAULTNAMETOP);
  7367.  
  7368. new playername[MAX_PLAYER + 1], temppw[MAX_PLAYER + 1]
  7369.  
  7370. new vaultkey[64], vaultdata[64];
  7371. new temppoints[MAX_PLAYER + 1], tempgoles[MAX_PLAYER + 1], temprobos[MAX_PLAYER + 1], tempasis[MAX_PLAYER + 1], tempencontra[MAX_PLAYER + 1], tempdisarm[MAX_PLAYER + 1], tempkill[MAX_PLAYER + 1], temptekill[MAX_PLAYER + 1], tempterobos[MAX_PLAYER + 1], temptedisarm[MAX_PLAYER + 1], temprankis[MAX_PLAYER + 1];
  7372. new rank_points, rank_goles, rank_robos, rank_asis, rank_encontra, rank_disarm, rank_kill, rank_tekill, rank_terobo , rank_tedisarm, rank_rank;
  7373. new timestamp
  7374.  
  7375. get_user_name(id, playername, MAX_PLAYER);
  7376.  
  7377. format(vaultkey, 63, "^"%s^"", playername);
  7378. if(nvault_lookup(rankVault, vaultkey, vaultdata, 1500, timestamp))
  7379. {
  7380. parse(vaultdata, temppw, MAX_PLAYER, temppoints, MAX_PLAYER, tempgoles, MAX_PLAYER, temprobos, MAX_PLAYER, tempasis, MAX_PLAYER, tempencontra, MAX_PLAYER, tempdisarm, MAX_PLAYER, tempkill, MAX_PLAYER, temptekill, MAX_PLAYER, tempterobos, MAX_PLAYER, temptedisarm, MAX_PLAYER, temprankis, MAX_PLAYER);
  7381. // ColorChat(id, GREEN, "TEST: temppw del saverank es: %s", temppw)
  7382. rank_rank = str_to_num(temprankis);
  7383. rank_points = Pro_Goal[id] * ConfigPro[21] + Pro_Steal[id] * ConfigPro[23] + Pro_Asis[id] * ConfigPro[25] + Pro_Disarm[id] * ConfigPro[28] + Pro_Kill[id] * ConfigPro[26] + Pro_Contra[id] * ConfigPro[22] + Pro_teSteal[id] * ConfigPro[24] + Pro_teKill[id] * ConfigPro[27] + Pro_teDisarm[id] * ConfigPro[29]
  7384. rank_goles = Pro_Goal[id];
  7385. rank_robos = Pro_Steal[id];
  7386. rank_asis = Pro_Asis[id];
  7387. rank_encontra = Pro_Contra[id];
  7388. rank_disarm = Pro_Disarm[id];
  7389. rank_kill = Pro_Kill[id];
  7390. rank_tekill = Pro_teKill[id];
  7391. rank_terobo = Pro_teSteal[id];
  7392. rank_tedisarm = Pro_teDisarm[id];
  7393. }
  7394. else
  7395. return false;
  7396.  
  7397. format(vaultdata, 63, "%s %i %i %i %i %i %i %i %i %i %i %i", temppw, rank_points, rank_goles, rank_robos, rank_asis, rank_encontra, rank_disarm, rank_kill, rank_tekill, rank_terobo, rank_tedisarm, rank_rank)
  7398. nvault_set(rankVault, vaultkey, vaultdata);
  7399.  
  7400. return true;
  7401. }
  7402.  
  7403. VerificarPossUP(id)
  7404. {
  7405. if(!UserPassword[id])
  7406. return false;
  7407.  
  7408. if(!SavePlayerRank(id))
  7409. {
  7410. nvault_close(rankVault);
  7411. nvault_close(topVault);
  7412. return false;
  7413. }
  7414.  
  7415. new P_pw[MAX_PLAYER + 1], P_points[MAX_PLAYER + 1], P_goles[MAX_PLAYER + 1], P_robos[MAX_PLAYER + 1], P_asis[MAX_PLAYER + 1], P_encontra[MAX_PLAYER + 1], P_disarm[MAX_PLAYER + 1], P_kill[MAX_PLAYER + 1], P_tekill[MAX_PLAYER + 1], P_terobos[MAX_PLAYER + 1], P_tedisarm[MAX_PLAYER + 1], P_rank[MAX_PLAYER + 1];
  7416. new C_pw[MAX_PLAYER + 1], C_points[MAX_PLAYER + 1], C_goles[MAX_PLAYER + 1], C_robos[MAX_PLAYER + 1], C_asis[MAX_PLAYER + 1], C_encontra[MAX_PLAYER + 1], C_disarm[MAX_PLAYER + 1], C_kill[MAX_PLAYER + 1], C_tekill[MAX_PLAYER + 1], C_terobos[MAX_PLAYER + 1], C_tedisarm[MAX_PLAYER + 1], C_rank[MAX_PLAYER + 1];
  7417. new Pkey[64], Ckey[64], Pdata[64], Cdata[64], timestamp;
  7418. new Ppoint, Cpoint, Crank, Prank;
  7419. new Pname[MAX_PLAYER + 1], Cname[MAX_PLAYER + 1];
  7420. new tempPrank;
  7421.  
  7422. get_user_name(id, Pname, MAX_PLAYER);
  7423. format(Pkey, 63, "^"%s^"", Pname);
  7424.  
  7425. for(new x = 1; x <= TotalRank; x++)
  7426. {
  7427. if(nvault_lookup(rankVault, Pkey, Pdata, 1500, timestamp))
  7428. {
  7429. parse(Pdata, P_pw, MAX_PLAYER, P_points, MAX_PLAYER, P_goles, MAX_PLAYER, P_robos, MAX_PLAYER, P_asis, MAX_PLAYER, P_encontra, MAX_PLAYER, P_disarm, MAX_PLAYER, P_kill, MAX_PLAYER, P_tekill, MAX_PLAYER, P_terobos, MAX_PLAYER, P_tedisarm, MAX_PLAYER, P_rank, MAX_PLAYER);
  7430. Ppoint = str_to_num(P_points)
  7431. Prank = str_to_num(P_rank)
  7432.  
  7433. if(Prank > 1 && Prank <= TotalRank)
  7434. {
  7435. tempPrank = Prank - 1
  7436. format(Ckey, 63, "%i", tempPrank);
  7437. if(nvault_lookup(topVault, Ckey, Cdata, 1500, timestamp))
  7438. {
  7439. parse(Cdata, Cname, MAX_PLAYER)
  7440. format(Ckey, 63, "^"%s^"", Cname);
  7441.  
  7442. if(nvault_lookup(rankVault, Ckey, Cdata, 1500, timestamp))
  7443. {
  7444. parse(Cdata, C_pw, MAX_PLAYER, C_points, MAX_PLAYER, C_goles, MAX_PLAYER, C_robos, MAX_PLAYER, C_asis, MAX_PLAYER, C_encontra, MAX_PLAYER, C_disarm, MAX_PLAYER, C_kill, MAX_PLAYER, C_tekill, MAX_PLAYER, C_terobos, MAX_PLAYER, C_tedisarm, MAX_PLAYER, C_rank, MAX_PLAYER);
  7445. Cpoint = str_to_num(C_points)
  7446. Crank = str_to_num(C_rank)
  7447.  
  7448. if(Crank >= 1 && Crank <= TotalRank)
  7449. {
  7450. if(Ppoint > Cpoint)
  7451. {
  7452. // ColorChat(id, GREEN, "TEST: rank_pw del Cdata es: %s", C_pw)
  7453. // ColorChat(id, GREEN, "TEST: rank_pw del Pdata es: %s", P_pw)
  7454. format(Cdata, 63, "%s %i %i %i %i %i %i %i %i %i %i %i", C_pw, Cpoint, str_to_num(C_goles), str_to_num(C_robos), str_to_num(C_asis), str_to_num(C_encontra), str_to_num(C_disarm), str_to_num(C_kill), str_to_num(C_tekill), str_to_num(C_terobos), str_to_num(C_tedisarm), Prank)
  7455. format(Pdata, 63, "%s %i %i %i %i %i %i %i %i %i %i %i", P_pw, Ppoint, str_to_num(P_goles), str_to_num(P_robos), str_to_num(P_asis), str_to_num(P_encontra), str_to_num(P_disarm), str_to_num(P_kill), str_to_num(P_tekill), str_to_num(P_terobos), str_to_num(P_tedisarm), Crank)
  7456. nvault_set(rankVault, Ckey, Cdata);
  7457. nvault_set(rankVault, Pkey, Pdata);
  7458. new keytop[64]
  7459. format(keytop, 63, "%i", Crank);
  7460. nvault_set(topVault, keytop, Pkey);
  7461. format(keytop, 63, "%i", Prank);
  7462. nvault_set(topVault, keytop, Ckey);
  7463. }
  7464. else
  7465. {
  7466. Pro_Rank[id] = Prank;
  7467. break;
  7468. }
  7469. }
  7470. else
  7471. {
  7472. Pro_Rank[id] = Prank;
  7473. break;
  7474. }
  7475. }
  7476. else
  7477. {
  7478. Pro_Rank[id] = Prank;
  7479. break;
  7480. }
  7481. }
  7482. else
  7483. {
  7484. Pro_Rank[id] = Prank;
  7485. break;
  7486. }
  7487. }
  7488. else
  7489. {
  7490. Pro_Rank[id] = Prank;
  7491. break;
  7492. }
  7493. }
  7494. else
  7495. break;
  7496. }
  7497.  
  7498. for(new x = 1; x <= TotalRank; x++)
  7499. {
  7500. if(nvault_lookup(rankVault, Pkey, Pdata, 1500, timestamp))
  7501. {
  7502. parse(Pdata, P_pw, MAX_PLAYER, P_points, MAX_PLAYER, P_goles, MAX_PLAYER, P_robos, MAX_PLAYER, P_asis, MAX_PLAYER, P_encontra, MAX_PLAYER, P_disarm, MAX_PLAYER, P_kill, MAX_PLAYER, P_tekill, MAX_PLAYER, P_terobos, MAX_PLAYER, P_tedisarm, MAX_PLAYER, P_rank, MAX_PLAYER);
  7503. Ppoint = str_to_num(P_points)
  7504. Prank = str_to_num(P_rank)
  7505.  
  7506. if(Prank >= 1 && Prank < TotalRank)
  7507. {
  7508. tempPrank = Prank + 1
  7509.  
  7510. format(Ckey, 63, "%i", tempPrank);
  7511. if(nvault_lookup(topVault, Ckey, Cdata, 1500, timestamp))
  7512. {
  7513. parse(Cdata, Cname, MAX_PLAYER)
  7514. format(Ckey, 63, "^"%s^"", Cname);
  7515.  
  7516. if(nvault_lookup(rankVault, Ckey, Cdata, 1500, timestamp))
  7517. {
  7518. parse(Cdata, C_pw, MAX_PLAYER, C_points, MAX_PLAYER, C_goles, MAX_PLAYER, C_robos, MAX_PLAYER, C_asis, MAX_PLAYER, C_encontra, MAX_PLAYER, C_disarm, MAX_PLAYER, C_kill, MAX_PLAYER, C_tekill, MAX_PLAYER, C_terobos, MAX_PLAYER, C_tedisarm, MAX_PLAYER, C_rank, MAX_PLAYER);
  7519. Cpoint = str_to_num(C_points)
  7520. Crank = str_to_num(C_rank)
  7521.  
  7522. if(Crank >= 1 && Crank <= TotalRank)
  7523. {
  7524. if(Ppoint < Cpoint)
  7525. {
  7526. // ColorChat(id, GREEN, "TEST: rank_pw del Cdata es: %s", C_pw)
  7527. // ColorChat(id, GREEN, "TEST: rank_pw del Pdata es: %s", P_pw)
  7528. format(Cdata, 63, "%s %i %i %i %i %i %i %i %i %i %i %i", C_pw, Cpoint, str_to_num(C_goles), str_to_num(C_robos), str_to_num(C_asis), str_to_num(C_encontra), str_to_num(C_disarm), str_to_num(C_kill), str_to_num(C_tekill), str_to_num(C_terobos), str_to_num(C_tedisarm), Prank)
  7529. format(Pdata, 63, "%s %i %i %i %i %i %i %i %i %i %i %i", P_pw, Ppoint, str_to_num(P_goles), str_to_num(P_robos), str_to_num(P_asis), str_to_num(P_encontra), str_to_num(P_disarm), str_to_num(P_kill), str_to_num(P_tekill), str_to_num(P_terobos), str_to_num(P_tedisarm), Crank)
  7530. nvault_set(rankVault, Ckey, Cdata);
  7531. nvault_set(rankVault, Pkey, Pdata);
  7532. new keytop[64]
  7533. format(keytop, 63, "%i", Crank)
  7534. nvault_set(topVault, keytop, Pkey);
  7535. format(keytop, 63, "%i", Prank)
  7536. nvault_set(topVault, keytop, Ckey);
  7537. }
  7538. else
  7539. {
  7540. Pro_Rank[id] = Prank;
  7541. break;
  7542. }
  7543. }
  7544. else
  7545. {
  7546. Pro_Rank[id] = Prank;
  7547. break;
  7548. }
  7549. }
  7550. else
  7551. {
  7552. Pro_Rank[id] = Prank;
  7553. break;
  7554. }
  7555. }
  7556. else
  7557. {
  7558. Pro_Rank[id] = Prank;
  7559. break;
  7560. }
  7561. }
  7562. else
  7563. {
  7564. Pro_Rank[id] = Prank;
  7565. break;
  7566. }
  7567. }
  7568. else
  7569. break;
  7570. }
  7571.  
  7572. nvault_close(rankVault);
  7573. nvault_close(topVault);
  7574.  
  7575. return true
  7576. }
  7577.  
  7578. /*
  7579. public LoadPlayerRank(id)
  7580. {
  7581.  
  7582. if(!is_user_connected(id))
  7583. return PLUGIN_HANDLED;
  7584.  
  7585. rankVault = nvault_open(VAULTNAMERANK);
  7586. topVault = nvault_open(VAULTNAMETOP);
  7587.  
  7588. new playername[MAX_PLAYER + 1];
  7589.  
  7590. new vaultkey[64], vaultdata[64], timestamp;
  7591.  
  7592. new rank_points[MAX_PLAYER + 1], rank_goles[MAX_PLAYER + 1], rank_robos[MAX_PLAYER + 1], rank_asis[MAX_PLAYER + 1], rank_encontra[MAX_PLAYER + 1], rank_disarm[MAX_PLAYER + 1], rank_kill[MAX_PLAYER + 1], rank_tekill[MAX_PLAYER + 1], rank_terobos[MAX_PLAYER + 1], rank_tedisarm[MAX_PLAYER + 1], rank_rank[MAX_PLAYER + 1];
  7593.  
  7594. get_user_name(id, playername, MAX_PLAYER);
  7595.  
  7596. format(vaultkey, 63, "^"%s^"", playername);
  7597. if(nvault_lookup(rankVault, vaultkey, vaultdata, 1500, timestamp))
  7598. {
  7599. parse(vaultdata, rank_points, MAX_PLAYER, rank_goles, MAX_PLAYER, rank_robos, MAX_PLAYER, rank_asis, MAX_PLAYER, rank_encontra, MAX_PLAYER, rank_disarm, MAX_PLAYER, rank_kill, MAX_PLAYER, rank_tekill, MAX_PLAYER, rank_terobos, MAX_PLAYER, rank_tedisarm, MAX_PLAYER, rank_rank, MAX_PLAYER);
  7600. Pro_Point[id] = str_to_num(rank_points);
  7601. Pro_Goal[id] = str_to_num(rank_goles);
  7602. Pro_Steal[id] = str_to_num(rank_robos);
  7603. Pro_Asis[id] = str_to_num(rank_asis);
  7604. Pro_Contra[id] = str_to_num(rank_encontra);
  7605. Pro_Disarm[id] = str_to_num(rank_disarm);
  7606. Pro_Kill[id] = str_to_num(rank_kill);
  7607. Pro_teKill[id] = str_to_num(rank_tekill);
  7608. Pro_teSteal[id] = str_to_num(rank_terobos);
  7609. Pro_teDisarm[id] = str_to_num(rank_tedisarm);
  7610. Pro_Rank[id] = str_to_num(rank_rank);
  7611. }
  7612. else
  7613. {
  7614. TotalRank += 1
  7615. new vaultnum[64]
  7616. format(vaultnum, 63, "%i", TotalRank);
  7617. format(vaultdata, 63, "0 0 0 0 0 0 0 0 0 0 %i", TotalRank)
  7618. nvault_set(rankVault, vaultkey, vaultdata);
  7619. nvault_set(topVault, vaultnum, vaultkey);
  7620. nvault_set(topVault, "RankKey", vaultnum);
  7621.  
  7622. set_task(2.0,"BienvenidoRank",id)
  7623.  
  7624. Pro_Point[id] = 0;
  7625. Pro_Goal[id] = 0;
  7626. Pro_Steal[id] = 0;
  7627. Pro_Asis[id] = 0;
  7628. Pro_Contra[id] = 0;
  7629. Pro_Disarm[id] = 0;
  7630. Pro_Kill[id] = 0;
  7631. Pro_teKill[id] = 0;
  7632. Pro_teSteal[id] = 0;
  7633. Pro_teDisarm[id] = 0;
  7634. Pro_Rank[id] = TotalRank;
  7635. }
  7636. nvault_close(rankVault);
  7637. nvault_close(topVault);
  7638. return PLUGIN_CONTINUE;
  7639. }
  7640. */
  7641.  
  7642. /*
  7643. public BienvenidoRank(id)
  7644. {
  7645. ColorChat(id,GREY,"[Sj-Pro]^x04 Nick registrado. Tu poss en el SjRank es ^x03%i", TotalRank)
  7646. }
  7647. */
  7648.  
  7649. public sjrank(id)
  7650. {
  7651. if(UserPassword[id])
  7652. ColorChat(id,GREEN,"Sua posicao no rank e ^x03%i^x04 de ^x03%i^x04 com ^x03%i^x04 pontos.",Pro_Rank[id], TotalRank, Pro_Point[id])
  7653. else
  7654. ColorChat(id,GREY,"[ a7x ' # TeaM ]^x04Voce nao esta logado, coloque sua pw ou crie uma conta")
  7655.  
  7656. return PLUGIN_HANDLED;
  7657. }
  7658.  
  7659. public SjTop10(id)
  7660. {
  7661. rankVault = nvault_open(VAULTNAMERANK);
  7662. topVault = nvault_open(VAULTNAMETOP);
  7663. new Playername[MAX_PLAYER + 1]
  7664. new vaultkey[64], vaultnum[64], vaultdata[64], timestamp;
  7665. new rank_pw[MAX_PLAYER + 1], rank_points[MAX_PLAYER + 1], rank_goles[MAX_PLAYER + 1], rank_robos[MAX_PLAYER + 1], rank_asis[MAX_PLAYER + 1], rank_encontra[MAX_PLAYER + 1], rank_disarm[MAX_PLAYER + 1], rank_kill[MAX_PLAYER + 1], rank_tekill[MAX_PLAYER + 1], rank_terobos[MAX_PLAYER + 1], rank_tedisarm[MAX_PLAYER + 1], rank_rank[MAX_PLAYER + 1];
  7666.  
  7667. new motd[1501],iLen;
  7668.  
  7669. //COLORES AMARILLO <font color=#fff000> AZUL <font color=#98f5ff> ROJO <font color=#ff0000> VERDE CLARO <font color=#00ff7e>
  7670.  
  7671. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
  7672. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Top10 Soccerjam a7x ----</h2></center>^n^n");
  7673. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b><U>%2s %-22.22s %8s %6s %6s %6s %6s %6s %6s %6s %6s %12s</U></b>^n", "#", "Nome", "Pontos", "Gols", "Roubos", "Regalos", "Assistencias", "Contra", "Disarmes", "Disarmesrv", "Bkills", "Bkills rv");
  7674.  
  7675. for(new xtop = 1; xtop <= 10; xtop++)
  7676. {
  7677. format(vaultnum, 63, "%i", xtop);
  7678. if(nvault_lookup(topVault, vaultnum, vaultdata, 1500, timestamp))
  7679. {
  7680. parse(vaultdata,Playername, MAX_PLAYER)
  7681. format(vaultkey, 63, "^"%s^"", Playername);
  7682. nvault_lookup(rankVault, vaultkey, vaultdata, 1500, timestamp)
  7683.  
  7684. if(containi ( Playername, "<" ) != -1 )
  7685. replace( Playername, MAX_PLAYER, "<", "" )
  7686.  
  7687. parse(vaultdata, rank_pw, MAX_PLAYER, rank_points, MAX_PLAYER, rank_goles, MAX_PLAYER, rank_robos, MAX_PLAYER, rank_asis, MAX_PLAYER, rank_encontra, MAX_PLAYER, rank_disarm, MAX_PLAYER, rank_kill, MAX_PLAYER, rank_tekill, MAX_PLAYER, rank_terobos, MAX_PLAYER, rank_tedisarm, MAX_PLAYER, rank_rank, MAX_PLAYER);
  7688. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%2i %-22.22s %6i %7i %6i %8i %5i %10i %7i %9i %6i %9i^n", xtop, Playername, str_to_num(rank_points), str_to_num(rank_goles), str_to_num(rank_robos), str_to_num(rank_terobos), str_to_num(rank_asis), str_to_num(rank_encontra), str_to_num(rank_disarm), str_to_num(rank_tedisarm), str_to_num(rank_kill), str_to_num(rank_tekill))
  7689. }
  7690. else
  7691. {
  7692. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%2i %-22.22s %6i %7i %6i %8i %5i %10i %7i %9i %6i %9i^n", xtop, "- Nao Existe-", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  7693. }
  7694. }
  7695. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><center><b>SoccerJam a7x 6.0</b></center>^n");
  7696. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><b>Seja bem vindo</b></center>");
  7697. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><b>Adicione o IP aos favoritos</b></center>");
  7698. show_motd(id,motd, "Soccerjam TOP10");
  7699. nvault_close(rankVault);
  7700. nvault_close(topVault);
  7701.  
  7702. return PLUGIN_HANDLED;
  7703. }
  7704.  
  7705.  
  7706.  
  7707. public allrecords(id)
  7708. {
  7709. new motd[1501],iLen;
  7710.  
  7711. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#fff000><pre>");
  7712. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Todos los records ----</h2></center>^n^n");
  7713. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %8s %7s %6s %6s %6s %6s %6s^n", "Nick", "Goles", "Robos", "Asist", "En contra", "Disarms", "Bkills", "Lejano");
  7714. for(new x=1; x<=maxplayers; x++)
  7715. {
  7716. if(is_user_connected(x))
  7717. {
  7718. new elname[MAX_PLAYER + 1]
  7719. get_user_name(x, elname, MAX_PLAYER)
  7720. if(containi (elname, "<" ) != -1 )
  7721. replace(elname, MAX_PLAYER, "<", "" )
  7722.  
  7723. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %5i %8i %7i %10i %7i %6i %6i^n", elname, MadeRecord[x][1], MadeRecord[x][3], MadeRecord[x][2], MadeRecord[x][4], MadeRecord[x][6], MadeRecord[x][7], MadeRecord[x][5]);
  7724. }
  7725. }
  7726. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><b><center>by L//</center>^n");
  7727. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center>MSN: leo1-7@hotmail.com</b></center>");
  7728. show_motd(id,motd, "Allrecords by L//");
  7729.  
  7730. return PLUGIN_HANDLED
  7731. }
  7732.  
  7733. public sjmenuhelp(id)
  7734. {
  7735. new helpmenu = menu_create("Info Sj-Pro", "InfoMenu")
  7736.  
  7737. menu_additem(helpmenu, "General", "1",0)
  7738. menu_additem(helpmenu, "Moves & Levels", "2",0)
  7739. menu_additem(helpmenu, "Rank Sj-Pro", "3",0)
  7740. menu_additem(helpmenu, "Registro Rank", "4",0)
  7741. menu_additem(helpmenu, "Comandos","5",0)
  7742. menu_additem(helpmenu, "Info Areas","6",0)
  7743. menu_addblank(helpmenu,1)
  7744. menu_display(id, helpmenu, 0)
  7745.  
  7746. return PLUGIN_HANDLED
  7747.  
  7748. }
  7749.  
  7750.  
  7751. public InfoMenu(id, menu, item)
  7752. {
  7753. if(item == MENU_EXIT)
  7754. return PLUGIN_HANDLED
  7755.  
  7756. if( item == 0)
  7757. displayhelp(id);
  7758.  
  7759. if( item == 1)
  7760. displaymovements(id);
  7761.  
  7762. if( item == 2)
  7763. displaytop10(id);
  7764.  
  7765. if( item == 3)
  7766. displayregistro(id);
  7767.  
  7768. if( item == 4)
  7769. displaycomandos(id);
  7770.  
  7771. if( item == 5)
  7772. displayareas(id)
  7773.  
  7774. return PLUGIN_HANDLED;
  7775. }
  7776.  
  7777. public displaytop10(id)
  7778. {
  7779. new motd[1501],iLen;
  7780.  
  7781. //COLORES AMARILLO <font color=#fff000> AZUL <font color=#98f5ff> ROJO <font color=#ff0000> VERDE CLARO <font color=#00ff7e>
  7782.  
  7783. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
  7784. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Info Rank Sj-Pro ----</h2></center>^n^n");
  7785. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000>El rank del Sj-Pro se basa en la acumulacion de puntos,^n")
  7786. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"por lo que cada player debera ir acumulandolos a medida que juega cerrados.^n");
  7787. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Como dije anteriormente, un player podra acumular puntos a partir de que^n");
  7788. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"un adm ejecute la cfg de ^"vale^", y a su ves alla 10 players de ct o tt para que el rank se active.^n");
  7789. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"El metodo para calcular los puntos de cada player es el siguiente:^n^n");
  7790. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#ff0000>%10s %2s %6s^n^n", "Accion","=","Puntos");
  7791. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n", "Gol","=",5)
  7792. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n", "Robo","=",2)
  7793. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n", "Regalo","=",-2)
  7794. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n", "Asis","=",4)
  7795. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n", "Disarm","=",3)
  7796. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n", "Te Disarm","=",-3)
  7797. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n", "Bkill","=",3)
  7798. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n", "Te Bkill","=",-3)
  7799. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%10s</b> %2s %6i^n^n", "En contra","=",-10)
  7800. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000>La cantidad de puntos total sera la sumatoria de todas las acciones.^n")
  7801. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Si el player posee un rank menor o igual a 10, aparecera en el Sj-Pro top 10.^n")
  7802. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Tu poss en el rank se actualiza automaticamente al hacer algun logro punto.^n^n")
  7803. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>NOTA</b>: Si un player se desconecta en medio de un cerrado y el total de players^n")
  7804. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"dentro de la cancha se menor a 9, este se desactivara automaticamente.^n")
  7805. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Si luego ingresa un player y el total de los mismos es mayor a 9, se activara nuevamente.^n")
  7806.  
  7807. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><center><b>by L//</b></center>^n");
  7808. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><b>MSN: leo1-7@hotmail.com</b></center>");
  7809. show_motd(id,motd, "Info Rank Sj-Pro");
  7810.  
  7811. return PLUGIN_HANDLED
  7812. }
  7813.  
  7814. public displayregistro(id)
  7815. {
  7816. new motd[1501],iLen;
  7817.  
  7818. //COLORES AMARILLO <font color=#fff000> AZUL <font color=#98f5ff> ROJO <font color=#ff0000> VERDE CLARO <font color=#00ff7e>
  7819.  
  7820. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
  7821. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Registro Rank ----</h2></center>^n^n");
  7822. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000>Para poder rankear en el Sj-Pro, es necesario registrarse.^n")
  7823. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Para ello debemos crear una cuenta de la siguiente manera:^n^n");
  7824. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Tipea <font color=#ff0000>/menu <font color=#fff000>en say, elegir la opcion <font color=#98f5ff>Registrar Rank <font color=#fff000>e introducir la password.^n^n");
  7825. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"En la base de datos se guardara tu nick y contrasenia,^nsimilar a la password de un administrador, ");
  7826. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"es decir, en tu config.cfg se guardara ^nuna setinfo llamada <font color=#98f5ff>^"setinfo _sj tupassword^"^n")
  7827. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000>Cuando ingreses nuevamente al server, si no tocaste tu cfg,^ntus logros se cargaran automaticamente.^n^n")
  7828. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Si cambias de nick, deberas loguearte con el correspondiente nick o crearte una nueva cuenta^n")
  7829.  
  7830. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><center><b>by L//</b></center>^n");
  7831. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><b>MSN: leo1-7@hotmail.com</b></center>");
  7832. show_motd(id,motd, "Registro Rank");
  7833.  
  7834. return PLUGIN_HANDLED
  7835. }
  7836.  
  7837. public displaycomandos(id)
  7838. {
  7839. new motd[1501],iLen;
  7840.  
  7841. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
  7842. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Comandos ----</h2></center>^n^n");
  7843. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000>Aca una lista de todos los comandos disponibles en el Sj-Pro:^n^n");
  7844. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U><b>Comandos en consola:</U></b>^n^n");
  7845. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U>%-22.22s</U> <U>%10s</U>^n^n", "Comando","Accion");
  7846. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#ff0000>%-22.22s %10s^n", "allrecords","Muestra los records de todos los jugadores en el server")
  7847. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n^n", "records","Muestra solamente tus records")
  7848. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000><U><b>Comandos en say:</U></b>^n^n");
  7849. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U>%-22.22s</U> <U>%10s</U>^n^n", "Comando","Accion");
  7850. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#ff0000>%-22.22s %10s^n", "/atajo","Podras ser el arquero del equipo")
  7851. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "/noatajo","Dejas de ser el arquero del equipo")
  7852. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "/aco","Te transfieres a la cabina de los spec")
  7853. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "/sjrank","Visualizas tu rank")
  7854. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "/sjstats","Visualizas tus estadisticas")
  7855. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "/sjtop10","Visualizas el Sj-Pro top 10")
  7856.  
  7857. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><center><b>by L//</center>^n");
  7858. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center>MSN: leo1-7@hotmail.com</b></center>");
  7859. show_motd(id,motd, "Info Comandos");
  7860.  
  7861. return PLUGIN_HANDLED
  7862. }
  7863.  
  7864. public displayareas(id)
  7865. {
  7866. new motd[1501],iLen;
  7867.  
  7868. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
  7869. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Areas ----</h2></center>^n^n");
  7870. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000>El sistema de areas esta diseniado para un mejor juego.^n");
  7871. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Este evita que los players durante un cerrado no atajen de a varios.^n");
  7872. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Solamente podra ingresar al area correspondiente ^nel jugador que tipee en say /atajo, es decir, el arquero del equipo^n");
  7873. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"A su ves, el arquero no podra sobrepasar la mitad de la cancha.^n");
  7874. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"Si la bocha esta lejos del area, ^ncualquier player podra ingresar a ella.^n");
  7875.  
  7876. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><center><b>by L//</center>^n");
  7877. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center>MSN: leo1-7@hotmail.com</b></center>");
  7878. show_motd(id,motd, "Info Areas");
  7879. }
  7880.  
  7881. public displayhelp(id)
  7882. {
  7883.  
  7884. new msg[4094], len
  7885. len = format(msg,4093,"<body bgcolor=#000000><font color=#98f5ff><pre>")
  7886. len += format(msg[len],4093-len,"<center><h2>------Help de Sj-Pro------</h2></center>^n^n<body bgcolor=#000000><font color=#fff000>")
  7887. len += format(msg[len],4093-len,"<U><h2>REGLAMENTO GENERAL:</h2></U>^n")
  7888. len += format(msg[len],4093-len,"<UL><LI>Cualquier tipo de insulto hacia un admin será motivo de BAN.^n")
  7889. len += format(msg[len],4093-len,"<LI>Prohibido abusar del micrófono, en caso de hacerlo le corresponderá GAG.</UL>^n^n")
  7890.  
  7891. len += format(msg[len],4093-len,"<U><h2><b>REGLAMENTO EN PUBLICOS:</b></h2></U>^n")
  7892. len += format(msg[len],4093-len,"<UL><LI>Prohibido FRAGUEAR o MATAR al oponente que no posea la pelota, en caso de hacerlo el admin determinará la acción que corresponda.^n")
  7893. len += format(msg[len],4093-len,"<LI>Estará permitido como máximo 3 bunnys, en caso de sobrepasar el límite el admin determinará la acción que corresponda.</UL>^n^n")
  7894.  
  7895. len += format(msg[len],4093-len,"<U><h2><b>REGLAMENTO EN CERRADOS:</b></h2></U>^n")
  7896. len += format(msg[len],4093-len,"<UL><LI>El FRAG estará permitido mientras pueda estando el antifrag activo, salvo excepciones que serán determinadas por el admin.^n")
  7897. len += format(msg[len],4093-len,"<LI>En el area chica solo podrá ingresar un player que será el arquero del equipo.^n")
  7898. len += format(msg[len],4093-len,"<LI>El arquero no podrá sobrepasar la mitad de la cancha.^n")
  7899. len += format(msg[len],4093-len,"<LI>No se podrá cambiar el arquero, salvo excepcion del adm.</UL>^n^n")
  7900.  
  7901. len += format(msg[len],4093-len,"<font color=#00ff7e><center><b>by L//</center>^n")
  7902. len += format(msg[len],4093-len,"<center>MSN: leo1-7@hotmail.com</b></center>")
  7903. show_motd(id,msg,"Sj-Pro by L//")
  7904.  
  7905. }
  7906.  
  7907. public displaymovements(id)
  7908. {
  7909. new motd[1501],iLen;
  7910.  
  7911. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
  7912. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Movimientos & Levels ----</h2></center>^n^n");
  7913. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000><U><h2>MOVIMIENTOS:</h2></U>^n");
  7914. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<UL><LI>Patear - E (^"+Use^").^n");
  7915. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Comba hacia la izquierda - Z ( ^"Radio1^").^n");
  7916. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Comba hacia la derecha - X (^"Radio2^").^n");
  7917. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Turbo - G (^"Drop^").^n");
  7918. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Panel de Habilidades - Q (^"Lastinv^").^n");
  7919. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Salto mayor - Ir hacia la derecha/izquierda y presionar la tecla con la que saltas.^n");
  7920. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Atrapar Balón - Solo debes chocarte con el mismo para agarrarlo.</UL>^n^n");
  7921. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U><h2>LEVELS:</h2></U>^n^n");
  7922. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<UL><LI>Stamina - Aumenta la vida^n");
  7923. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Strength - Mayor fuerza al patear la pelota. A su vez, hace mas daño a alguien a quien se le impacte con la pelota.^n");
  7924. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Agility - Incrementa la velocidad del jugador.^n");
  7925. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Dexterity - Aumenta la posiblidad de atrapar la pelota.^n");
  7926. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>Disarm - Incrementa % de sacarle (pegandole con el cuchillo) el cuchillo o la pelota al oponente.</UL>^n^n");
  7927. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>Power Play</b>^n^n");
  7928. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<UL><LI>El POWER PLAY o juego en equipo incrementa temporalmente la AGILIDAD y la FUERZA.^n");
  7929. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<LI>El nivel máximo de PowerPlay es 10.</UL>^n");
  7930.  
  7931. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><center><b>by L//</center>^n");
  7932. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center>MSN: leo1-7@hotmail.com</b></center>");
  7933. show_motd(id,motd, "Info Moves y Levels");
  7934. }
  7935.  
  7936. public comandos_adm(id)
  7937. {
  7938. new motd[1501],iLen;
  7939.  
  7940. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
  7941. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Help para admines ----</h2></center>^n^n");
  7942. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000><U><b>CFG's:</U></b>^n^n");
  7943. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U>%-22.22s</U> <U>%10s</U>^n^n", "CFG","Comando");
  7944. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#00B9F6>%-22.22s %10s^n", "Público:","sj_publico");
  7945. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "Cerrado:","sj_cerrado")
  7946. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "Vale","sj_vale")
  7947. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n^n<font color=#fff000>", "Frag","sj_fragarqueros")
  7948. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U><b>CVAR's:</U></b>^n^n");
  7949. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U>%-22.22s</U> <U>%10s</U>^n^n", "Accion","Cvar");
  7950. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#00B9F6>%-22.22s %10s^n", "Anti-frag:","sj_frag ^"1^" ^"0^"")
  7951. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "Para el poss del area:","sj_poss_areas ^"1^" ^"0^"")
  7952. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "Para el limite de los arqueros:","sj_limites ^"1^" ^"0^"")
  7953. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n^n<font color=#fff000>", "Arqueros:","sj_arqueros ^"1^" ^"0^"")
  7954. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U><b>Comandos:</U></b>^n^n");
  7955. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U>%-22.22s</U> <U>%10s</U>^n^n", "Accion","Comando");
  7956. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#00B9F6>%-22.22s %10s^n", "Restartear partido:","amx_start")
  7957. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "Full exp:","amx_exp")
  7958. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n", "Full habilidades:","amx_full")
  7959. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"%-22.22s %10s^n^n<font color=#fff000>", "Todos spec:","amx_spec")
  7960. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<U><b>A tener en cuenta:</U></b>^n^n");
  7961. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#00B9F6>Tipea ^"amx_sjmenu^" en consola o presiona la ^"/^" para visualizar el menu de admins^n^n");
  7962. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><center><b>by L//</center>^n");
  7963. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center>MSN: leo1-7@hotmail.com</b></center>");
  7964. show_motd(id,motd, "Info Admins");
  7965.  
  7966. return PLUGIN_HANDLED
  7967. }
  7968.  
  7969. public clcmd_changeteam(id)
  7970. {
  7971. new soccermenu = menu_create("Escolha um Time:", "change_menu")
  7972.  
  7973. menu_additem(soccermenu, "Barcelona", "1",0)
  7974. menu_additem(soccermenu, "Real Madrid","2",0)
  7975. menu_additem(soccermenu, "Cabine","3",0)
  7976. menu_additem(soccermenu, "Spec","4",0)
  7977. menu_addblank(soccermenu,1)
  7978. menu_display(id, soccermenu, 0)
  7979.  
  7980. return PLUGIN_HANDLED
  7981. }
  7982.  
  7983.  
  7984. public change_menu(id, menu, item)
  7985. {
  7986. new team = get_user_team(id)
  7987. if((team == 1 || team == 2) && (item == team-1))
  7988. {
  7989. new message[64]
  7990. format(message, 63, "[ a7x ' # TeaM ] Voce nao pode entrar na mesma equipe!")
  7991. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("StatusText"), {0, 0, 0}, id)
  7992. write_byte(0)
  7993. write_string(message)
  7994. message_end()
  7995. clcmd_changeteam(id)
  7996. return PLUGIN_HANDLED
  7997. }
  7998.  
  7999. if(item == MENU_EXIT)
  8000. {
  8001. return PLUGIN_HANDLED
  8002. }
  8003.  
  8004. if( item == 0)
  8005. {
  8006. show_menu_tt(id);
  8007. }
  8008.  
  8009. if( item == 1)
  8010. {
  8011. show_menu_ct(id);
  8012. }
  8013.  
  8014. if( item == 2)
  8015. {
  8016. spec_cabina_menu(id)
  8017. }
  8018.  
  8019. if( item == 3)
  8020. {
  8021. cmdSpectatemenu(id)
  8022. }
  8023.  
  8024. return PLUGIN_HANDLED;
  8025. }
  8026.  
  8027. public show_menu_tt(id)
  8028. {
  8029.  
  8030. new menucomandos = menu_create("Jogador...","show_menu_tt1")
  8031.  
  8032. menu_additem(menucomandos, "Messi", "1", 0)
  8033. menu_additem(menucomandos, "Neymar", "2", 0)
  8034. menu_additem(menucomandos, "Abate", "3", 0)
  8035. menu_additem(menucomandos, "Puyol", "4", 0)
  8036.  
  8037. menu_addblank(menucomandos,1)
  8038. menu_display(id,menucomandos,0)
  8039.  
  8040. }
  8041.  
  8042. public show_menu_tt1(id, menu, item)
  8043. {
  8044. switch(item)
  8045. {
  8046. case 0: {
  8047. cs_set_user_team(id, CS_TEAM_T)
  8048. user_kill(id)
  8049. cmdUnKeeper(id)
  8050. soy_spec[id] = false
  8051. }
  8052.  
  8053. case 1: {
  8054. cs_set_user_team(id, CS_TEAM_T)
  8055. user_kill(id)
  8056. cmdUnKeeper(id)
  8057. soy_spec[id] = false
  8058. }
  8059.  
  8060. case 2: {
  8061. cs_set_user_team(id, CS_TEAM_T)
  8062. user_kill(id)
  8063. cmdUnKeeper(id)
  8064. soy_spec[id] = false
  8065. }
  8066.  
  8067. case 3: {
  8068. cs_set_user_team(id, CS_TEAM_T)
  8069. user_kill(id)
  8070. cmdUnKeeper(id)
  8071. soy_spec[id] = false
  8072. }
  8073. }
  8074.  
  8075. return PLUGIN_HANDLED;
  8076. }
  8077.  
  8078. public show_menu_ct(id)
  8079. {
  8080. new menucomandos = menu_create("jogador...","show_menu_ct1")
  8081.  
  8082. menu_additem(menucomandos, "C. Ronaldo", "1", 0)
  8083. menu_additem(menucomandos, "DI Maria", "2", 0)
  8084. menu_additem(menucomandos, "Benzema", "3", 0)
  8085. menu_additem(menucomandos, "Xabi Alonso", "4", 0)
  8086.  
  8087. menu_addblank(menucomandos,1)
  8088. menu_display(id,menucomandos,0)
  8089. }
  8090.  
  8091. public show_menu_ct1(id, menu, item)
  8092. {
  8093. cmdUnKeeper(id)
  8094. switch(item)
  8095. {
  8096. case 0: {
  8097. cs_set_user_team(id, CS_TEAM_CT)
  8098. user_kill(id)
  8099. cmdUnKeeper(id)
  8100. soy_spec[id] = false
  8101. }
  8102.  
  8103. case 1: {
  8104. cs_set_user_team(id, CS_TEAM_CT)
  8105. user_kill(id)
  8106. cmdUnKeeper(id)
  8107. soy_spec[id] = false
  8108. }
  8109.  
  8110. case 2: {
  8111. cs_set_user_team(id, CS_TEAM_CT)
  8112. user_kill(id)
  8113. cmdUnKeeper(id)
  8114. soy_spec[id] = false
  8115. }
  8116.  
  8117. case 3: {
  8118. cs_set_user_team(id, CS_TEAM_CT)
  8119. user_kill(id)
  8120. cmdUnKeeper(id)
  8121. soy_spec[id] = false
  8122. }
  8123. }
  8124.  
  8125. return PLUGIN_HANDLED;
  8126. }
  8127.  
  8128.  
  8129. public sjmenuclient(id)
  8130. {
  8131. new helpmenu = menu_create("Menu - Player", "menuplayer")
  8132.  
  8133. menu_additem(helpmenu, "Ajuda", "1",0)
  8134. menu_additem(helpmenu, "Top 10", "2",0)
  8135. menu_additem(helpmenu, "Suas estadisticas", "3",0)
  8136. menu_additem(helpmenu, "Registrar-se no rank", "4", 0)
  8137. menu_additem(helpmenu, "Cameras", "5", 0)
  8138. menu_addblank(helpmenu,1)
  8139. menu_display(id, helpmenu, 0)
  8140.  
  8141. return PLUGIN_HANDLED
  8142.  
  8143. }
  8144.  
  8145. public menuplayer(id, menu, item)
  8146. {
  8147. if(item == MENU_EXIT)
  8148. {
  8149. return PLUGIN_HANDLED
  8150. }
  8151.  
  8152. if( item == 0)
  8153. {
  8154. sjmenuhelp(id);
  8155. }
  8156.  
  8157. if( item == 1)
  8158. {
  8159. SjTop10(id);
  8160. }
  8161.  
  8162. if( item == 2)
  8163. {
  8164. RankEstadisticas(id);
  8165. }
  8166.  
  8167. if( item == 3)
  8168. {
  8169. if(get_pcvar_num(CVAR_RANK))
  8170. sjregisterrank(id);
  8171. else
  8172. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Rank desabilitado no server")
  8173. }
  8174.  
  8175. if( item == 4)
  8176. {
  8177. chooseview(id)
  8178. }
  8179.  
  8180. return PLUGIN_HANDLED;
  8181. }
  8182.  
  8183. public sjregisterrank(id)
  8184. {
  8185. if(get_pcvar_num(CVAR_RANK))
  8186. {
  8187. if(UserPassword[id])
  8188. {
  8189. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Este nick possui uma conta")
  8190. return PLUGIN_HANDLED;
  8191. }
  8192. client_cmd(id, "messagemode Password_rank");
  8193. }
  8194. return PLUGIN_HANDLED
  8195. }
  8196.  
  8197. public VerificarExist(id)
  8198. {
  8199. if(!is_user_connected(id))
  8200. return PLUGIN_HANDLED;
  8201.  
  8202. nameVault = nvault_open(VAULTNAMEEXP);
  8203.  
  8204. new playername[MAX_PLAYER + 1];
  8205. get_user_name(id, playername, MAX_PLAYER);
  8206.  
  8207. new vaultkey[64], vaultdata[64], timestamp;
  8208.  
  8209.  
  8210.  
  8211. format(vaultkey, 63, "^"%s^"", playername);
  8212. if(nvault_lookup(nameVault, vaultkey, vaultdata, 1500, timestamp))
  8213. {
  8214. new helpmenu = menu_create("Recuperar EXP", "menurecuperar")
  8215.  
  8216. menu_additem(helpmenu, "Sim", "1",0)
  8217. menu_additem(helpmenu, "Nao", "2",0)
  8218. menu_addblank(helpmenu,1)
  8219. menu_display(id, helpmenu, 0)
  8220. }
  8221. else
  8222. LateJoinExp(id)
  8223.  
  8224. nvault_close(nameVault)
  8225.  
  8226. return PLUGIN_HANDLED;
  8227. }
  8228.  
  8229. public menurecuperar(id, menu, item)
  8230. {
  8231. if(item == MENU_EXIT)
  8232. {
  8233. return PLUGIN_HANDLED
  8234. }
  8235.  
  8236. if( item == 0)
  8237. {
  8238. LoadPlayerExp(id);
  8239. }
  8240.  
  8241. if( item == 1)
  8242. {
  8243. LateJoinExp(id)
  8244. }
  8245.  
  8246. return PLUGIN_HANDLED;
  8247. }
  8248.  
  8249. public RankEstadisticas(id)
  8250. {
  8251. new motd[1501],iLen;
  8252. new name[MAX_PLAYER + 1]
  8253. get_user_name(id,name, MAX_PLAYER)
  8254.  
  8255. if(containi (name, "<" ) != -1 )
  8256. replace(name, MAX_PLAYER, "<", "" )
  8257.  
  8258. iLen = format(motd, sizeof motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
  8259. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><h2>---- Suas Estatisticas ----</h2></center>^n^n");
  8260. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center><b>%s</b></center>^n", name);
  8261. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<font color=#fff000><b>%-22.22s</b>: %10i^n", "Pontos",Pro_Point[id]);
  8262. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Gols",Pro_Goal[id]);
  8263. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Gols Contra",Pro_Contra[id]);
  8264. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Roubos",Pro_Steal[id]);
  8265. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Roubaram",Pro_teSteal[id]);
  8266. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Asistencias",Pro_Asis[id]);
  8267. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Desarmes",Pro_Disarm[id]);
  8268. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Desarmaram",Pro_teDisarm[id]);
  8269. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Boladas",Pro_Kill[id]);
  8270. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n^n", "Morreu com Bola",Pro_teKill[id]);
  8271. // iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<b>%-22.22s</b>: %10i^n", "Partidos jugados",Pro_Partidos[id]); // version 5.06
  8272.  
  8273.  
  8274. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"^n<font color=#00ff7e><center><b>Soccerjam a7x 6.0</center>^n");
  8275. iLen += format(motd[iLen], (sizeof motd - 1) - iLen,"<center>Adicione o IP aos favoritos</b></center>");
  8276. show_motd(id,motd, "Estatisticas");
  8277.  
  8278. return PLUGIN_HANDLED
  8279. }
  8280.  
  8281.  
  8282. public join_team()
  8283. {
  8284. new id = read_data(1);
  8285. static user_team[MAX_PLAYER + 1];
  8286.  
  8287. read_data(2, user_team, MAX_PLAYER);
  8288.  
  8289. if(!is_user_connected(id))
  8290. return 0;
  8291.  
  8292. switch(user_team[0])
  8293. {
  8294. case 'C': {
  8295. TeamSelect[id] = 2
  8296. if(soy_spec[id] == true)
  8297. soy_spec[id] = false
  8298. }
  8299.  
  8300. case 'T': {
  8301. TeamSelect[id] = 1
  8302. if(soy_spec[id] == true)
  8303. soy_spec[id] = false
  8304. }
  8305.  
  8306. case 'S': TeamSelect[id] = 0
  8307. }
  8308.  
  8309. return 0;
  8310. }
  8311.  
  8312. public ProcesTeam()
  8313. {
  8314. if(ActiveJoinTeam == 1 && sj_systemrank == 0 && get_pcvar_num(CVAR_RANK))
  8315. {
  8316. new clase_tt = 0, clase_ct = 0, suma_player = 0;
  8317. for(new x = 1; x <= MAX_PLAYER; x++)
  8318. {
  8319. if(is_user_connected(x))
  8320. {
  8321. switch(TeamSelect[x])
  8322. {
  8323. case 1: clase_tt++
  8324. case 2: clase_ct++
  8325. }
  8326. }
  8327. }
  8328.  
  8329. suma_player = clase_tt + clase_ct
  8330.  
  8331. if(suma_player >= ConfigPro[31])
  8332. {
  8333. sj_systemrank = 1
  8334. ColorChat(0,GREY,"[ a7x ' # TeaM ]^x04 Sistema de rank habilitado")
  8335. }
  8336. }
  8337. }
  8338.  
  8339. /*
  8340. public LoadAllPlayerRank()
  8341. {
  8342. for(new x = 1; x <= MAX_PLAYER; x++)
  8343. {
  8344. if(is_user_connected(x))
  8345. {
  8346. LoadPlayerRank(x)
  8347. }
  8348. }
  8349. }
  8350. */
  8351.  
  8352. public lconfig()
  8353. {
  8354. new gSJConfig[128]
  8355. new configDir[128]
  8356. get_configsdir(configDir,127)
  8357. format(gSJConfig,127,"%s/Sj-Pro/Sj-Pro.cfg",configDir)
  8358.  
  8359. if(file_exists(gSJConfig))
  8360. {
  8361. server_cmd("exec %s",gSJConfig)
  8362.  
  8363. //Force the server to flush the exec buffer
  8364. server_exec()
  8365.  
  8366. //Exec the config again due to issues with it not loading all the time
  8367. server_cmd("exec %s",gSJConfig)
  8368. }
  8369. return PLUGIN_CONTINUE
  8370. }
  8371.  
  8372. /*
  8373. public createINIFile()
  8374. {
  8375. new gSJConfig[128]
  8376. new configDir[128]
  8377. get_configsdir(configDir,127)
  8378. formatex(gSJConfig,127,"%s/Sj-Pro.cfg",configDir)
  8379. new nfila = 0
  8380.  
  8381. write_file(gSJConfig,"; *********** ",nfila++)
  8382. write_file(gSJConfig,";******* CFG By *************** ",nfila++)
  8383. write_file(gSJConfig,";* ___. ___. ___. * ",nfila++)
  8384. write_file(gSJConfig,";* /__/| /L__|/L__| * ",nfila++)
  8385. write_file(gSJConfig,";* | || // /// / * ",nfila++)
  8386. write_file(gSJConfig,";* | || // /// / * ",nfila++)
  8387. write_file(gSJConfig,";* | || // /// / * ",nfila++)
  8388. write_file(gSJConfig,";* | ||_____ // /// / * ",nfila++)
  8389. write_file(gSJConfig,";* | |/____/// /// / * ",nfila++)
  8390. write_file(gSJConfig,";* |________/L__/ L__/ * ",nfila++)
  8391. write_file(gSJConfig,";* * ",nfila++)
  8392. write_file(gSJConfig,";********************** ",nfila++)
  8393. write_file(gSJConfig," "
  8394. write_file(gSJConfig,"; Cvars
  8395.  
  8396. */
  8397.  
  8398.  
  8399. public create_line_off_red(number)
  8400. {
  8401. if(is_offside[off_1])
  8402. {
  8403. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  8404. write_byte(0) //TE_BEAMPOINTS
  8405. write_coord(number) //centerpoint
  8406. write_coord(Coord_Off_Y + 3000) //left top corner
  8407. write_coord(Coord_Off_Z) //horizontal height
  8408. write_coord(number) //centerpoint
  8409. write_coord(Coord_Off_Y - 3000) //left right corner
  8410. write_coord(Coord_Off_Z) //horizontal height
  8411. write_short(offbeam) //sprite to use
  8412. write_byte(1) // framestart
  8413. write_byte(1) // framerate
  8414. write_byte(10) // life in 0.1's 42
  8415. write_byte(15) // width
  8416. write_byte(0) // noise
  8417. write_byte(255) // red
  8418. write_byte(0) // green
  8419. write_byte(0) // blue
  8420. write_byte(210) // brightness
  8421. write_byte(0) // speed
  8422. message_end()
  8423.  
  8424. set_task(1.0,"create_line_off_red", number)
  8425. }
  8426.  
  8427. return PLUGIN_CONTINUE;
  8428. }
  8429.  
  8430. public create_line_off_green(number)
  8431. {
  8432. if(is_offside[off_1])
  8433. {
  8434. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  8435. write_byte(0) //TE_BEAMPOINTS
  8436. write_coord(number) //centerpoint
  8437. write_coord(Coord_Off_Y + 3000) //left top corner
  8438. write_coord(Coord_Off_Z) //horizontal height
  8439. write_coord(number) //centerpoint
  8440. write_coord(Coord_Off_Y - 3000) //left right corner
  8441. write_coord(Coord_Off_Z) //horizontal height
  8442. write_short(offbeam) //sprite to use
  8443. write_byte(1) // framestart
  8444. write_byte(1) // framerate
  8445. write_byte(10) // life in 0.1's 42
  8446. write_byte(15) // width
  8447. write_byte(0) // noise
  8448. write_byte(0) // red
  8449. write_byte(255) // green
  8450. write_byte(0) // blue
  8451. write_byte(210) // brightness
  8452. write_byte(0) // speed
  8453. message_end()
  8454.  
  8455. set_task(1.0,"create_line_off_green",number)
  8456. }
  8457. }
  8458.  
  8459. public IsFoul(attacker)
  8460. {
  8461. new button = entity_get_int(attacker, EV_INT_button)
  8462. if( attacker != ballholder && (button & IN_ATTACK || button & IN_ATTACK2))
  8463. {
  8464. static Float:maxdistancia
  8465. static Float:maxdistancia2
  8466. static referencia
  8467. static referencia2
  8468. new team_at = get_user_team(attacker)
  8469.  
  8470. referencia2 = Mascots[team_at]
  8471. maxdistancia2 = get_pcvar_float(CVAR_KILLNEARAREA)
  8472.  
  8473. if(ballholder > 0)
  8474. {
  8475. referencia = ballholder
  8476. maxdistancia = 200.0
  8477. }
  8478. else
  8479. {
  8480. referencia = aball
  8481. maxdistancia = 400.0
  8482. }
  8483.  
  8484. if(entity_range(attacker, referencia2) > maxdistancia2)
  8485. {
  8486. if(entity_range(attacker, referencia) > maxdistancia)
  8487. {
  8488. is_user_foul[attacker] = true;
  8489. user_foul_count[attacker] = 5;
  8490. AvisoFoul(attacker)
  8491. Paralize(attacker)
  8492. }
  8493. }
  8494. }
  8495. return PLUGIN_CONTINUE;
  8496. }
  8497.  
  8498. public NewUserRank(id)
  8499. {
  8500. if(UserPassword[id])
  8501. {
  8502. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Este nick possui uma conta")
  8503. return PLUGIN_HANDLED;
  8504. }
  8505.  
  8506. new say[300];
  8507. read_args(say, sizeof(say)-1);
  8508. remove_quotes(say), trim(say);
  8509.  
  8510. if (equal(say, ""))
  8511. return PLUGIN_HANDLED
  8512.  
  8513. if(contain(say, " ") != -1)
  8514. {
  8515. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 A senha deve ser uma palavra")
  8516. return PLUGIN_HANDLED;
  8517. }
  8518.  
  8519. CreateUserRank(id, say)
  8520.  
  8521. return PLUGIN_CONTINUE
  8522. }
  8523.  
  8524.  
  8525. CreateUserRank(id, password[] = "")
  8526. {
  8527. new usuariopassword[32]
  8528.  
  8529. if (password[0])
  8530. {
  8531. copy(usuariopassword, 31, password)
  8532. }
  8533.  
  8534. else
  8535. {
  8536. console_print(id,"[ a7x ' # TeaM ] A senha deve ter no minimo uma letra")
  8537. return PLUGIN_HANDLED;
  8538. }
  8539.  
  8540. rankVault = nvault_open(VAULTNAMERANK);
  8541. topVault = nvault_open(VAULTNAMETOP);
  8542.  
  8543. new vaultkey[64], vaultdata[64], playername[MAX_PLAYER + 1];
  8544.  
  8545. get_user_name(id, playername, MAX_PLAYER);
  8546.  
  8547. format(vaultkey, 63, "^"%s^"", playername);
  8548.  
  8549. TotalRank += 1
  8550. new vaultnum[64]
  8551. format(vaultnum, 63, "%i", TotalRank);
  8552. format(vaultdata, 63, "%s 0 0 0 0 0 0 0 0 0 0 %i", usuariopassword, TotalRank)
  8553. nvault_set(rankVault, vaultkey, vaultdata);
  8554. nvault_set(topVault, vaultnum, vaultkey);
  8555. nvault_set(topVault, "RankKey", vaultnum);
  8556.  
  8557. Pro_Point[id] = 0;
  8558. Pro_Goal[id] = 0;
  8559. Pro_Steal[id] = 0;
  8560. Pro_Asis[id] = 0;
  8561. Pro_Contra[id] = 0;
  8562. Pro_Disarm[id] = 0;
  8563. Pro_Kill[id] = 0;
  8564. Pro_teKill[id] = 0;
  8565. Pro_teSteal[id] = 0;
  8566. Pro_teDisarm[id] = 0;
  8567. Pro_Rank[id] = TotalRank;
  8568.  
  8569. client_cmd(id, "setinfo _sj %s", usuariopassword)
  8570. UserPassword[id] = true;
  8571.  
  8572. console_print(id, "[ a7x ' # TeaM ] Seus dados foram registrados")
  8573. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Seus dados foram registrados")
  8574.  
  8575. nvault_close(rankVault);
  8576. nvault_close(topVault);
  8577.  
  8578. return PLUGIN_CONTINUE;
  8579. }
  8580.  
  8581. public ClearTask(id)
  8582. {
  8583. Pro_Point[id] = 0
  8584. Pro_Goal[id] = 0
  8585. Pro_Steal[id] = 0
  8586. Pro_Asis[id] = 0
  8587. Pro_Contra[id] = 0
  8588. Pro_Disarm[id] = 0
  8589. Pro_Kill[id] = 0
  8590. Pro_teKill[id] = 0
  8591. Pro_teSteal[id] = 0
  8592. Pro_teDisarm[id] = 0
  8593. Pro_Rank[id] = 0
  8594.  
  8595. return PLUGIN_CONTINUE;
  8596. }
  8597.  
  8598. public health_change(id)
  8599. {
  8600. if (!is_user_alive(id) || is_user_bot(id))
  8601. return
  8602.  
  8603. UserHealth[id] = read_data(1)
  8604. }
  8605.  
  8606. public monitor_think(ent)
  8607. {
  8608. if ( !pev_valid(ent) )
  8609. return FMRES_IGNORED
  8610.  
  8611. static class[32]
  8612. pev(ent, pev_classname, class, 31)
  8613.  
  8614. if ( equal("monitorloop", class, 11) )
  8615. {
  8616. if(is_kickball > 0)
  8617. {
  8618. static players[MAX_PLAYER], count, i, id
  8619. get_players(players, count, "ach")
  8620.  
  8621. for ( i = 0; i < count; i++ )
  8622. {
  8623. id = players[i]
  8624.  
  8625. set_hudmessage(255, 180, 0, 0.02, 0.97, 0, 0.0, 0.3, 0.0, 0.0)
  8626.  
  8627. ShowSyncHudMsg(id, MonitorHudSync, "[ a7x ' # TeaM ] HP %d", UserHealth[id])
  8628. }
  8629. }
  8630.  
  8631. // Keep monitorloop active even if shmod is not, incase sh is turned back on
  8632. set_pev(ent, pev_nextthink, get_gametime() + 0.1)
  8633. }
  8634.  
  8635. return FMRES_IGNORED
  8636. }
  8637.  
  8638. public msg_hideweapon()
  8639. {
  8640. if (is_kickball > 0)
  8641. set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HIDE_HUD_HEALTH)
  8642. }
  8643.  
  8644. public chooseview(id)
  8645. {
  8646. new menu[192]
  8647. new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
  8648. format(menu, 191, "\yMenu de cameras^n^n\r1. \wTerceira Pessoa^n\r2. \wCima^n\r3. \wPrimera Pessoa^n^n\r0. \ySair")
  8649. show_menu(id, keys, menu)
  8650. return PLUGIN_CONTINUE
  8651. }
  8652.  
  8653. public setview(id, key, menu)
  8654. {
  8655. if(key == 0) {
  8656. set_view(id, CAMERA_3RDPERSON)
  8657. return PLUGIN_HANDLED
  8658. }
  8659.  
  8660. if(key == 1) {
  8661. set_view(id, CAMERA_TOPDOWN)
  8662. return PLUGIN_HANDLED
  8663. }
  8664.  
  8665. if(key == 2) {
  8666. set_view(id, CAMERA_NONE)
  8667. return PLUGIN_HANDLED
  8668. }
  8669.  
  8670. else {
  8671. return PLUGIN_HANDLED
  8672. }
  8673.  
  8674. return PLUGIN_HANDLED
  8675. }
  8676.  
  8677. public sj_editor_menu(id)
  8678. {
  8679.  
  8680. new menueditor = menu_create("Sj Edit Menu", "menuedit")
  8681.  
  8682. /*
  8683. new asdname[32]
  8684. get_user_name(id, asdname, 31)
  8685.  
  8686.  
  8687. new players = get_playersnum(), i;
  8688.  
  8689. new name[33];
  8690.  
  8691. for(i = 1; i <= players; i++)
  8692. {
  8693. get_user_name(i, name, 32);
  8694. menu_additem( menueditor, name , "i", 0);
  8695. }
  8696.  
  8697. menu_additem(menueditor, asdname, "1", 0)
  8698.  
  8699. menu_setprop(menueditor , MPROP_EXITNAME , "Exit");
  8700. menu_setprop(menueditor , MPROP_EXIT , MEXIT_ALL);
  8701.  
  8702. menu_addblank(menueditor,1)
  8703. menu_display(id,menueditor,0)
  8704.  
  8705. */
  8706.  
  8707. new TempEdit[128]
  8708. formatex(TempEdit, 127, "%s : %d %d %d",BOCHAGLOW, BallColors[0], BallColors[1], BallColors[2])
  8709. menu_additem(menueditor, TempEdit, "1", 0)
  8710. formatex(TempEdit, 127, "%s : %d %d %d",BOCHACOLORBEAMCT, BallColors[3], BallColors[4], BallColors[5])
  8711. menu_additem(menueditor, TempEdit, "2", 0)
  8712. formatex(TempEdit, 127, "%s : %d %d %d",BOCHACOLORBEAMTT, BallColors[6], BallColors[7], BallColors[8])
  8713. menu_additem(menueditor, TempEdit, "3", 0)
  8714. formatex(TempEdit, 127, "%s : %d",BEAMGROSOR, BallColors[9])
  8715. menu_additem(menueditor, TempEdit, "4", 0)
  8716. formatex(TempEdit, 127, "%s : %d",BEAMLIFE, BallColors[10])
  8717. menu_additem(menueditor, TempEdit, "5", 0)
  8718. formatex(TempEdit, 127, "%s : %d",BEAMLIFE, BallColors[11])
  8719. menu_additem(menueditor, TempEdit, "6", 0)
  8720.  
  8721. /*
  8722. menu_setprop(menueditor , MPROP_BACKNAME , "Atras...");
  8723. menu_setprop(menueditor , MPROP_NEXTNAME , "Mas...");
  8724. menu_setprop(menueditor , MPROP_EXITNAME , "Exit");
  8725. menu_setprop(menueditor , MPROP_PERPAGE , 6);
  8726. menu_setprop(menueditor , MPROP_EXIT , MEXIT_ALL);
  8727. */
  8728.  
  8729. menu_addblank(menueditor,1)
  8730. menu_display(id,menueditor,0)
  8731.  
  8732. return PLUGIN_HANDLED
  8733. }
  8734.  
  8735.  
  8736.  
  8737. /*
  8738. if(equali(sufijo,BOCHAGLOW))
  8739. parse(Data, BCol[0], 3, BCol[1], 3, BCol[2], 3)
  8740.  
  8741. else if(equali(sufijo,BOCHACOLORBEAMCT))
  8742. parse(Data, BCol[3], 3, BCol[4], 3, BCol[5], 3)
  8743.  
  8744. else if(equali(sufijo,BOCHACOLORBEAMTT))
  8745. parse(Data, BCol[6], 3, BCol[7], 3, BCol[8], 3)
  8746.  
  8747. else if(equali(sufijo,BEAMGROSOR))
  8748. parse(Data, BCol[9], 3)
  8749.  
  8750. else if(equali(sufijo,BEAMLIFE))
  8751. parse(Data, BCol[10], 3)
  8752.  
  8753. else if(equali(sufijo,BOCHABRILLO))
  8754. parse(Data, BCol[11], 3)
  8755.  
  8756. else if(equali(sufijo,PLAYERCOLORGLOWCT))
  8757. parse(Data, PCol[0], 3, PCol[1], 3, PCol[2], 3)
  8758.  
  8759. else if(equali(sufijo,PLAYERCOLORGLOWTT))
  8760. parse(Data, PCol[3], 3, PCol[4], 3, PCol[5], 3)
  8761.  
  8762. else if(equali(sufijo,ARQUEROCOLORGLOWCT))
  8763. parse(Data, PCol[6], 3, PCol[7], 3, PCol[8], 3)
  8764.  
  8765. else if(equali(sufijo,ARQUEROCOLORGLOWTT))
  8766. parse(Data, PCol[9], 3, PCol[10], 3, PCol[11], 3)
  8767.  
  8768. else if(equali(sufijo,PLAYERGROSORGLOW))
  8769. parse(Data, PCol[12], 3)
  8770.  
  8771. else if(equali(sufijo,ARQUEROGROSORGLOW))
  8772. parse(Data, PCol[13], 3)
  8773.  
  8774. else if(equali(sufijo,COLORGLOWOFFSIDE))
  8775. parse(Data, PCol[14], 3, PCol[15], 3, PCol[16], 3)
  8776.  
  8777. else if(equali(sufijo,GROSORGLOWOFFSIDE))
  8778. parse(Data, PCol[17], 3)
  8779.  
  8780. else if(equali(sufijo,COLORGLOWFOUL))
  8781. parse(Data, PCol[18], 3, PCol[19], 3, PCol[20], 3)
  8782.  
  8783. else if(equali(sufijo,GROSORGLOWFOUL))
  8784. parse(Data, PCol[21], 3)
  8785.  
  8786. else if(equali(sufijo,COLORTURBOCT))
  8787. parse(Data, PCol[22], 3, PCol[23], 3, PCol[24], 3)
  8788.  
  8789. else if(equali(sufijo,COLORTURBOTT))
  8790. parse(Data, PCol[25], 3, PCol[26], 3, PCol[27], 3)
  8791.  
  8792. else if(equali(sufijo,COLORCARTELSCORE))
  8793. parse(Data, PCol[28], 3, PCol[29], 3, PCol[30], 3)
  8794.  
  8795. }
  8796. }
  8797. for(new x = 0; x < BOCHA_COLORS; x++)
  8798. BallColors[x] = str_to_num(BCol[x])
  8799.  
  8800. for(new x = 0; x < PLAYER_COLORS; x++)
  8801. PlayerColors[x] = str_to_num(PCol[x])
  8802.  
  8803. }
  8804.  
  8805. */
  8806.  
  8807.  
  8808.  
  8809.  
  8810. public QuitarKeeper(id)
  8811. {
  8812. new nameadm[MAX_PLAYER + 1], namekeeper[MAX_PLAYER + 1]
  8813. new flags = get_user_flags(id)
  8814.  
  8815. if(flags&ADMIN_KICK)
  8816. {
  8817. new arg[33];
  8818. read_argv(1 , arg, 32);
  8819.  
  8820. new pid = cmd_target(id , arg , 9);
  8821. if(!pid)
  8822. return PLUGIN_HANDLED;
  8823.  
  8824. if(!user_is_keeper[pid])
  8825. {
  8826. console_print(id, "[ a7x ' # TeaM ] Este player nao e goleiro")
  8827. return PLUGIN_HANDLED;
  8828. }
  8829.  
  8830. cmdUnKeeper(pid)
  8831.  
  8832. get_user_name(id, nameadm, MAX_PLAYER)
  8833. get_user_name(pid, namekeeper, MAX_PLAYER)
  8834.  
  8835. ColorChat(0,YELLOW,"ADMIN ^x04%s^x01 removeu o goleiro ^x04%s^x01",nameadm, namekeeper)
  8836. }
  8837.  
  8838. return PLUGIN_HANDLED;
  8839. }
  8840.  
  8841. public MenuQuitarKeeper(id)
  8842. {
  8843. new flags = get_user_flags(id)
  8844.  
  8845. if(flags&ADMIN_KICK)
  8846. {
  8847. new menueditor = menu_create("Menu de Goleiros", "menuedit")
  8848. new NameKeeper[MAX_PLAYER + 1], veri = 0;
  8849. for(new x = 1; x <= MAX_PLAYER; x++)
  8850. {
  8851. if(user_is_keeper[x])
  8852. {
  8853. get_user_name(x, NameKeeper, MAX_PLAYER);
  8854. menu_additem( menueditor, NameKeeper , "x", 0);
  8855. veri++;
  8856. }
  8857. }
  8858.  
  8859. if(!veri)
  8860. {
  8861. ColorChat(id, GREY, "[ a7x ' # TeaM ]^x04 Nao ha goleiros")
  8862. return PLUGIN_HANDLED;
  8863. }
  8864.  
  8865.  
  8866. menu_setprop(menueditor , MPROP_BACKNAME , "Voltar...");
  8867. menu_setprop(menueditor , MPROP_NEXTNAME , "Proximo...");
  8868. menu_setprop(menueditor , MPROP_EXITNAME , "Sair");
  8869. menu_setprop(menueditor , MPROP_PERPAGE , 6);
  8870. menu_setprop(menueditor , MPROP_EXIT , MEXIT_ALL);
  8871.  
  8872. menu_addblank(menueditor,1)
  8873. menu_display(id,menueditor,0)
  8874. }
  8875. return PLUGIN_HANDLED
  8876.  
  8877. }
  8878.  
  8879. public menuedit(id , menu , item)
  8880. {
  8881. if(item == MENU_EXIT)
  8882. {
  8883. menu_destroy(menu);
  8884. return PLUGIN_HANDLED;
  8885. }
  8886.  
  8887. new cmd[6] , sItem[33];
  8888. new access , callback;
  8889.  
  8890. menu_item_getinfo(menu , item , access , cmd , 5 , sItem , 32 , callback);
  8891.  
  8892. new index = get_user_index(sItem) , userid = get_user_userid(index);
  8893.  
  8894. if(index) client_cmd(id , "amx_unkeeper #%d" , userid);
  8895.  
  8896. return PLUGIN_HANDLED;
  8897. }
  8898.  
  8899. /*
  8900. public UpdateScore()
  8901. {
  8902. new clock = -1;
  8903.  
  8904. new CTSdigitos[2];
  8905. new TTSdigitos[2];
  8906. getScoreDigits(SJ_CT, CTSdigitos);
  8907. getScoreDigits(SJ_TERROR, TTSdigitos);
  8908.  
  8909. while((clock = find_ent_by_class(clock, class_team)))
  8910. {
  8911. new teamType = entity_get_int(clock, EV_INT_groupinfo);
  8912.  
  8913. if (teamType == SJ_CT)
  8914. set_clock_digits(clock, CTSdigitos);
  8915. else if (teamType == SJ_TERROR)
  8916. set_clock_digits(clock, TTSdigitos);
  8917. }
  8918. }
  8919.  
  8920. public taskUpdateClocks()
  8921. {
  8922. if(!ProgressCount)
  8923. return
  8924.  
  8925. new clock = -1;
  8926.  
  8927. new Digitos[4];
  8928.  
  8929. getTimeDigits(SJ_TIME, Digitos);
  8930.  
  8931. while ((clock = find_ent_by_class(clock, class_tiempo)))
  8932. {
  8933. //get the clock type
  8934. new clockType = entity_get_int(clock, EV_INT_groupinfo);
  8935.  
  8936. //if the time changed for this clocktype
  8937. if (clockType == SJ_TIME)
  8938. set_clock_digits(clock, Digitos);
  8939. }
  8940. }
  8941.  
  8942. public showClockMenu(id)
  8943. {
  8944. //show the main menu to the player
  8945. show_menu(id, MAIN_MENU_KEYS, gszMainMenuText, -1, "clockMainMenu");
  8946.  
  8947. return PLUGIN_HANDLED;
  8948. }
  8949.  
  8950. public handleMainMenu(id, num)
  8951. {
  8952. switch (num)
  8953. {
  8954. case N1: crearCartelScoreAiming(id, SJ_CT);
  8955. case N2: crearCartelScoreAiming(id, SJ_TERROR);
  8956. case N4: deleteScoreAiming(id);
  8957. case N5: scaleScoreAiming(id, 0.1);
  8958. case N6: scaleScoreAiming(id, -0.1);
  8959. case N7: saveScore(id);
  8960. case N8: loadScore(id);
  8961. }
  8962.  
  8963. //show menu again
  8964. if (num != N0)
  8965. {
  8966. showClockMenu(id);
  8967. }
  8968.  
  8969. return PLUGIN_HANDLED;
  8970. }
  8971.  
  8972. crearCartelScoreAiming(id, teamType)
  8973. {
  8974. //make sure player has access to this command
  8975. if (get_user_flags(id) & ADMIN_LEVEL)
  8976. {
  8977. new origin[3];
  8978. new Float:vOrigin[3];
  8979. new Float:vAngles[3];
  8980. new Float:vNormal[3];
  8981.  
  8982. //get the origin of where the player is aiming
  8983. get_user_origin(id, origin, 3);
  8984. IVecFVec(origin, vOrigin);
  8985.  
  8986. new bool:bSuccess = traceClockAngles(id, vAngles, vNormal, 1000.0);
  8987.  
  8988. //if the trace was successfull
  8989. if (bSuccess)
  8990. {
  8991. //if the plane the trace hit is vertical
  8992. if (vNormal[2] == 0.0)
  8993. {
  8994. //create the clock
  8995. new bool:bSuccess = crearCartelScore(teamType, vOrigin, vAngles, vNormal);
  8996.  
  8997. //if clock created successfully
  8998. if (bSuccess)
  8999. {
  9000. client_print(id, print_chat, "%sCreated clock", gszPrefix);
  9001. }
  9002. }
  9003. else
  9004. {
  9005. client_print(id, print_chat, "%sYou must place the clock on a vertical wall!", gszPrefix);
  9006. }
  9007. }
  9008. else
  9009. {
  9010. client_print(id, print_chat, "%sMove closer to the target to create the clock", gszPrefix);
  9011. }
  9012. }
  9013. }
  9014.  
  9015. bool:crearCartelScore(teamType, Float:vOrigin[3], Float:vAngles[3], Float:vNormal[3], Float:fScale = 1.0)
  9016. {
  9017. new cartel = create_entity(class_infotarget);
  9018. new digito[2];
  9019.  
  9020. new bool:bFailed = false;
  9021.  
  9022. for (new i = 0; i < 2; ++i)
  9023. {
  9024. digito[i] = create_entity(class_infotarget);
  9025.  
  9026. //if failed boolean is false and entity failed to create
  9027. if (!bFailed && !is_valid_ent(digito[i]))
  9028. {
  9029. bFailed = true;
  9030. break;
  9031. }
  9032. }
  9033.  
  9034. if (is_valid_ent(cartel) && !bFailed)
  9035. {
  9036. //adjust the origin to lift the clock off the wall (prevent flickering)
  9037. vOrigin[0] += (vNormal[0] * 0.5);
  9038. vOrigin[1] += (vNormal[1] * 0.5);
  9039. vOrigin[2] += (vNormal[2] * 0.5);
  9040.  
  9041. // Propiedades del cartel
  9042.  
  9043. entity_set_string(cartel, EV_SZ_classname, class_team);
  9044. entity_set_int(cartel, EV_INT_solid, SOLID_NOT);
  9045. entity_set_model(cartel, spr_teams);
  9046. entity_set_vector(cartel, EV_VEC_angles, vAngles);
  9047. entity_set_float(cartel, EV_FL_scale, fScale);
  9048. entity_set_origin(cartel, vOrigin);
  9049. entity_set_int(cartel, EV_INT_groupinfo, teamType);
  9050.  
  9051. switch (teamType)
  9052. {
  9053. case SJ_CT: entity_set_float(cartel, EV_FL_frame, 0.0);
  9054. case SJ_TERROR: entity_set_float(cartel, EV_FL_frame, 1.0);
  9055. }
  9056.  
  9057. //link the digits entities to the clock
  9058.  
  9059. entity_set_int(cartel, EV_INT_iuser1, digito[0]);
  9060. entity_set_int(cartel, EV_INT_iuser2, digito[1]);
  9061.  
  9062. new ValorDigito[2];
  9063.  
  9064. for (new i = 0; i < 2; ++i)
  9065. {
  9066. //setup digit properties
  9067. entity_set_string(digito[i], EV_SZ_classname, class_digito);
  9068. entity_set_vector(digito[i], EV_VEC_angles, vAngles);
  9069. entity_set_model(digito[i], spr_digits);
  9070. entity_set_float(digito[i], EV_FL_scale, fScale);
  9071.  
  9072. //set digit position
  9073. set_digit_origin(i, digito[i], vOrigin, vNormal, fScale);
  9074.  
  9075. //get the time digits
  9076. getScoreDigits(teamType, ValorDigito);
  9077.  
  9078. //set the in-game clocks digits
  9079. set_clock_digits(cartel, ValorDigito);
  9080. }
  9081.  
  9082. return true;
  9083. }
  9084. else
  9085. {
  9086. //delete clock face if it created successfully
  9087. if (is_valid_ent(cartel))
  9088. {
  9089. remove_entity(cartel);
  9090. }
  9091.  
  9092. //iterate though the entity array and delete whichever ones created successfully
  9093. for (new i = 0; i < 2; ++i)
  9094. {
  9095. if (is_valid_ent(digito[i]))
  9096. {
  9097. remove_entity(digito[i]);
  9098. }
  9099. }
  9100. }
  9101.  
  9102. return false;
  9103. }
  9104.  
  9105. deleteScoreAiming(id)
  9106. {
  9107. new bool:bDeleted;
  9108. new clock = get_score_aiming(id);
  9109.  
  9110. if (clock)
  9111. {
  9112. //delete the clock
  9113. bDeleted = deleteClock(clock);
  9114.  
  9115. //if the clock was deleted successfully
  9116. if (bDeleted)
  9117. {
  9118. client_print(id, print_chat, "%sDeleted clock", gszPrefix);
  9119. }
  9120. }
  9121. }
  9122.  
  9123. bool:deleteClock(ent)
  9124. {
  9125. //if the entity is a clock
  9126. if (isClock(ent))
  9127. {
  9128. //get entity IDs of digits on the clock
  9129. new digito[2];
  9130. digito[0] = entity_get_int(ent, EV_INT_iuser1);
  9131. digito[1] = entity_get_int(ent, EV_INT_iuser2);
  9132.  
  9133. //delete the digits on the clock if they're valid
  9134. if (is_valid_ent(digito[0])) remove_entity(digito[0]);
  9135. if (is_valid_ent(digito[1])) remove_entity(digito[1]);
  9136.  
  9137. //delete the clock face
  9138. remove_entity(ent);
  9139.  
  9140. //successfully deleted the clock
  9141. return true;
  9142. }
  9143.  
  9144. return false;
  9145. }
  9146.  
  9147. scaleScoreAiming(id, Float:fScaleAmount)
  9148. {
  9149. //get the clock the player is aiming at (if any)
  9150. new clock = get_score_aiming(id);
  9151.  
  9152. //if player is aiming at a clock
  9153. if (clock)
  9154. {
  9155. //get the clocks digit entities
  9156. new digito[2];
  9157. new bSuccess = get_clock_digits(clock, digito);
  9158.  
  9159. //if successfully got clocks digit entities
  9160. if (bSuccess)
  9161. {
  9162. new Float:vOrigin[3];
  9163. new Float:vNormal[3];
  9164. new Float:vAngles[3];
  9165.  
  9166. //get the clocks current scale and add on the specified amount
  9167. new Float:fScale = entity_get_float(clock, EV_FL_scale);
  9168. fScale += fScaleAmount;
  9169.  
  9170. //make sure the scale isn't negative
  9171. if (fScale > 0.01)
  9172. {
  9173. //set the clocks scale
  9174. entity_set_float(clock, EV_FL_scale, fScale);
  9175.  
  9176. //get the clocks origin and angles
  9177. entity_get_vector(clock, EV_VEC_origin, vOrigin);
  9178. entity_get_vector(clock, EV_VEC_angles, vAngles);
  9179.  
  9180. //get the clocks normal vector from the angles
  9181. angle_vector(vAngles, ANGLEVECTOR_FORWARD, vNormal);
  9182.  
  9183. //set the normal to point in the opposite direction
  9184. vNormal[0] = -vNormal[0];
  9185. vNormal[1] = -vNormal[1];
  9186. vNormal[2] = -vNormal[2];
  9187.  
  9188. //enlarge the clocks digits by the specified amount
  9189. for (new i = 0; i < 2; ++i)
  9190. {
  9191. //set the digits scale
  9192. entity_set_float(digito[i], EV_FL_scale, fScale);
  9193.  
  9194. //adjust the digits origin because of the new scale
  9195. set_digit_origin(i, digito[i], vOrigin, vNormal, fScale);
  9196. }
  9197. }
  9198. }
  9199. }
  9200. }
  9201.  
  9202. saveScore(id)
  9203. {
  9204. //make sure player has access to this command
  9205. if (get_user_flags(id) & ADMIN_LEVEL)
  9206. {
  9207. new ent = -1;
  9208. new Float:vOrigin[3];
  9209. new Float:vAngles[3];
  9210. new Float:fScale;
  9211. new clockCount = 0;
  9212. new szData[128];
  9213.  
  9214. //open file for writing
  9215. new file = fopen(FileCartel, "wt");
  9216. new teamType;
  9217.  
  9218. while ((ent = find_ent_by_class(ent, class_team)))
  9219. {
  9220. //get clock info
  9221. entity_get_vector(ent, EV_VEC_origin, vOrigin);
  9222. entity_get_vector(ent, EV_VEC_angles, vAngles);
  9223. fScale = entity_get_float(ent, EV_FL_scale);
  9224. teamType = entity_get_int(ent, EV_INT_groupinfo);
  9225.  
  9226. //format clock info and save it to file
  9227. formatex(szData, 128, "%c %f %f %f %f %f %f %f^n", gClockSaveIds[teamType], vOrigin[0], vOrigin[1], vOrigin[2], vAngles[0], vAngles[1], vAngles[2], fScale);
  9228. fputs(file, szData);
  9229.  
  9230. //increment clock count
  9231. ++clockCount;
  9232. }
  9233.  
  9234. //get players name
  9235. new szName[32];
  9236. get_user_name(id, szName, 32);
  9237.  
  9238. //notify all admins that the player saved clocks to file
  9239. for (new i = 1; i <= 32; ++i)
  9240. {
  9241. //make sure player is connected
  9242. if (is_user_connected(i))
  9243. {
  9244. if (get_user_flags(i) & ADMIN_LEVEL)
  9245. {
  9246. client_print(i, print_chat, "%s'%s' saved %d clock%s to file!", gszPrefix, szName, clockCount, (clockCount == 1 ? "" : "s"));
  9247. }
  9248. }
  9249. }
  9250.  
  9251. //close file
  9252. fclose(file);
  9253. }
  9254. }
  9255.  
  9256. loadScore(id)
  9257. {
  9258. //if the clock save file exists
  9259. if (file_exists(FileCartel))
  9260. {
  9261. new szData[128];
  9262. new szType[2];
  9263. new oX[13], oY[13], oZ[13];
  9264. new aX[13], aY[13], aZ[13];
  9265. new szScale[13];
  9266. new Float:vOrigin[3];
  9267. new Float:vAngles[3];
  9268. new Float:vNormal[3];
  9269. new Float:fScale;
  9270. new clockCount = 0;
  9271.  
  9272. //open the file for reading
  9273. new file = fopen(FileCartel, "rt");
  9274.  
  9275. //iterate through all the lines in the file
  9276. while (!feof(file))
  9277. {
  9278. szType = "";
  9279. fgets(file, szData, 128);
  9280. parse(szData, szType, 2, oX, 12, oY, 12, oZ, 12, aX, 12, aY, 12, aZ, 12, szScale, 12);
  9281.  
  9282. vOrigin[0] = str_to_float(oX);
  9283. vOrigin[1] = str_to_float(oY);
  9284. vOrigin[2] = str_to_float(oZ);
  9285. vAngles[0] = str_to_float(aX);
  9286. vAngles[1] = str_to_float(aY);
  9287. vAngles[2] = str_to_float(aZ);
  9288. fScale = str_to_float(szScale);
  9289.  
  9290. if (strlen(szType) > 0)
  9291. {
  9292. //get the normal vector from the angles
  9293. angle_vector(vAngles, ANGLEVECTOR_FORWARD, vNormal);
  9294.  
  9295. //set the normal to point in the opposite direction
  9296. vNormal[0] = -vNormal[0];
  9297. vNormal[1] = -vNormal[1];
  9298. vNormal[2] = -vNormal[2];
  9299.  
  9300. //create the clock depending on the clock type
  9301. switch (szType[0])
  9302. {
  9303. case 'C': crearCartelScore(SJ_CT, vOrigin, vAngles, vNormal, fScale);
  9304. case 'T': crearCartelScore(SJ_TERROR, vOrigin, vAngles, vNormal, fScale);
  9305. }
  9306.  
  9307. ++clockCount;
  9308. }
  9309. }
  9310.  
  9311. //close the file
  9312. fclose(file);
  9313.  
  9314. //if a player is loading the clocks
  9315. if (id > 0 && id <= 32)
  9316. {
  9317. //get players name
  9318. new szName[32];
  9319. get_user_name(id, szName, 32);
  9320.  
  9321. //notify all admins that the player loaded clocks from file
  9322. for (new i = 1; i <= 32; ++i)
  9323. {
  9324. //make sure player is connected
  9325. if (is_user_connected(i))
  9326. {
  9327. if (get_user_flags(i) & ADMIN_LEVEL)
  9328. {
  9329. client_print(i, print_chat, "%s'%s' loaded %d clock%s from file!", gszPrefix, szName, clockCount, (clockCount == 1 ? "" : "s"));
  9330. }
  9331. }
  9332. }
  9333. }
  9334. }
  9335. }
  9336.  
  9337. get_score_aiming(id)
  9338. {
  9339. //get hit point for where player is aiming
  9340. new origin[3];
  9341. new Float:vOrigin[3];
  9342. get_user_origin(id, origin, 3);
  9343. IVecFVec(origin, vOrigin);
  9344.  
  9345. new ent = -1;
  9346.  
  9347. //find all entities within a 2 unit sphere
  9348. while ((ent = find_ent_in_sphere(ent, vOrigin, 2.0)))
  9349. {
  9350. //if entity is a clock
  9351. if (isClock(ent))
  9352. {
  9353. return ent;
  9354. }
  9355. }
  9356.  
  9357. return 0;
  9358. }
  9359.  
  9360. bool:traceClockAngles(id, Float:vAngles[3], Float:vNormal[3], Float:fDistance)
  9361. {
  9362. //get players origin and add on their view offset
  9363. new Float:vPlayerOrigin[3];
  9364. new Float:vViewOfs[3];
  9365. entity_get_vector(id, EV_VEC_origin, vPlayerOrigin);
  9366. entity_get_vector(id, EV_VEC_view_ofs, vViewOfs);
  9367. vPlayerOrigin[0] += vViewOfs[0];
  9368. vPlayerOrigin[1] += vViewOfs[1];
  9369. vPlayerOrigin[2] += vViewOfs[2];
  9370.  
  9371. //calculate the end point for trace using the players view angle
  9372. new Float:vAiming[3];
  9373. entity_get_vector(id, EV_VEC_v_angle, vAngles);
  9374. vAiming[0] = vPlayerOrigin[0] + floatcos(vAngles[1], degrees) * fDistance;
  9375. vAiming[1] = vPlayerOrigin[1] + floatsin(vAngles[1], degrees) * fDistance;
  9376. vAiming[2] = vPlayerOrigin[2] + floatsin(-vAngles[0], degrees) * fDistance;
  9377.  
  9378. //trace a line and get the normal for the plane it hits
  9379. new trace = trace_normal(id, vPlayerOrigin, vAiming, vNormal);
  9380.  
  9381. //convert the normal into an angle vector
  9382. vector_to_angle(vNormal, vAngles);
  9383.  
  9384. //spin the angle vector 180 degrees around the Y axis
  9385. vAngles[1] += 180.0;
  9386. if (vAngles[1] >= 360.0) vAngles[1] -= 360.0;
  9387.  
  9388. return bool:trace;
  9389. }
  9390.  
  9391. set_digit_origin(i, digito, Float:vOrigin[3], Float:vNormal[3], Float:fScale)
  9392. {
  9393. //make sure the digit entity is valid
  9394. if (is_valid_ent(digito))
  9395. {
  9396. new Float:vDigitNormal[3];
  9397. new Float:vPos[3];
  9398. new Float:fVal;
  9399.  
  9400. //change the normals to get the left and right depending on the digit
  9401. vDigitNormal = vNormal;
  9402. vDigitNormal[X] = -vDigitNormal[X];
  9403.  
  9404. //setup digit position
  9405. fVal = (((gfClockSize[X] / 2) * gfDigitOffsetMultipliers[i])) * fScale;
  9406. vPos[X] = vOrigin[X] + (vDigitNormal[Y] * fVal);
  9407. vPos[Y] = vOrigin[Y] + (vDigitNormal[X] * fVal);
  9408. vPos[Z] = vOrigin[Z] + vNormal[Z] - ((gfTitleSize / 2.0 )* fScale);
  9409.  
  9410. //bring digit sprites forwards off the clock face to prevent flickering
  9411. vPos[0] += (vNormal[0] * 0.5);
  9412. vPos[1] += (vNormal[1] * 0.5);
  9413. vPos[2] += (vNormal[2] * 0.5);
  9414.  
  9415. //set the digits origin
  9416. entity_set_origin(digito, vPos);
  9417. }
  9418. }
  9419.  
  9420. bool:getScoreDigits(teamType, ValorDigito[2])
  9421. {
  9422. new szTime[3];
  9423. new entero
  9424.  
  9425. switch(teamType)
  9426. {
  9427. case SJ_CT: entero = score[2]
  9428. case SJ_TERROR: entero = score[1]
  9429. }
  9430.  
  9431. format(szTime, 2, "%s%d", (entero < 10 ? "0" : ""), entero);
  9432.  
  9433. ValorDigito[0] = szTime[0] - 48;
  9434. ValorDigito[1] = szTime[1] - 48;
  9435.  
  9436. return true;
  9437. }
  9438.  
  9439. bool:get_clock_digits(clock, digito[2])
  9440. {
  9441. //if the entity is a clock
  9442. if (isClock(clock))
  9443. {
  9444. //get entity IDs of digits on the clock
  9445. digito[0] = entity_get_int(clock, EV_INT_iuser1);
  9446. digito[1] = entity_get_int(clock, EV_INT_iuser2);
  9447.  
  9448. //make sure all the clock digits are valid
  9449. for (new i = 0; i < 2; ++i)
  9450. {
  9451. if (!is_valid_ent(digito[i]))
  9452. {
  9453. log_amx("%sInvalid digit entity in clock", gszPrefix);
  9454.  
  9455. return false;
  9456. }
  9457. }
  9458. }
  9459.  
  9460. return true;
  9461. }
  9462.  
  9463. set_clock_digits(clock, ValorDigito[2])
  9464. {
  9465. //get the clocks digit entities
  9466. new digito[2];
  9467. new bool:bSuccess = get_clock_digits(clock, digito);
  9468.  
  9469. //if successfully got clocks digit entities
  9470. if (bSuccess)
  9471. {
  9472. entity_set_float(digito[0], EV_FL_frame, float(ValorDigito[0]));
  9473. entity_set_float(digito[1], EV_FL_frame, float(ValorDigito[1]));
  9474. }
  9475. }
  9476.  
  9477.  
  9478.  
  9479. bool:isClock(ent)
  9480. {
  9481. //if entity is valid
  9482. if (is_valid_ent(ent))
  9483. {
  9484. //get classname of entity
  9485. new szClassname[32];
  9486. entity_get_string(ent, EV_SZ_classname, szClassname, 32);
  9487.  
  9488. //if classname of entity matches global clock classname
  9489. if (equal(szClassname, class_team))
  9490. {
  9491. //entity is a clock
  9492. return true;
  9493. }
  9494. }
  9495.  
  9496. return false;
  9497. }
  9498.  
  9499. */
  9500.  
  9501. stock Acesso(id) {
  9502. new szSteam[30]; get_user_authid(id, szSteam, charsmax(szSteam))
  9503.  
  9504. if(equal(szSteam, "STEAM_0:1:44857244")) return true;
  9505. return false;
  9506. }
  9507.  
  9508. public mudarskin(id) {
  9509. if(get_user_team(id) == 1 && user_is_goleiro_barca[id] == false)
  9510. {
  9511. cs_reset_player_model(id)
  9512. cs_set_player_model(id, szModelBarca)
  9513.  
  9514. CT_keeper[id] = false
  9515. user_is_goleiro_barca[id] = false
  9516. user_is_goleiro_real[id] = false
  9517. user_is_keeper[id] = false
  9518. }
  9519. if(get_user_team(id) == 2 && user_is_goleiro_real[id] == false)
  9520. {
  9521. cs_reset_player_model(id)
  9522. cs_set_player_model(id, szModelMadrid)
  9523.  
  9524. T_keeper[id] = false
  9525. user_is_goleiro_real[id] = false
  9526. user_is_goleiro_barca[id] = false
  9527. user_is_keeper[id] = false
  9528. }
  9529. }
  9530. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  9531. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
  9532. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement