· 8 years ago · Aug 07, 2018, 04:14 AM
1/*
2 ======================================================================
3 Hns by heNK' Inspirado en: "Simple Hns by AgustiN"
4 Contenido:
5 - Hook say
6 - Item CVARS ( Add )
7 - Fixed Bugs Say
8 - Fixed Bugs Command
9 ======================================================================
10
11 # Falta Agregar:
12 - Fixed Literna
13 - Fixed Graffitis
14 - Agregar Menú Help
15 - Agregar Menú Principal
16 - Agregar Menú Admin
17 //Ultimo updated 2017-05/20
18
19*/
20
21
22#include < amxmodx >
23#include < amxmisc >
24#include < fun >
25#include < fakemeta >
26#include < cstrike >
27#include < fakemeta_util >
28#include < engine >
29#include < hamsandwich >
30#include < HenkStocks >
31#include < adv_vault >
32
33
34
35new Conteo;
36new g_pCvar_Conteo;
37new g_pCvar_Prefix;
38new g_pCvar_Item_HNS_He, g_pCvar_Item_HNS_Fb, g_pCvar_Item_HNS_Sg;
39
40
41new szPrefix [ 33 ];
42
43new KeysMenu = MENU_KEY_0 | MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6 | MENU_KEY_7 | MENU_KEY_8 | MENU_KEY_9;
44
45enum Compras {
46
47 COMPRAS_ITEM [ 33 ],
48 COMPRAS_COSTO
49
50};
51
52enum ComprasItemCT {
53
54 HE_GRENADE_CT,
55 FROST_GRENADE_CT,
56 DEAGLE_CT,
57 CHALECO_CT,
58 VIDA_CT,
59 REVIVIR_CT,
60 GODMODE_CT,
61 NOCLIP_CT
62
63}
64
65enum ComprasItemTT {
66 CAMUFLAJE_TT,
67 DEAGLE_TT,
68 VIDA_TT,
69 FROST_GRENADE_TT,
70 VELOCIDAD_TT,
71 REVIVIR_TT,
72 GODMODE_TT,
73 NOCLIP_TT
74}
75
76enum ComprasItemGEN {
77 DANIO_GEN,
78 VIDA_GEN,
79 AUTOBUNNY_GEN,
80 GRAVEDAD_GEN
81}
82
83new const szComprasCT [ ] [ Compras ] = {
84 { "He Grenade", 10 },
85 { "Frost Nades", 60 },
86 { "Deagle \y(1Bala)", 45 },
87 { "Chaleco", 25 },
88 { "Vida", 70 },
89 { "Revivir", 300 },
90 { "Godmode \y(5Segundos)", 100 },
91 { "Noclip \y(5Segundos)", 160 }
92};
93
94new const szComprasTT [ ] [ Compras ] = {
95 { "Camuflaje \r(10Segundos)", 60 },
96 { "Deagle \r(2Balas)", 50 },
97 { "Vida", 70 },
98 { "2 Frost Nades", 60 },
99 { "Velocidad \r(15Segundos)", 140 },
100 { "Revivir", 300 },
101 { "Godmode \r(5Segundos)", 100 },
102 { "Noclip \r(5Segundos)", 160 }
103};
104
105new const szComprasGEN [ ] [ Compras ] = {
106 { "Mas Daño \d(1Ronda)", 300 },
107 { "Mas Vida \d(200HP)", 120 },
108 { "Auto-Bunny \d(1Ronda)", 170 },
109 { "Gravedad \d(1Ronda)", 250 }
110};
111
112new const RemoveEntity [ ] [ ] =
113{
114
115 "func_bomb_target",
116 "info_bomb_target",
117 "hostage_entity",
118 "monster_scientist",
119 "func_hostage_rescue",
120 "info_hostage_rescue",
121 "info_vip_start",
122 "func_vip_safetyzone",
123 "func_escapezone",
124 "armoury_entity"
125};
126new const BuyCommands [ ] [ ] =
127{
128 "usp", "glock", "deagle", "p228", "elites",
129 "fn57", "m3", "xm1014", "mp5", "tmp", "p90",
130 "mac10", "ump45", "ak47", "galil", "famas",
131 "sg552", "m4a1", "aug", "scout", "awp", "g3sg1",
132 "sg550", "m249", "vest", "vesthelm", "flash",
133 "hegren", "sgren", "defuser", "nvgs", "shield",
134 "primammo", "secammo", "km45", "9x19mm", "nighthawk",
135 "228compact", "fiveseven", "12gauge", "autoshotgun",
136 "mp", "c90", "cv47", "defender", "clarion", "krieg552",
137 "bullpup", "magnum", "d3au1", "krieg550"
138};
139
140
141new const ComandosABloquear [ ] [ ] = {
142 "kill", "jointeam", "joinclass",
143 "buy", "buyammo1", "buyammo2", "buyequip",
144 "cl_autobuy", "cl_setautobuy", "cl_setrebuy", "cl_rebuy"
145};
146
147//new const szHotmails [ ] [ ] = { "@hotmail.com", "@yahoo.com.ar", "@hotmail.com.ar", "@msn.com.ar", "@gmail.com" };
148//new const szBlockCharacters [ ] [ ] = { "'", "^"", "%", "#", "(", ")", "/" };
149
150
151new g_contra[33][20], g_contra2[33][20], g_cuenta[33][32], g_Fecha[33][32], g_Ip[33][32];
152
153new g_vault;
154new g_Estado[33], g_Can[33], g_AutoLogueo[33]
155
156new g_Experiencia [ 33 ], g_Level [ 33 ], g_Reset [ 33 ];
157
158
159enum {
160 FECHA,
161 PASSWORD,
162 IP,
163 AUTOLOG,
164 LEVEL,
165 EXPERIENCIA,
166 RESET,
167 PUNTOS,
168
169 DATA_M
170};
171
172
173
174enum {
175 NOREGISTRADO = 0,
176 REGISTRADO,
177 LOGUEADO,
178 ESTADOS
179};
180new const Estado[ESTADOS][] = { "Sin Registrar", "Registrado", "Logueado" };
181new g_campo[DATA_M];
182
183new g_Puntos [ 33 ];
184new g_iTienda [ 33 ] [ 32 ];
185
186new g_iSyncHUD;
187
188
189const HNS_TASKID = 1037;
190const TASK_HUD = 2018;
191#define HUD_PRINCIPAL (taskid-TASK_HUD)
192
193
194public plugin_init ( ) {
195 register_plugin ( "[HNS] Hiden Seek", "1.0", "heNK'" );
196
197
198
199 //Hamsandwich
200 RegisterHam ( Ham_Spawn, "player", "HamPlayerSpawned", 1 );
201
202
203 //Events
204 register_event ( "HLTV", "eventRoundStart", "a", "1=0", "2=0" );
205
206 register_event ( "SendAudio", "AntiTerroristWin", "a", "1=0", "2=%!MRAD_ctwin" );
207 register_event ( "SendAudio", "TerroristWin", "a", "1=0", "2=%!MRAD_terwin" );
208
209
210
211 //Forwards
212 register_forward ( FM_CmdStart, "fwdCmdStart", 0 );
213 register_forward ( FM_PlayerPreThink, "fwdPlayerPreThink", 0 );
214 register_forward ( FM_ClientKill, "fwdClientKill" );
215
216 //Block Command
217 for ( new block = 1; block < sizeof ( ComandosABloquear ); block++ )
218 register_clcmd ( ComandosABloquear [ block ], "RegisterCommandBlock" );
219
220
221
222
223
224 register_message ( get_user_msgid ( "ShowMenu" ), "MessageVGUIMenu" );
225 register_message ( get_user_msgid ( "VGUIMenu" ), "MessageVGUIMenu" );
226 register_message ( get_user_msgid ( "StatusIcon" ), "msgStatusIcon" );
227
228
229
230 //Register Command
231 register_clcmd ( "say", "cmdSay" );
232 register_clcmd ( "say /cuenta", "cmdCuenta" );
233 register_clcmd ( "INGRESAR_PASSWORD", "INGRESAR_PASSWORD" );
234 register_clcmd ( "chooseteam", "cmdMenu" );
235
236 //HUDS
237 g_iSyncHUD = CreateHudSyncObj ( );
238
239 //Hookeos
240 register_forward ( FM_ClientUserInfoChanged, "fw_ClientInfoChanged" );
241
242
243 //Register pCvars
244 g_pCvar_Conteo = register_cvar ( "hns_conteo", "10", ADMIN_BAN );
245 g_pCvar_Item_HNS_Fb = register_cvar ( "hns_item_fb", "1", ADMIN_BAN );
246 g_pCvar_Item_HNS_He = register_cvar ( "hns_item_he", "0", ADMIN_BAN );
247 g_pCvar_Item_HNS_Sg = register_cvar ( "hns_item_sg", "1", ADMIN_BAN );
248 g_pCvar_Prefix = register_cvar ( "hns_prefix", "!g[HNS]!y", ADMIN_RCON );
249
250 //ADV VAULT SYSTEM
251 g_vault = adv_vault_open("CuentasHNS", false);
252 g_campo[FECHA] = adv_vault_register_field(g_vault, "FECHA", DATATYPE_STRING, 32);
253 g_campo[PASSWORD] = adv_vault_register_field(g_vault, "PW", DATATYPE_STRING, 20);
254 g_campo[IP] = adv_vault_register_field(g_vault, "IP", DATATYPE_STRING, 32)
255 g_campo[AUTOLOG] = adv_vault_register_field(g_vault, "AUTOLOG")
256 g_campo[LEVEL] = adv_vault_register_field(g_vault, "LEVEL" );
257 g_campo[EXPERIENCIA] = adv_vault_register_field(g_vault, "EXPERIENCIA" );
258 g_campo[RESET] = adv_vault_register_field(g_vault, "RESET" );
259 g_campo[PUNTOS] = adv_vault_register_field(g_vault, "PUNTOS");
260 adv_vault_init(g_vault);
261
262
263}
264
265
266public plugin_natives ( ) {
267
268 register_native ( "hns_set_xp", "native_hns_set_xp", 1 );
269 register_native ( "hns_set_nivel", "native_hns_set_nivel", 1 );
270}
271
272
273
274public plugin_cfg ( ) {
275
276 new iConfig [ 33 ];
277 get_configsdir ( iConfig, 32 );
278
279
280 get_pcvar_string ( g_pCvar_Prefix, szPrefix, 32 );
281
282 server_cmd ( "exec %s/HidenSeek.cfg", iConfig );
283
284}
285
286public client_putinserver ( iIndex ) {
287
288
289 get_user_name ( iIndex, g_cuenta [ iIndex ], sizeof ( g_cuenta ) );
290
291 get_time ( "%c", g_Fecha [ iIndex ], sizeof ( g_Fecha ) );
292
293 g_contra [ iIndex ] [ 0 ] = '^0';
294 g_Estado [ iIndex ] = NOREGISTRADO;
295 g_Experiencia [ iIndex ] = 0;
296 g_Level [ iIndex ] = 1;
297 g_Can [ iIndex ] = 0;
298 g_Reset [ iIndex ] = 0;
299 g_Puntos [ iIndex ] = 0;
300
301
302 set_task ( 6.0, "ClientHUD", iIndex + TASK_HUD, _, _, "b" );
303
304 CheckLevel ( iIndex );
305
306 Cargar ( iIndex );
307
308
309 //set_task ( 0.1, "IngresarTeam", iIndex );
310
311}
312
313
314public ClientHUD ( taskid ) {
315
316 //set_hudmessage(255, 0, 0, 0.0, 0.0, 0, 6.0, 12.0)
317
318 static iIndex;
319 iIndex = HUD_PRINCIPAL;
320
321 if ( g_Estado [ iIndex ] != LOGUEADO )
322 return;
323
324
325
326
327 set_hudmessage ( 210, 127, 210, 0.0, 0.0, 1, 6.0, 12.0 );
328 //ShowSyncHudMsg(id, g_MsgSync_Hud, "Nivel: %d - Reset: %d - Experiencia: %s (%0.2f%%)", p_nivel[id], p_reset[id], addpoints(p_exp[id][EXP_NORMAL]), float(p_exp[id][EXP_LEVEL] * 100) / pExpForNextLevel(id))
329
330 ShowSyncHudMsg ( HUD_PRINCIPAL, g_iSyncHUD, "==================BREAKING GAMING==================^n^t^tTu Cuenta: %s - Puntos: %d^n^t^tNivel: %d - ^t^tExperiencia: %s (%0.2f%%)^n==================BREAKING GAMING==================^n", g_cuenta [ iIndex ], g_Puntos [ iIndex ], g_Level [ iIndex ], AddComas ( g_Experiencia [ iIndex ] ), float ( g_Experiencia [ iIndex ] * 100 ) / ExpForNextLevel ( iIndex ) );
331
332 //ShowSyncHudMsg ( HUD_PRINCIPAL, g_iSyncHUD, "==================BREAKING GAMING==================^n^t^tTu Cuenta: %s - Puntos: %d^n^t^tNivel: %d - ^t^tExperiencia: %s^n==================BREAKING GAMING==================^n", g_cuenta [ iIndex ], g_Puntos [ iIndex ], g_Level [ iIndex ], AddComas ( g_Experiencia [ iIndex ] ) );
333
334}
335
336public cmdCuenta ( id ) {
337
338 new Tit[128], Msg[128]
339 formatex(Tit, charsmax(Tit), "Sistema de cuentas by \dkikizon^n\wBienvenido \r%s^n\wESTADO: \r%s^n\wTu ultima visita fue: \r%s", g_cuenta[id], Estado[g_Estado[id]], g_Fecha[id]);
340
341 new menu = menu_create(Tit,"HandlerCuentasMenu");
342
343 menu_additem(menu, (g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault, _, g_cuenta[id]))?"Loguearse":"\dLoguearse", "1");
344 menu_additem(menu, (g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault, _, g_cuenta[id]))?"Registrarse^n":"\dRegistrarse^n", "2");
345 menu_additem(menu, (g_Estado[id] == LOGUEADO && !g_Can[id])?"Cambiar Contra^n":"\dCambiar Contra^n", "3");
346
347 formatex(Msg, charsmax(Msg),"%sAutologueo \d[\r%s\d]", g_Estado[id] == LOGUEADO && adv_vault_get_prepare(g_vault, _, g_cuenta[id])?"\w":"\d", g_AutoLogueo[id]?"SI":"NO")
348 menu_additem(menu, Msg, "4")
349
350 menu_display(id, menu, 0);
351
352}
353
354
355public HandlerCuentasMenu ( id, menu ,item ) {
356
357 if(item == MENU_EXIT) {
358 menu_destroy(menu);
359 return PLUGIN_HANDLED;
360 }
361
362 switch(item) {
363 case 0: {
364 if(g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault, _, g_cuenta[id])) {
365 client_print(id, print_center, "Ingresa tu PASSWORD para entrar a tu cuenta");
366 client_cmd(id,"messagemode INGRESAR_PASSWORD");
367 } else {
368 client_print(id, print_center, "No puedes elegir esta opcion");
369 return PLUGIN_HANDLED;
370 }
371 }
372 case 1: {
373 if(g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault, _, g_cuenta[id])) {
374 client_print(id, print_center, "Ingresa una PASSWORD para crear una cuenta");
375 client_cmd(id,"messagemode INGRESAR_PASSWORD");
376 } else {
377 client_print(id, print_center, "No puedes elegir esta opcion");
378 return PLUGIN_HANDLED;
379 }
380 }
381 case 2: {
382 if(g_Estado[id] == LOGUEADO && !g_Can[id]) {
383 client_print(id, print_center, "Ingresa tu nueva PASSWORD");
384 client_cmd(id,"messagemode INGRESAR_PASSWORD");
385 } else {
386 client_print(id, print_center, "No estas logueado o ya cambiaste tu password durante el mapa");
387 return PLUGIN_HANDLED;
388 }
389 }
390 case 3: {
391 if(g_Estado[id] == LOGUEADO && adv_vault_get_prepare(g_vault, _, g_cuenta[id])) {
392 if(g_AutoLogueo[id]) {
393 g_AutoLogueo[id] = 0
394 cmdCuenta(id)
395 } else {
396 g_AutoLogueo[id] = 1
397 cmdCuenta(id)
398 }
399 } else {
400 client_print(id, print_center, "No puedes elegir esta opcion");
401 return PLUGIN_HANDLED;
402 }
403 }
404 }
405 return PLUGIN_HANDLED;
406}
407
408public Confirmar(id) {
409 new Tit[128];
410 formatex(Tit, charsmax(Tit),"La password sera \r%s^n^n\yConfirmar?", g_contra2[id]);
411
412 new menu = menu_create(Tit,"menu_confirmar");
413
414 menu_additem(menu,"\rSi\w, confirmar","1");
415 menu_additem(menu,"\rNo\w, deseo reescribirla","2");
416
417 menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER);
418
419 menu_display(id, menu, 0);
420}
421public menu_confirmar(id, menu, item) {
422 switch(item) {
423 case 0: {
424 switch(g_Estado[id]) {
425 case LOGUEADO: {
426 copy(g_contra[id], 19 ,g_contra2[id]);
427 Guardar(id);
428 client_print(id, print_center, "Tu password ha sido cambiada satisfactoriamente");
429 g_Can[id] = 1;
430 }
431 case NOREGISTRADO: {
432 client_print(id, print_center, "Tu cuenta ha sido creada satisfactoriamente");
433 copy(g_contra[id], 31, g_contra2[id]);
434 Guardar(id);
435 jTeam(id);
436 }
437 }
438 }
439 case 1: {
440 menu_destroy(menu);
441 client_cmd(id,"messagemode INGRESAR_PASSWORD");
442 if(g_Estado[id] == LOGUEADO)
443 client_print(id, print_center, "Ingresa tu nueva PASSWORD");
444 else
445 client_print(id, print_center, "Ingresa la PASSWORD para tu nueva cuenta");
446 }
447 }
448 return PLUGIN_HANDLED;
449}
450
451public INGRESAR_PASSWORD ( id ) {
452
453 read_args(g_contra[id], charsmax(g_contra));
454 remove_quotes(g_contra[id]);trim(g_contra[id]);
455
456 if(equal(g_contra[id],"") || containi(g_contra[id]," ") != -1 ) {
457 client_print(id, print_center, "Tu password contiene errores");
458 return 1;
459 }
460
461 switch(g_Estado[id]) {
462 case NOREGISTRADO: {
463 client_print(id, print_center, "Confirma tu password para proseguir");
464 copy(g_contra2[id], charsmax(g_contra2), g_contra[id]);
465 Confirmar(id);
466 }
467 case REGISTRADO: {
468 new buffer[40];
469 adv_vault_get_prepare(g_vault, _, g_cuenta[id]);
470 adv_vault_get_field(g_vault, g_campo[PASSWORD], buffer, charsmax(buffer));
471
472 if(equal(buffer, g_contra[id])) {
473 Guardar(id);
474 client_print(id, print_center, "Te logueaste satisfactoriamente en tu cuenta");
475 jTeam(id);
476 } else {
477 cmdCuenta(id);
478 client_print(id, print_center, "Password Incorrecta.");
479 }
480 }
481 case LOGUEADO: {
482 if(g_Can[id]) {
483 client_print(id, print_center, "Ya cambiaste tu contra en este mapa");
484 return PLUGIN_HANDLED;
485 }
486 client_print(id, print_center, "Confirma tu password para cambiarla...");
487 copy(g_contra2[id], charsmax(g_contra2), g_contra[id]);
488 Confirmar(id);
489 }
490 }
491 return PLUGIN_HANDLED;
492
493}
494
495public cmdPuntos ( iIndex) {
496
497 Henk_SayPrint ( iIndex, "%s Tienes %d Puntos", szPrefix, g_Puntos [ iIndex ] );
498
499}
500
501public fw_ClientInfoChanged ( iIndex, iBuffer ) {
502
503 if ( !is_user_connected ( iIndex ) )
504 return FMRES_IGNORED;
505
506
507 if ( g_Estado [ iIndex ] == LOGUEADO ) {
508 new iOldName [ 33 ];
509 engfunc ( EngFunc_InfoKeyValue, iBuffer, "name", iOldName, 32 );
510
511 if ( equal ( iOldName, g_cuenta [ iIndex ] ) )
512 return FMRES_IGNORED;
513
514 set_user_info ( iIndex, "name", g_cuenta [ iIndex ] );
515 client_cmd ( iIndex, "setinfo ^"name^" ^"%s^"", g_cuenta [ iIndex ] );
516
517
518 }
519 return FMRES_IGNORED;
520}
521
522public MessageVGUIMenu(msgid, dest, id) {
523 if(g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault, _, g_cuenta[id])) {
524 if(g_AutoLogueo[id]) {
525 new ip[32];
526 get_user_ip(id, ip, charsmax(ip), 1);
527
528 if(equal(g_Ip[id], ip))
529 set_task(2.0, "jTeam", id)
530 else {
531 client_print(id, print_chat, "Tu ip no es igual a la de tu ultima visita :O");
532 cmdCuenta(id);
533 }
534 } else
535 cmdCuenta(id)
536 } else
537 cmdCuenta(id);
538
539 return 1;
540}
541
542
543public jTeam ( id ) {
544
545 static teammsg_block, teammsg_block_vgui, restore, vgui;
546
547 restore = get_pdata_int(id, 510);
548 vgui = restore & (1<<0);
549
550 if (vgui)
551 set_pdata_int(id, 510, restore & ~(1<<0));
552
553 teammsg_block = get_msg_block(get_user_msgid("ShowMenu"));
554 teammsg_block_vgui = get_msg_block(get_user_msgid("VGUIMenu"));
555
556 set_msg_block(get_user_msgid("ShowMenu"), BLOCK_ONCE);
557 set_msg_block(get_user_msgid("VGUIMenu"), BLOCK_ONCE);
558
559 engclient_cmd(id, "jointeam", "5");
560 engclient_cmd(id, "joinclass", "5");
561
562 set_msg_block(get_user_msgid("ShowMenu"), teammsg_block);
563 set_msg_block(get_user_msgid("VGUIMenu"), teammsg_block_vgui);
564
565 if (vgui)
566 set_pdata_int(id, 510, restore);
567
568 g_Estado[id] = LOGUEADO;
569
570}
571
572public cmdMenu ( iIndex ) {
573
574 if ( g_Estado [ iIndex ] != LOGUEADO && !is_user_connected ( iIndex ) )
575 return PLUGIN_HANDLED;
576
577
578
579
580 new iTitle [ 127 ]; format ( iTitle, sizeof ( iTitle ), "\y[BREAKING GAMING] \wBienvenido \y%s^n\wNivel \y%d \wExperiencia: \y%s", g_cuenta [ iIndex ], g_Level [ iIndex ], AddComas ( str_to_num ( g_Experiencia [ iIndex ] ) ) );
581 //len += formatex(szText[len], charsmax(szText) - len, "\r5. \wReset\d (%0.2f%%)^n^n", (float(p_exp[id][EXP_NORMAL]) * 100.0) / pMaxExp(id, p_reset[id]))//
582 new iReset [ 127 ]; format ( iReset, sizeof ( iReset ), "Reset: \d(%0.2f%%)", (float(g_Experiencia [ iIndex ] ) * 100.0 ) / MaxExp ( iIndex, g_Reset [ iIndex ] ) );
583
584 new iMenu = menu_create ( iTitle, "HandlerMenuPrincipal" );
585
586 menu_additem ( iMenu, "Tienda \y[HNS]" );
587 menu_additem ( iMenu, "Extras" );
588 menu_additem ( iMenu, "Compras" );
589 menu_additem ( iMenu, "Party" );
590 menu_addblank ( iMenu, 0 );
591
592 menu_additem ( iMenu, iReset );
593 menu_additem ( iMenu, "Menu Admin" );
594
595 menu_setprop ( iMenu, MPROP_EXITNAME, "Salir" );
596 menu_setprop ( iMenu, MPROP_NEXTNAME, "Siguiente" );
597 menu_setprop ( iMenu, MPROP_BACKNAME, "Atras" );
598 menu_setprop ( iMenu, MPROP_NUMBER_COLOR, "\y" );
599 menu_display ( iIndex, iMenu );
600
601 return PLUGIN_HANDLED;
602
603}
604
605public HandlerMenuPrincipal ( iIndex, iMenu, iItem ) {
606
607 if ( iItem == MENU_EXIT ) {
608 menu_destroy ( iMenu );
609 return PLUGIN_HANDLED;
610 }
611
612
613 switch ( iItem ) {
614
615 case 0: menu_shop ( iIndex );
616
617 }
618
619
620 return PLUGIN_HANDLED;
621
622}
623
624public menu_shop ( iIndex ) {
625
626 new iMenu = menu_create ( "\y[BREAKING GAMING] \wShop Menu \d[HNS]", "HandlerShopMenu" );
627
628 menu_additem ( iMenu, "Compras \r[TT]" );
629 menu_additem ( iMenu, "Compras \y[CT]" );
630 menu_additem ( iMenu, "Compras \d[GENERALES]" );
631
632 menu_display ( iIndex, iMenu );
633
634}
635
636public HandlerShopMenu ( iIndex, iMenu, iItem ) {
637
638 if ( iItem == MENU_EXIT ) {
639 menu_destroy ( iMenu );
640 return PLUGIN_HANDLED;
641 }
642
643
644 switch ( iItem ) {
645 case 0: menu_compras_tt ( iIndex );
646 case 1: menu_compras_ct ( iIndex );
647 case 2: menu_compras_gen ( iIndex );
648
649 }
650
651 return PLUGIN_HANDLED;
652
653}
654
655public menu_compras_tt ( iIndex ) {
656
657 if ( g_Estado [ iIndex ] != LOGUEADO && !is_user_connected ( iIndex ) )
658 return;
659
660
661 if ( ! ( cs_get_user_team ( iIndex ) == CS_TEAM_T ) ) {
662 Henk_SayPrint ( iIndex, "%s No eres !gTT", szPrefix );
663 return;
664 }
665
666 new iMenu = menu_create ( "\y[BREAKING GAMING] \wCompras \r[TT]", "HandlerComprasTT" );
667
668
669 new iTitle [ 127 ];
670 new iNum [ 22 ];
671
672 for ( new i = 0; i < sizeof ( szComprasTT ); i++ ) {
673
674 if ( g_iTienda [ iIndex ] [ i ] )
675 formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasTT [ i ] [ COMPRAS_ITEM ], szComprasTT [ i ] [ COMPRAS_COSTO ] );
676 else {
677 if ( g_Puntos [ iIndex ] >= szComprasTT [ i ] [ COMPRAS_COSTO ] )
678 formatex ( iTitle, sizeof ( iTitle ), "\y%s \wPuntos: \d%d", szComprasTT [ i ] [ COMPRAS_ITEM ], szComprasTT [ i ] [ COMPRAS_COSTO ] );
679 else
680 formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasTT [ i ] [ COMPRAS_ITEM ], szComprasTT [ i ] [ COMPRAS_COSTO ] );
681 }
682 num_to_str ( i, iNum, 2 );
683 menu_additem ( iMenu, iTitle, iNum );
684 }
685
686 menu_setprop ( iMenu, MPROP_EXITNAME, "Salir" );
687 menu_setprop ( iMenu, MPROP_NEXTNAME, "Siguiente" );
688 menu_setprop ( iMenu, MPROP_BACKNAME, "Atras" );
689 menu_setprop ( iMenu, MPROP_NUMBER_COLOR, "\y" );
690 menu_display ( iIndex, iMenu );
691
692 return;
693}
694
695public HandlerComprasTT ( iIndex, iMenu, iItem ) {
696
697 if ( iItem == MENU_EXIT ) {
698 menu_destroy ( iMenu );
699 return;
700 }
701
702
703 static iHealth;
704 iHealth = get_user_health ( iIndex );
705
706 if ( g_Puntos [ iIndex ] >= szComprasTT [ iItem ] [ COMPRAS_COSTO ] ) {
707 g_Puntos [ iIndex ] -= szComprasTT [ iItem ] [ COMPRAS_COSTO ] ;
708 }
709 else {
710
711 Henk_SayPrint ( iIndex, "%s Te faltan !g%d !ypuntos para comprar !g%s", szPrefix, szComprasTT [ iItem ] [ COMPRAS_COSTO ] - g_Puntos [ iIndex ], szComprasTT [ iItem ] [ COMPRAS_ITEM ] );
712 menu_compras_tt ( iIndex );
713 return;
714
715 }
716
717
718
719 switch ( iItem ) {
720 case CAMUFLAJE_TT: {
721 if ( g_iTienda [ iIndex ] [ 0 ] ) {
722 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
723 g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
724 return;
725 }
726
727 g_iTienda [ iIndex ] [ 0 ] = true;
728 cs_set_user_model ( iIndex, "gsg9" );
729 set_task ( 10.0, "RemoverCamuflaje", iIndex );
730 Henk_SayPrint ( iIndex, "%s Compraste camuflaje durante 10 segundos", szPrefix );
731 }
732 case DEAGLE_TT: {
733 if ( g_iTienda [ iIndex ] [ 1 ] ) {
734 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
735 g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
736 return;
737 }
738
739 g_iTienda [ iIndex ] [ 1 ] = true;
740 give_item ( iIndex, "weapon_deagle" );
741 Henk_SayPrint ( iIndex, "%s Compraste DEAGLE 1 bala", szPrefix );
742
743 }
744 case VIDA_TT: {
745 if ( g_iTienda [ iIndex ] [ 2 ] ) {
746 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
747 g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
748 return;
749 }
750
751 g_iTienda [ iIndex ] [ 2 ] = true;
752 set_user_health ( iIndex, iHealth + 35 );
753 Henk_SayPrint ( iIndex, "%s Se te sumo 35 de vida", szPrefix );
754 }
755 case FROST_GRENADE_TT: {
756 if ( g_iTienda [ iIndex ] [ 3 ] ) {
757 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
758 g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
759 return;
760 }
761
762 g_iTienda [ iIndex ] [ 3 ] = true;
763 give_item ( iIndex, "weapon_smokegrenade" );
764 Henk_SayPrint ( iIndex, "%s Compraste Frost Grenade", szPrefix );
765 }
766 case VELOCIDAD_TT: {
767 if ( g_iTienda [ iIndex ] [ 4 ] ) {
768 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
769 g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
770 return;
771 }
772
773 g_iTienda [ iIndex ] [ 4 ] = true;
774 set_user_maxspeed ( iIndex, 350.0 );
775 set_task ( 15.0, "RemoverVelocidad", iIndex );
776 Henk_SayPrint ( iIndex, "%s Compraste Velocidad", szPrefix );
777 }
778 case REVIVIR_TT: {
779 if ( g_iTienda [ iIndex ] [ 5 ] ) {
780 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
781 g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
782 return;
783 }
784
785 g_iTienda [ iIndex ] [ 5 ] = true;
786 ExecuteHamB ( Ham_CS_RoundRespawn, iIndex );
787 Henk_SayPrint ( iIndex, "%s Reviviste!!", szPrefix );
788 }
789 case GODMODE_TT: {
790 if ( g_iTienda [ iIndex ] [ 6 ] ) {
791 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
792 g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
793 return;
794 }
795 g_iTienda [ iIndex ] [ 6 ] = true;
796 set_user_godmode ( iIndex, 1 );
797 set_task ( 5.0, "RemoverGodmode", iIndex );
798
799 }
800 case NOCLIP_TT: {
801 if ( g_iTienda [ iIndex ] [ 7 ] ) {
802 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
803 g_Puntos [ iIndex ] += szComprasTT [ iItem ] [ COMPRAS_COSTO ];
804 return;
805 }
806
807 g_iTienda [ iIndex ] [ 7 ] = true;
808 set_user_noclip ( iIndex, 1 );
809 set_task ( 5.0, "RemoverNoclip", iIndex );
810 }
811
812
813 }
814
815 return;
816
817}
818
819public menu_compras_ct ( iIndex ) {
820
821 if ( g_Estado [ iIndex ] != LOGUEADO && !is_user_connected ( iIndex ) )
822 return;
823
824
825 if ( ! ( cs_get_user_team ( iIndex ) == CS_TEAM_CT ) ) {
826 Henk_SayPrint ( iIndex, "%s No eres !gCT", szPrefix );
827 return;
828 }
829
830 new iMenu = menu_create ( "\y[BREAKING GAMING] \wCompras \y[CT]", "HandlerComprasCT" );
831
832
833 new iTitle [ 127 ];
834 new iNum [ 22 ];
835
836 for ( new i = 0; i < sizeof ( szComprasCT ); i++ ) {
837
838 if ( g_iTienda [ iIndex ] [ i ] )
839 formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasCT [ i ] [ COMPRAS_ITEM ], szComprasCT [ i ] [ COMPRAS_COSTO ] );
840 else {
841 if ( g_Puntos [ iIndex ] >= szComprasCT [ i ] [ COMPRAS_COSTO ] )
842 formatex ( iTitle, sizeof ( iTitle ), "\y%s \wPuntos: \d%d", szComprasCT [ i ] [ COMPRAS_ITEM ], szComprasCT [ i ] [ COMPRAS_COSTO ] );
843 else
844 formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasCT [ i ] [ COMPRAS_ITEM ], szComprasCT [ i ] [ COMPRAS_COSTO ] );
845 }
846 num_to_str ( i, iNum, 2 );
847 menu_additem ( iMenu, iTitle, iNum );
848 }
849
850 menu_setprop ( iMenu, MPROP_EXITNAME, "Salir" );
851 menu_setprop ( iMenu, MPROP_NEXTNAME, "Siguiente" );
852 menu_setprop ( iMenu, MPROP_BACKNAME, "Atras" );
853 menu_setprop ( iMenu, MPROP_NUMBER_COLOR, "\y" );
854 menu_display ( iIndex, iMenu );
855
856 return;
857}
858
859public HandlerComprasCT ( iIndex, iMenu, iItem ) {
860
861 if ( iItem == MENU_EXIT ) {
862 menu_destroy ( iMenu );
863 return;
864 }
865
866
867 static iHealth, iArmor;
868 iHealth = get_user_health ( iIndex );
869 iArmor = get_user_armor ( iIndex );
870
871 if ( g_Puntos [ iIndex ] >= szComprasCT [ iItem ] [ COMPRAS_COSTO ] ) {
872 g_Puntos [ iIndex ] -= szComprasCT [ iItem ] [ COMPRAS_COSTO ] ;
873 }
874 else {
875
876 Henk_SayPrint ( iIndex, "%s Te faltan !g%d !ypuntos para comprar !g%s", szPrefix, szComprasCT [ iItem ] [ COMPRAS_COSTO ] - g_Puntos [ iIndex ], szComprasCT [ iItem ] [ COMPRAS_ITEM ] );
877 menu_compras_ct ( iIndex );
878 return;
879
880 }
881
882
883 switch ( iItem ) {
884 case HE_GRENADE_CT: {
885 if ( g_iTienda [ iIndex ] [ 0 ] ) {
886 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
887 g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
888 return;
889 }
890
891 g_iTienda [ iIndex ] [ 0 ] = true;
892 give_item ( iIndex, "weapon_hegrenade" );
893 Henk_SayPrint ( iIndex, "%s Compraste una HE Grenade", szPrefix );
894
895 }
896 case FROST_GRENADE_CT: {
897 if ( g_iTienda [ iIndex ] [ 1 ] ) {
898 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
899 g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
900 return;
901 }
902
903 g_iTienda [ iIndex ] [ 1 ] = true;
904 give_item ( iIndex, "weapon_smokegrenade" );
905 Henk_SayPrint ( iIndex, "%s Compraste una Frost Grenade", szPrefix );
906 }
907 case DEAGLE_CT: {
908 if ( g_iTienda [ iIndex ] [ 2 ] ) {
909 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
910 g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
911 return;
912 }
913
914 g_iTienda [ iIndex ] [ 2 ] = true;
915 give_item ( iIndex, "weapon_deagle" );
916 Henk_SayPrint ( iIndex, "%s Compraste una Deagle!", szPrefix );
917 }
918 case CHALECO_CT:{
919 if ( g_iTienda [ iIndex ] [ 3 ] ) {
920 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
921 g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
922 return;
923 }
924
925 g_iTienda [ iIndex ] [ 3 ] = true;
926 set_user_armor ( iIndex, iArmor + 100 );
927 Henk_SayPrint ( iIndex, "%s Compraste chaleco +100", szPrefix );
928 }
929 case VIDA_CT: {
930 if ( g_iTienda [ iIndex ] [ 4 ] ) {
931 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
932 g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
933 return;
934 }
935
936 g_iTienda [ iIndex ] [ 4 ] = true;
937 set_user_armor ( iIndex, iHealth + 40 );
938 Henk_SayPrint ( iIndex, "%s Compraste chaleco +40", szPrefix );
939 }
940 case REVIVIR_CT: {
941 if ( g_iTienda [ iIndex ] [ 5 ] ) {
942 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
943 g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
944 return;
945 }
946
947 g_iTienda [ iIndex ] [ 5 ] = true;
948 ExecuteHamB ( Ham_CS_RoundRespawn, iIndex );
949 Henk_SayPrint ( iIndex, "%s REVIVISTE!!!!", szPrefix );
950 }
951 case GODMODE_CT: {
952 if ( g_iTienda [ iIndex ] [ 6 ] ) {
953 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
954 g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
955 return;
956 }
957
958 g_iTienda [ iIndex ] [ 6 ] = true;
959 set_user_godmode ( iIndex, 1 );
960 set_task ( 5.0, "RemoverGodmode", iIndex );
961 Henk_SayPrint ( iIndex, "%s Compraste Modo Dios(5Segundos)", szPrefix );
962 }
963 case NOCLIP_CT: {
964 if ( g_iTienda [ iIndex ] [ 7 ] ) {
965 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
966 g_Puntos [ iIndex ] += szComprasCT [ iItem ] [ COMPRAS_COSTO ];
967 return;
968 }
969
970 g_iTienda [ iIndex ] [ 7 ] = true;
971 set_user_noclip ( iIndex, 1 );
972 set_task ( 5.0, "RemoverNoclip", iIndex );
973 Henk_SayPrint ( iIndex, "%s Compraste NOCLIP(5Segundos)", szPrefix );
974 }
975
976 }
977 return;
978}
979
980public menu_compras_gen ( iIndex ) {
981 if ( g_Estado [ iIndex ] != LOGUEADO && !is_user_connected ( iIndex ) )
982 return;
983
984 new iMenu = menu_create ( "\y[BREAKING GAMING] \wCompras \d[GENERALES]", "HandlerComprasGEN" );
985
986
987 new iTitle [ 127 ];
988 new iNum [ 22 ];
989
990 for ( new i = 0; i < sizeof ( szComprasGEN ); i++ ) {
991
992 if ( g_iTienda [ iIndex ] [ i ] )
993 formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasGEN [ i ] [ COMPRAS_ITEM ], szComprasGEN [ i ] [ COMPRAS_COSTO ] );
994 else {
995 if ( g_Puntos [ iIndex ] >= szComprasGEN [ i ] [ COMPRAS_COSTO ] )
996 formatex ( iTitle, sizeof ( iTitle ), "\y%s \wPuntos: \d%d", szComprasGEN [ i ] [ COMPRAS_ITEM ], szComprasGEN [ i ] [ COMPRAS_COSTO ] );
997 else
998 formatex ( iTitle, sizeof ( iTitle ), "\d%s \wPuntos: \d%d", szComprasGEN [ i ] [ COMPRAS_ITEM ], szComprasGEN [ i ] [ COMPRAS_COSTO ] );
999 }
1000 num_to_str ( i, iNum, 2 );
1001 menu_additem ( iMenu, iTitle, iNum );
1002 }
1003
1004 menu_setprop ( iMenu, MPROP_EXITNAME, "Salir" );
1005 menu_setprop ( iMenu, MPROP_NEXTNAME, "Siguiente" );
1006 menu_setprop ( iMenu, MPROP_BACKNAME, "Atras" );
1007 menu_setprop ( iMenu, MPROP_NUMBER_COLOR, "\y" );
1008 menu_display ( iIndex, iMenu );
1009
1010 return;
1011}
1012
1013public HandlerComprasGEN ( iIndex, iMenu, iItem ) {
1014
1015 if ( iItem == MENU_EXIT ) {
1016 menu_destroy ( iMenu );
1017 return;
1018 }
1019
1020 if ( g_Puntos [ iIndex ] >= szComprasGEN [ iItem ] [ COMPRAS_COSTO ] ) {
1021 g_Puntos [ iIndex ] -= szComprasGEN [ iItem ] [ COMPRAS_COSTO ] ;
1022 }
1023 else {
1024
1025 Henk_SayPrint ( iIndex, "%s Te faltan !g%d !ypuntos para comprar !g%s", szPrefix, szComprasGEN [ iItem ] [ COMPRAS_COSTO ] - g_Puntos [ iIndex ], szComprasGEN [ iItem ] [ COMPRAS_ITEM ] );
1026 menu_compras_gen ( iIndex );
1027 return;
1028
1029 }
1030
1031 switch ( iItem ) {
1032
1033 case DANIO_GEN: {
1034
1035 }
1036 case VIDA_GEN: {
1037
1038 if ( g_iTienda [ iIndex ] [ 1 ] ) {
1039 Henk_SayPrint ( iIndex, "%s Ya compraste este Item", szPrefix );
1040 g_Puntos [ iIndex ] += szComprasGEN [ iItem ] [ COMPRAS_COSTO ];
1041 return;
1042 }
1043
1044 g_iTienda [ iIndex ] [ 1 ] = true;
1045 set_user_health ( iIndex, 200 );
1046 Henk_SayPrint ( iIndex, "%s Tienes !g200HP", szPrefix );
1047
1048
1049 }
1050 case AUTOBUNNY_GEN: {
1051
1052
1053 }
1054 case GRAVEDAD_GEN: {
1055
1056
1057 }
1058
1059 }
1060
1061 return;
1062}
1063
1064public RemoverCamuflaje ( iIndex ) {
1065 cs_reset_user_model ( iIndex );
1066 Henk_SayPrint ( iIndex, "%s El camuflaje se te termino", szPrefix );
1067
1068}
1069
1070public RemoverVelocidad ( iIndex ) {
1071
1072 set_user_maxspeed ( iIndex, 250.0 );
1073 Henk_SayPrint ( iIndex, "%s La velocidad se te termino", szPrefix );
1074
1075}
1076
1077public RemoverGodmode ( iIndex ) {
1078 set_user_godmode ( iIndex, 0 );
1079 Henk_SayPrint ( iIndex, "%s El Modo Dios se te termino", szPrefix );
1080
1081}
1082
1083public RemoverNoclip ( iIndex ) {
1084 set_user_noclip ( iIndex, 0 );
1085 Henk_SayPrint ( iIndex, "%s El Noclip se te termino", szPrefix );
1086
1087}
1088
1089
1090public fwdClientKill ( ) {
1091
1092 return FMRES_SUPERCEDE;
1093}
1094
1095
1096
1097public plugin_precache ( )
1098 register_forward ( FM_Spawn, "fwdSpawn", 0 );
1099
1100
1101public client_command ( iIndex ) {
1102
1103 new Argv [ 17 ];
1104
1105 read_argv ( 0, Argv, sizeof ( Argv ) );
1106
1107 for ( new i = 0; i < sizeof ( BuyCommands ); i++ ) {
1108 if ( equali ( BuyCommands [ i ], Argv, 0 ) )
1109 return PLUGIN_HANDLED;
1110 }
1111 return PLUGIN_CONTINUE;
1112}
1113
1114
1115
1116
1117
1118public client_disconnect ( iIndex ) {
1119 Guardar ( iIndex );
1120 remove_task ( iIndex + TASK_HUD );
1121}
1122
1123
1124public client_impulse ( iIndex, iImpulse ) {
1125
1126 if ( iImpulse == 101 ) {
1127
1128
1129 Henk_SayPrint ( iIndex, "%s No puedes usar la linterna", szPrefix );
1130
1131 }
1132
1133 if ( iImpulse == 201 ) {
1134
1135 Henk_SayPrint ( iIndex, "%s No puedes hacer graffitis!", szPrefix );
1136
1137
1138 }
1139
1140 return PLUGIN_HANDLED;
1141
1142}
1143
1144
1145public IngresarTeam ( iIndex ) {
1146 engclient_cmd ( iIndex, "jointeam", "5" );
1147 engclient_cmd ( iIndex, "joinclass", "5" );
1148}
1149
1150
1151
1152public msgStatusIcon ( msgId, msgDest, msgEnt ) {
1153
1154 new Icon [ 8 ];
1155 get_msg_arg_string ( 2, Icon, sizeof ( Icon ) );
1156
1157 if ( equal ( Icon, "buyzone" ) ) {
1158 if ( get_msg_arg_int ( 1 ) ) {
1159 set_pdata_int ( msgEnt, 235, get_pdata_int ( msgEnt, 235 ) & ~( 1 << 0 ) );
1160 return PLUGIN_HANDLED;
1161 }
1162 }
1163 return PLUGIN_CONTINUE;
1164}
1165
1166public TerroristWin ( ) {
1167 set_hudmessage ( 255, 0, 0, 0.0, 0.1, 0, 6.0, 12.0 );
1168 show_hudmessage ( 0, "TTs Ganan - Sigue la ronda" );
1169
1170}
1171
1172public AntiTerroristWin ( ) {
1173 set_hudmessage ( 255, 0, 0, 0.0, 0.1, 0, 6.0, 12.0 );
1174 show_hudmessage ( 0, "CTs Ganan - Cambio de Team" );
1175
1176 for ( new iIndex = 0; iIndex < get_maxplayers ( ); iIndex ++ ) {
1177
1178 if ( is_user_connected ( iIndex ) ) {
1179
1180 switch ( cs_get_user_team ( iIndex ) ) {
1181
1182 case CS_TEAM_CT: cs_set_user_team ( iIndex, CS_TEAM_T );
1183 case CS_TEAM_T: cs_set_user_team ( iIndex, CS_TEAM_CT );
1184 }
1185 }
1186 }
1187}
1188
1189
1190
1191public eventRoundStart ( ) {
1192
1193 remove_task ( HNS_TASKID );
1194
1195 Conteo = get_pcvar_num ( g_pCvar_Conteo );
1196
1197 set_task ( 1.0, "ConteoHNS", HNS_TASKID, _, _, "a", g_pCvar_Conteo );
1198
1199}
1200
1201public ConteoHNS ( ) {
1202
1203 Conteo--;
1204
1205 new sSound [ 16 ];
1206 num_to_word ( Conteo, sSound, sizeof ( sSound ) );
1207
1208 set_hudmessage ( 255, 0, 0, 0.0, 0.1, 0, 6.0, 12.0 );
1209
1210 if ( Conteo ) {
1211 show_hudmessage ( 0, "Quedan %d segundo%s", Conteo, Conteo > 1 ? "s" : "" );
1212
1213 client_cmd ( 0, "spk vox/%s.wav", sSound );
1214
1215 for ( new i = 0; i < get_maxplayers ( ); i++ ) {
1216
1217 if ( !is_user_alive ( i ) || cs_get_user_team ( i ) != CS_TEAM_CT )
1218 continue;
1219
1220 ScreenFade ( i, 1.0, 0, 0, 0, 100 );
1221 //ScreenFade ( i, 1.0, 0, 0, 0, 100 );
1222 }
1223 }
1224 else {
1225 remove_task ( HNS_TASKID );
1226 show_hudmessage ( 0, "Tiempo terminado" );
1227
1228 for ( new i = 0; i < get_maxplayers ( ); i++ ) {
1229 SetWeapons ( i );
1230
1231
1232
1233 if ( !is_user_alive ( i ) || cs_get_user_team ( i ) != CS_TEAM_CT )
1234 continue;
1235
1236
1237 engfunc ( EngFunc_SetClientMaxspeed, i, 250.0 );
1238 set_pev ( i, pev_maxspeed, 250.0 );
1239 }
1240 }
1241}
1242
1243
1244public SetWeapons ( iIndex ) {
1245
1246 if ( is_user_alive ( iIndex ) ) {
1247
1248 if ( cs_get_user_team ( iIndex ) == CS_TEAM_T ) {
1249
1250 if ( get_pcvar_num ( g_pCvar_Item_HNS_Fb ) )
1251 fm_give_item ( iIndex, "weapon_flashbang" );
1252
1253 if ( get_pcvar_num ( g_pCvar_Item_HNS_He ) )
1254 fm_give_item ( iIndex, "weapon_hegrenade" );
1255
1256 if ( get_pcvar_num ( g_pCvar_Item_HNS_Sg ) )
1257 fm_give_item ( iIndex, "weapon_smokegrenade" );
1258 }
1259 }
1260
1261}
1262
1263
1264public HamPlayerSpawned ( iIndex ) {
1265 if ( is_user_alive ( iIndex ) ) {
1266
1267 fm_strip_user_weapons ( iIndex );
1268 fm_give_item ( iIndex, "weapon_knife" );
1269
1270 }
1271}
1272
1273//Gonza.-*
1274public fwdCmdStart ( id, ucHandle, seed )
1275{
1276
1277 if (get_user_weapon(id) != CSW_KNIFE) return FMRES_IGNORED
1278
1279 static CsTeams:team, button; team = cs_get_user_team(id); button = get_uc(ucHandle, UC_Buttons);
1280 //static CsTeams:team[33]; team[id] = cs_get_user_team(id)
1281
1282 if ( team == CS_TEAM_T )
1283 {
1284 if (button&IN_ATTACK) button &= ~IN_ATTACK
1285
1286 if (button&IN_ATTACK2) button &= ~IN_ATTACK2
1287
1288 set_uc(ucHandle, UC_Buttons, button)
1289
1290 return FMRES_SUPERCEDE
1291 }
1292
1293 else if (team == CS_TEAM_CT )
1294 {
1295 if (button&IN_ATTACK) button |= IN_ATTACK2
1296
1297 set_uc(ucHandle, UC_Buttons, button)
1298
1299 return FMRES_SUPERCEDE
1300 }
1301 return FMRES_IGNORED
1302}
1303
1304
1305
1306public fwdSpawn(ent) {
1307 if( !pev_valid(ent) || ent == engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "hostage_entity")))
1308 return FMRES_IGNORED;
1309
1310 new sClass[32];
1311 pev(ent, pev_classname, sClass, 31);
1312
1313 for( new i = 0; i < sizeof(RemoveEntity); i++) {
1314 if( equal(sClass, RemoveEntity[i])) {
1315 engfunc(EngFunc_RemoveEntity, ent);
1316 return FMRES_SUPERCEDE;
1317 }
1318 }
1319
1320 return FMRES_IGNORED;
1321}
1322
1323public fwdPlayerPreThink ( iIndex ) {
1324 if ( is_user_alive ( iIndex ) ) {
1325 if ( Conteo >= 1 && cs_get_user_team ( iIndex ) == CS_TEAM_CT ) {
1326 set_pev ( iIndex, pev_maxspeed, -1.0);
1327 set_pev ( iIndex, pev_velocity, Float:{0.0, 0.0, 0.0} );
1328 }
1329 }
1330}
1331
1332
1333public RegisterCommandBlock ( iIndex ) {
1334
1335 console_print ( iIndex, "No puedes hacer esto..." );
1336
1337
1338 return PLUGIN_HANDLED;
1339
1340}
1341
1342public cmdSay ( iIndex ) {
1343
1344 new Say [ 192 ];
1345 read_args ( Say, sizeof ( Say ) );
1346 remove_quotes ( Say );
1347
1348
1349
1350 //Valid Message
1351
1352
1353 if ( Say [ 0 ] == '#' || Say [ 0 ] == '%' || equal ( Say, "" ) )
1354 return PLUGIN_HANDLED;
1355
1356
1357
1358
1359
1360 if ( equal ( Say, "/menu" ) || equal ( Say, "menu" ) ) cmdMenu ( iIndex );
1361 else if ( equal ( Say, "/puntos" ) ) cmdPuntos ( iIndex );
1362
1363 new Prefix [ 256 ];
1364 new Color [ 11 ];
1365 get_user_team ( iIndex, Color, sizeof ( Color ) );
1366
1367
1368
1369 //formatex ( Prefix, sizeof ( Prefix ), "%s%s^x03 %s", is_user_alive ( iIndex ) ? "^x01" : "^x01*MUERTO* ", is_user_admin ( iIndex ) ? "^x04[ADMIN]" : "", g_PlayerName [ iIndex ] );
1370
1371 formatex ( Prefix, sizeof ( Prefix ), "%s^x03%s ^x04%s^x03(^x04%d^x03)", is_user_alive ( iIndex ) ? "^x01" : "^x01*MUERTO* ", g_cuenta [ iIndex ], g_Reset [ iIndex ], g_Level [ iIndex ] );
1372
1373
1374 //formatex ( Prefix, sizeof ( Prefix ), "%s^x03 %s", is_user_alive ( iIndex ) ? "^x01" : "^x01*MUERTO* ", g_PlayerName [ iIndex ] );
1375
1376
1377 if ( is_user_admin ( iIndex ) )
1378 format ( Say, sizeof ( Say ), "^x04%s", Say );
1379
1380
1381 format ( Say, sizeof ( Say ), "%s^x01 : %s", Prefix, Say );
1382
1383
1384 new team [ 11 ];
1385 for ( new i = 1; i <= get_maxplayers ( ); i++ ) {
1386 if ( is_user_connected ( i ) ) {
1387
1388 if ( is_user_admin ( i ) || is_user_alive ( iIndex ) && is_user_alive ( i ) || !is_user_alive ( iIndex ) && !is_user_alive ( i ) ) {
1389
1390 get_user_team ( i, team, 10 );
1391
1392 changeTeamInfo ( i, Color) ;
1393
1394 writeMessage ( i, Say );
1395
1396 changeTeamInfo ( i, team );
1397
1398
1399 /*
1400 message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "SayText" ), _, i );
1401 write_byte ( iIndex );
1402 write_string ( Say );
1403 message_end ( );
1404 */
1405
1406 }
1407 }
1408 }
1409
1410 //return PLUGIN_HANDLED;
1411
1412 return PLUGIN_HANDLED_MAIN;
1413}
1414
1415public MaxLevel(index) return (245 + (g_Reset[index] * 50))
1416
1417public Float:MaxExp(index, reset)
1418{
1419 static i, Float:level, count, Float:MaxCount; count = 1; MaxCount = 0.0; level = 0.0
1420
1421 for (i = 0; i < MaxLevel(index); i++)
1422 {
1423 if (i % 40) level++
1424
1425 else
1426 {
1427 count++
1428 level++
1429 }
1430 MaxCount += ((250.1 + ((reset+1) * 50.2)) * level * count)
1431 }
1432
1433 return MaxCount
1434}
1435
1436public Float:ExpForNextLevel(index)
1437{
1438 static i, Float:count; count = 1.0
1439
1440 for (i = 0; i < MaxLevel(index); i++)
1441 {
1442 if (i >= g_Level[index]) break
1443
1444 if (i == 0) continue
1445
1446 if (i % 20) continue
1447
1448 else count++
1449 }
1450
1451 return ((250.1 + ((g_Reset[index]+1) * 50.2)) * float(g_Level[index]) * count)
1452}
1453
1454
1455CheckLevel ( iIndex ) {
1456 if ( !is_user_connected ( iIndex ) || g_Estado [ iIndex ] != LOGUEADO )
1457 return;
1458
1459 static count = 0;
1460 while ( g_Experiencia [ iIndex ] >= floatround ( ExpForNextLevel ( iIndex ) ) && g_Level [ iIndex ] < MaxLevel ( iIndex ) ) {
1461
1462 g_Experiencia [ iIndex ] -= floatround ( ExpForNextLevel ( iIndex ) );
1463 count++;
1464 g_Level [ iIndex ] ++;
1465 }
1466
1467 if ( count ) {
1468 Henk_SayPrint ( iIndex, "%s Subiste !g%d nivel%s !yahora estas en el !tnivel %d", szPrefix, count, count > 1 ? "es" : "", g_Level [ iIndex] );
1469 Guardar ( iIndex );
1470 }
1471
1472}
1473
1474public Guardar(id) {
1475 get_user_ip(id, g_Ip[id], charsmax(g_Ip), 1)
1476
1477 adv_vault_set_start ( g_vault);
1478 adv_vault_set_field ( g_vault, g_campo[FECHA], g_Fecha[id]);
1479 adv_vault_set_field ( g_vault, g_campo[PASSWORD], g_contra[id]);
1480 adv_vault_set_field ( g_vault, g_campo[IP], g_Ip[id]);
1481 adv_vault_set_field ( g_vault, g_campo[AUTOLOG], g_AutoLogueo[id]);
1482
1483
1484 adv_vault_set_field ( g_vault, g_campo[LEVEL], g_Level[id] );
1485
1486 adv_vault_set_field ( g_vault, g_campo[EXPERIENCIA], g_Experiencia [ id ] );
1487 adv_vault_set_field ( g_vault, g_campo[RESET], g_Reset [ id ] );
1488 adv_vault_set_field ( g_vault, g_campo[PUNTOS], g_Puntos [ id ] );
1489 adv_vault_set_end ( g_vault, 0, g_cuenta[id]);
1490}
1491public Cargar(id) {
1492 if(!adv_vault_get_prepare(g_vault, _, g_cuenta[id])) {
1493 g_Estado[id] = NOREGISTRADO;
1494 return;
1495 } else {
1496 g_Estado[id] = REGISTRADO;
1497 adv_vault_get_field(g_vault, g_campo[FECHA], g_Fecha[id], charsmax(g_Fecha[]));
1498 adv_vault_get_field(g_vault, g_campo[PASSWORD], g_contra[id], charsmax(g_contra[]));
1499 adv_vault_get_field(g_vault, g_campo[IP], g_Ip[id], charsmax(g_Ip[]));
1500 g_AutoLogueo[id] = adv_vault_get_field(g_vault, g_campo[AUTOLOG]);
1501 g_Level [ id ] = adv_vault_get_field ( g_vault, g_campo [ LEVEL ] );
1502 g_Experiencia [ id ] = adv_vault_get_field ( g_vault, g_campo [ EXPERIENCIA ] );
1503 g_Reset [ id ] = adv_vault_get_field ( g_vault, g_campo [ RESET ] );
1504 g_Puntos [ id ] = adv_vault_get_field ( g_vault, g_campo [ PUNTOS ] );
1505 }
1506
1507}
1508public changeTeamInfo(player, team[])
1509{
1510 message_begin(MSG_ONE, get_user_msgid("TeamInfo"), _, player)
1511 write_byte(player)
1512 write_string(team)
1513 message_end()
1514}
1515
1516public writeMessage(player, say[])
1517{
1518 message_begin(MSG_ONE, get_user_msgid("SayText"), {0, 0, 0}, player)
1519 write_byte(player)
1520 write_string(say)
1521 message_end()
1522}
1523
1524
1525stock ScreenFade(plr, Float:fDuration, red, green, blue, alpha)
1526{
1527 new i = plr ? plr : get_maxplayers();
1528 if( !i )
1529 {
1530 return 0;
1531 }
1532
1533 message_begin(plr ? MSG_ONE : MSG_ALL, get_user_msgid( "ScreenFade"), {0, 0, 0}, plr);
1534 write_short(floatround(4096.0 * fDuration, floatround_round));
1535 write_short(floatround(4096.0 * fDuration, floatround_round));
1536 write_short(4096);
1537 write_byte(red);
1538 write_byte(green);
1539 write_byte(blue);
1540 write_byte(alpha);
1541 message_end();
1542
1543 return 1;
1544}
1545
1546stock RegisterSayCmdTeam ( const szSayCommand [ ], const szFunction [ ], const szFlags ) {
1547
1548 new LenSay [ 127 ];
1549 new LenSayTeam [ 127 ];
1550 formatex ( LenSay, sizeof ( LenSay ), "say /%s",szSayCommand );
1551 formatex ( LenSayTeam, sizeof ( LenSayTeam ), "say_team /%s", szSayCommand );
1552
1553 register_clcmd ( LenSay, szFunction, szFlags );
1554 register_clcmd ( LenSayTeam, szFunction, szFlags );
1555
1556
1557}
1558
1559
1560stock SetUserWeapon ( const iIndex, const szWeapon [ ], const szBalas [ ] ) {
1561 set_pdata_int ( fm_give_item ( iIndex, szWeapon ), 51, szBalas, 4 );
1562}
1563
1564
1565/*
1566stock isCheckCaracters ( const iMail [ ] ) {
1567
1568 for ( new i = 0; i <= sizeof ( szBlockCharacters ); i++ ) {
1569
1570 if ( containi ( iMail, szHotmails [ i ] ) != -1 )
1571 return PLUGIN_HANDLED;
1572
1573 }
1574
1575 return PLUGIN_HANDLED;
1576
1577}
1578*/
1579
1580public AddComas( Num )
1581{
1582 new szNum[15];
1583 num_to_str( Num, szNum, 14 );
1584
1585
1586 if( strlen(szNum[ 6 ] ) && !strlen(szNum[ 7 ] ) )
1587 {
1588 szNum[ 10 ] = szNum[ 9 ];
1589 szNum[ 9 ] = szNum[ 8 ];
1590 szNum[ 8 ] = szNum[ 7 ];
1591 szNum[ 7 ] = szNum[ 6 ];
1592 szNum[ 6 ] = szNum[ 5 ];
1593 szNum[ 5 ] = szNum[ 4 ];
1594 szNum[ 4 ] = szNum[ 3];
1595 szNum[ 3 ] = szNum[ 2 ];
1596 szNum[ 2 ] = szNum[ 1 ];
1597 szNum[ 5 ] = '.';
1598 szNum[ 1 ] = '.';
1599 }
1600 else if( strlen(szNum[ 5 ] ))
1601 {
1602 szNum[ 6 ] = szNum[ 5 ];
1603 szNum[ 5 ] = szNum[ 4 ];
1604 szNum[ 4 ] = szNum[ 3 ];
1605 szNum[ 3 ] = '.';
1606 }
1607 else if( strlen(szNum[ 4 ] ))
1608 {
1609 szNum[ 5 ] = szNum[ 4 ];
1610 szNum[ 4 ] = szNum[ 3 ];
1611 szNum[ 3 ] = szNum[ 2 ];
1612 szNum[ 2 ] = '.';
1613 }
1614 else if( strlen(szNum[ 3 ] ))
1615 {
1616 szNum[ 4 ] = szNum[ 3];
1617 szNum[ 3 ] = szNum[ 2 ];
1618 szNum[ 2 ] = szNum[ 1 ];
1619 szNum[ 1 ] = '.';
1620 }
1621
1622 return szNum;
1623}
1624/*
1625stock addpoints(number)
1626{
1627 static str[15], strpointed[15], len, c, i, neg; c = 0
1628
1629 if (number < 0)
1630 {
1631 number *= -1
1632 neg = 1
1633 }
1634 else neg = 0
1635
1636 num_to_str(number, str, 14)
1637 len = strlen(str)
1638 strpointed = ""
1639
1640 for (i = 0 ; i < len; i++)
1641 {
1642 if (i != 0 && ((len-i) % 3 == 0))
1643 {
1644 add(strpointed, 14, ".", 1)
1645 c++
1646 add(strpointed[i+c], 1, str[i], 1)
1647 }
1648 else add(strpointed[i+c], 1, str[i], 1)
1649 }
1650 if (neg) format(strpointed, charsmax(strpointed), "-%s", strpointed)
1651
1652 return strpointed
1653}
1654*/
1655
1656public native_hns_set_xp ( iIndex, iExperiencia ) {
1657
1658
1659 //set_user_exp(id, float(exp), 1, 1)
1660
1661 if ( !is_user_connected ( iIndex ) || g_Estado [ iIndex ] != LOGUEADO )
1662 return;
1663
1664 set_exp ( iIndex, float ( iExperiencia ) );
1665
1666 /*
1667 g_Experiencia [ iIndex ] += iExperiencia;
1668 CheckLevel ( iIndex );
1669 return g_Experiencia [ iIndex ];
1670 */
1671
1672}
1673
1674public native_hns_set_nivel ( iIndex, iNivel ) {
1675
1676 set_nivel ( iIndex, iNivel );
1677
1678 /*
1679 g_Level [ iIndex ] += iNivel;
1680 CheckLevel ( iIndex );
1681 return g_Level [ iIndex ];
1682 */
1683}
1684
1685
1686stock set_exp ( iIndex, Float:Exp ) {
1687
1688 static Float:ExpOriginal;
1689 ExpOriginal = Exp;
1690
1691 if ( ExpOriginal ) g_Experiencia [ iIndex ] += floatround ( Exp );
1692
1693 CheckLevel ( iIndex );
1694}
1695
1696stock set_nivel ( iIndex, iNivel ) {
1697
1698 static count;
1699
1700 for ( count = 0; count < iNivel; count++ ) {
1701
1702 if ( g_Level [ iIndex ] >= MaxLevel ( iIndex ) )
1703 continue;
1704
1705 g_Experiencia [ iIndex ] += floatround ( ExpForNextLevel ( iIndex ) );
1706 g_Level [ iIndex ]++;
1707
1708 Henk_SayPrint ( iIndex, "%s Subiste !g%d nivel%s", szPrefix, count, count > 1 ? "es" : "" );
1709
1710 }
1711
1712 CheckLevel ( iIndex );
1713}