Mensajes: 241
Temas: 113
Registro en: Aug 2020
Reputación:
0
Ando buscando un plugin de ronda de cuchillo y al morir los jugadores respaween automaticamente.
Mensajes: 106
Temas: 41
Registro en: May 2020
Reputación:
0
Aqui te dejo este, posee sonido. Saludos.
Código PHP:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fakemeta> #include <cstrike> #include <engine> #include <fun> #define PLUGIN "Simple Knife Warump" #define VERSION "1.0" #define AUTHOR "Sn!ff3r" #define TASKID 1234 new hudtimer , cvar , hudhandler , mp_freezetime , value new bool : Respawn = true new const SOUND [] = "sound/carpeta/sonido.mp3" public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) register_message ( get_user_msgid ( "TextMsg" ) , "message_TextMsg" ) register_dictionary ( "simple_warmup.txt" ) cvar = register_cvar ( "warmup_timer" , "60" ) hudhandler = CreateHudSyncObj () } public plugin_precache () { precache_generic ( SOUND ) } public plugin_cfg () { mp_freezetime = get_cvar_pointer ( "mp_freezetime" ) set_task ( 10.0 , "read_vars" ) } public read_vars () { value = get_pcvar_num ( mp_freezetime ) } public message_TextMsg (const MsgId , const MsgDest , const MsgEntity ) { static message [ 64 ], id get_msg_arg_string ( 2 , message , charsmax ( message )) if( equal ( message , "#Game_Commencing" )) { hudtimer = get_pcvar_num ( cvar ) Respawn = true if( hudtimer == - 1 ) return formatex ( message , charsmax ( message ), "%L" , LANG_PLAYER , "WARUMP_START" ) set_msg_arg_string ( 2 , message ) client_cmd ( id , "mp3 play ^" % s ^ "" , SOUND ) set_task ( 1.0 , "restart" , TASKID , _ , _ , "b" ) set_pcvar_num ( mp_freezetime , 0 ) engclient_cmd ( id , "weapon_knife" ) } if( equal ( message , "#Game_will_restart_in" )) { formatex ( message , charsmax ( message ), "%L" , LANG_PLAYER , "WARUMP_END" ) set_msg_arg_string ( 2 , message ) } } public KNIFE () { static id engclient_cmd ( id , "weapon_knife" ) } public restart () { static id if( hudtimer <= 0 ) { Respawn = false remove_task ( TASKID ) set_cvar_num ( "sv_restartround" , 1 ) set_pcvar_num ( mp_freezetime , value ) } else { engclient_cmd ( id , "weapon_knife" ) set_task ( 0.1 , "KNIFE" , TASKID , _ , _ , "b" ) set_hudmessage ( random_num ( 50 , 255 ), random_num ( 50 , 255 ), random_num ( 50 , 255 ), - 1.0 , 0.80 , 0 , 0.4 , 1 , 0.5 , 0.5 , 4 ) ShowSyncHudMsg ( 0 , hudhandler , "%L" , LANG_PLAYER , "COUNTING" , hudtimer ) } hudtimer -- } public client_death ( attacker , victim ) { if( is_user_connected ( victim ) && Respawn ) set_task ( 1.5 , "respawn" , victim ) // 1.5 = segundos que tarda en revivir al morir (es modificable de 0.1 en adelante). return PLUGIN_CONTINUE } public respawn ( Index ) { if( Respawn ) ExecuteHamB ( Ham_CS_RoundRespawn , Index ) strip_user_weapons ( Index ) give_item ( Index , "weapon_knife" ); engclient_cmd ( Index , "weapon_knife" ) }
Archivos adjuntos
simple_warmup.txt (Tamaño: 319 bytes / Descargas: 22)
Mensajes: 241
Temas: 113
Registro en: Aug 2020
Reputación:
0
(27/12/2020, 12:26 PM) Null2020 escribió: Aqui te dejo este, posee sonido. Saludos.
Código PHP:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fakemeta> #include <cstrike> #include <engine> #include <fun> #define PLUGIN "Simple Knife Warump" #define VERSION "1.0" #define AUTHOR "Sn!ff3r" #define TASKID 1234 new hudtimer , cvar , hudhandler , mp_freezetime , value new bool : Respawn = true new const SOUND [] = "sound/carpeta/sonido.mp3" public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) register_message ( get_user_msgid ( "TextMsg" ) , "message_TextMsg" ) register_dictionary ( "simple_warmup.txt" ) cvar = register_cvar ( "warmup_timer" , "60" ) hudhandler = CreateHudSyncObj () } public plugin_precache () { precache_generic ( SOUND ) } public plugin_cfg () { mp_freezetime = get_cvar_pointer ( "mp_freezetime" ) set_task ( 10.0 , "read_vars" ) } public read_vars () { value = get_pcvar_num ( mp_freezetime ) } public message_TextMsg (const MsgId , const MsgDest , const MsgEntity ) { static message [ 64 ], id get_msg_arg_string ( 2 , message , charsmax ( message )) if( equal ( message , "#Game_Commencing" )) { hudtimer = get_pcvar_num ( cvar ) Respawn = true if( hudtimer == - 1 ) return formatex ( message , charsmax ( message ), "%L" , LANG_PLAYER , "WARUMP_START" ) set_msg_arg_string ( 2 , message ) client_cmd ( id , "mp3 play ^" % s ^ "" , SOUND ) set_task ( 1.0 , "restart" , TASKID , _ , _ , "b" ) set_pcvar_num ( mp_freezetime , 0 ) engclient_cmd ( id , "weapon_knife" ) } if( equal ( message , "#Game_will_restart_in" )) { formatex ( message , charsmax ( message ), "%L" , LANG_PLAYER , "WARUMP_END" ) set_msg_arg_string ( 2 , message ) } } public KNIFE () { static id engclient_cmd ( id , "weapon_knife" ) } public restart () { static id if( hudtimer <= 0 ) { Respawn = false remove_task ( TASKID ) set_cvar_num ( "sv_restartround" , 1 ) set_pcvar_num ( mp_freezetime , value ) } else { engclient_cmd ( id , "weapon_knife" ) set_task ( 0.1 , "KNIFE" , TASKID , _ , _ , "b" ) set_hudmessage ( random_num ( 50 , 255 ), random_num ( 50 , 255 ), random_num ( 50 , 255 ), - 1.0 , 0.80 , 0 , 0.4 , 1 , 0.5 , 0.5 , 4 ) ShowSyncHudMsg ( 0 , hudhandler , "%L" , LANG_PLAYER , "COUNTING" , hudtimer ) } hudtimer -- } public client_death ( attacker , victim ) { if( is_user_connected ( victim ) && Respawn ) set_task ( 1.5 , "respawn" , victim ) // 1.5 = segundos que tarda en revivir al morir (es modificable de 0.1 en adelante). return PLUGIN_CONTINUE } public respawn ( Index ) { if( Respawn ) ExecuteHamB ( Ham_CS_RoundRespawn , Index ) strip_user_weapons ( Index ) give_item ( Index , "weapon_knife" ); engclient_cmd ( Index , "weapon_knife" ) }
Muchas gracias, se puede usar sin sonido?
Mensajes: 106
Temas: 41
Registro en: May 2020
Reputación:
0
27/12/2020, 02:25 PM
(Última modificación: 27/12/2020, 02:26 PM por Null2020 . Edited 1 time in total.)
(27/12/2020, 01:34 PM) Mecha escribió: Muchas gracias, se puede usar sin sonido?
Si claro, aqui esta sin sonido.
Código PHP:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Simple Knife Warump" #define VERSION "1.0" #define AUTHOR "Sn!ff3r" #define TASKID 1234 new hudtimer , cvar , hudhandler , mp_freezetime , value public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) register_message ( get_user_msgid ( "TextMsg" ) , "message_TextMsg" ) register_event ( "CurWeapon" , "switchweapon" , "be" , "1=1" , "2!29" ) register_dictionary ( "simple_warmup.txt" ) cvar = register_cvar ( "warmup_timer" , "60" ) hudhandler = CreateHudSyncObj () } public plugin_cfg () { mp_freezetime = get_cvar_pointer ( "mp_freezetime" ) set_task ( 10.0 , "read_vars" ) } public read_vars () { value = get_pcvar_num ( mp_freezetime ) } public message_TextMsg (const MsgId , const MsgDest , const MsgEntity ) { static message [ 64 ] get_msg_arg_string ( 2 , message , charsmax ( message )) if( equal ( message , "#Game_Commencing" )) { hudtimer = get_pcvar_num ( cvar ) if( hudtimer == - 1 ) return formatex ( message , charsmax ( message ), "%L" , LANG_PLAYER , "WARUMP_START" ) set_msg_arg_string ( 2 , message ) set_task ( 1.0 , "restart" , TASKID , _ , _ , "b" ) set_pcvar_num ( mp_freezetime , 0 ) } if( equal ( message , "#Game_will_restart_in" )) { formatex ( message , charsmax ( message ), "%L" , LANG_PLAYER , "WARUMP_END" ) set_msg_arg_string ( 2 , message ) } } public restart () { if( hudtimer <= 0 ) { remove_task ( TASKID ) set_cvar_num ( "sv_restartround" , 1 ) set_pcvar_num ( mp_freezetime , value ) } else { set_hudmessage ( 255 , 255 , 255 ,- 1.0 , 0.9 , 0 , 6.0 , 1.0 , 0.1 , 0.2 ) ShowSyncHudMsg ( 0 , hudhandler , "%L" , LANG_PLAYER , "COUNTING" , hudtimer ) } hudtimer -- } public switchweapon ( id ) { if( task_exists ( TASKID )) { engclient_cmd ( id , "weapon_knife" ) } }
Mensajes: 241
Temas: 113
Registro en: Aug 2020
Reputación:
0
(27/12/2020, 02:25 PM) Null2020 escribió: Si claro, aqui esta sin sonido.
Código PHP:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Simple Knife Warump" #define VERSION "1.0" #define AUTHOR "Sn!ff3r" #define TASKID 1234 new hudtimer , cvar , hudhandler , mp_freezetime , value public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) register_message ( get_user_msgid ( "TextMsg" ) , "message_TextMsg" ) register_event ( "CurWeapon" , "switchweapon" , "be" , "1=1" , "2!29" ) register_dictionary ( "simple_warmup.txt" ) cvar = register_cvar ( "warmup_timer" , "60" ) hudhandler = CreateHudSyncObj () } public plugin_cfg () { mp_freezetime = get_cvar_pointer ( "mp_freezetime" ) set_task ( 10.0 , "read_vars" ) } public read_vars () { value = get_pcvar_num ( mp_freezetime ) } public message_TextMsg (const MsgId , const MsgDest , const MsgEntity ) { static message [ 64 ] get_msg_arg_string ( 2 , message , charsmax ( message )) if( equal ( message , "#Game_Commencing" )) { hudtimer = get_pcvar_num ( cvar ) if( hudtimer == - 1 ) return formatex ( message , charsmax ( message ), "%L" , LANG_PLAYER , "WARUMP_START" ) set_msg_arg_string ( 2 , message ) set_task ( 1.0 , "restart" , TASKID , _ , _ , "b" ) set_pcvar_num ( mp_freezetime , 0 ) } if( equal ( message , "#Game_will_restart_in" )) { formatex ( message , charsmax ( message ), "%L" , LANG_PLAYER , "WARUMP_END" ) set_msg_arg_string ( 2 , message ) } } public restart () { if( hudtimer <= 0 ) { remove_task ( TASKID ) set_cvar_num ( "sv_restartround" , 1 ) set_pcvar_num ( mp_freezetime , value ) } else { set_hudmessage ( 255 , 255 , 255 ,- 1.0 , 0.9 , 0 , 6.0 , 1.0 , 0.1 , 0.2 ) ShowSyncHudMsg ( 0 , hudhandler , "%L" , LANG_PLAYER , "COUNTING" , hudtimer ) } hudtimer -- } public switchweapon ( id ) { if( task_exists ( TASKID )) { engclient_cmd ( id , "weapon_knife" ) } }
Muchisimas gracias
Mensajes: 3,238
Temas: 47
Registro en: Feb 2015
Reputación:
34
27/12/2020, 05:50 PM
(Última modificación: 27/12/2020, 05:56 PM por Skylar . Edited 3 times in total.)
Código PHP:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <hamsandwich> #if AMXX_VERSION_NUM < 183 #include <dhudmessage> #endif new const szPlugin [ ][ ] = { "Warmup" , "1.0" , "Sn!ff3r" }; /* =============================================================== */ #define TASK_WARMUP 1222 #define NAME_FILE "warmup_config" new g_Count ; new g_Time , g_Respawn , Float : g_TimeRespawn , g_OnlyKnife , g_szWeapon_Primary [ 30 ], g_CswWeapon_Primary , g_szWeapon_Secondary [ 30 ], g_CswWeapon_Secondary ; new g_szMsg_Start [ 100 ], g_szMsg_End [ 100 ], g_szMsg_Count [ 100 ], g_Hud_Color [ 3 ]; new mp_freezetime , g_Cache_Freezetime ; public plugin_init ( ) { register_plugin ( szPlugin [ 0 ], szPlugin [ 1 ], szPlugin [ 2 ] ); register_message ( get_user_msgid ( "TextMsg" ), "rmessage_TextMsg" ); register_message ( get_user_msgid ( "StatusIcon" ), "rmessage_StatusIcon" ); register_event ( "CurWeapon" , "rev_CurWeapon" , "be" , "1=1" , "2!29" ); RegisterHam ( Ham_Spawn , "player" , "rham_PlayerSpawn" , 1 ); RegisterHam ( Ham_Killed , "player" , "rham_PlayerKilled" ); } public plugin_cfg ( ) { mp_freezetime = get_cvar_pointer ( "mp_freezetime" ); plugin_config ( ); set_task ( 10.0 , "plugin_vars" ); } public plugin_config ( ) { new szConfigFile [ 128 ]; get_configsdir ( szConfigFile , charsmax ( szConfigFile ) ); formatex ( szConfigFile , charsmax ( szConfigFile ), "%s/%s.cfg" , szConfigFile , NAME_FILE ); new szFile = fopen ( szConfigFile , "rt" ); new szKey [ 300 ], szValue [ 300 ], szLineData [ 300 ]; while( ! feof ( szFile ) ) { fgets ( szFile , szLineData , charsmax ( szLineData ) ); trim ( szLineData ); if( ! szLineData [ 0 ] || szLineData [ 0 ] == ';' || ( szLineData [ 0 ] == '/' && szLineData [ 1 ] == '/' ) ) continue; strtok ( szLineData , szKey , charsmax ( szKey ), szValue , charsmax ( szValue ), '=' ); trim ( szKey ); trim ( szValue ); if( equal ( szKey , "warmup_time" ) ) g_Time = str_to_num ( szValue ); else if( equal ( szKey , "warmup_respawn" ) ) g_Respawn = str_to_num ( szValue ); else if( equal ( szKey , "warmup_time_respawn" ) ) g_TimeRespawn = str_to_float ( szValue ); else if( equal ( szKey , "warmup_only_knife" ) ) g_OnlyKnife = str_to_num ( szValue ); else if( equal ( szKey , "warmup_weapon_primary" ) ) { copy ( g_szWeapon_Primary , charsmax ( g_szWeapon_Primary ), szValue ); g_CswWeapon_Primary = cs_weapon_name_to_id ( szValue ); } else if( equal ( szKey , "warmup_weapon_secondary" ) ) { copy ( g_szWeapon_Secondary , charsmax ( g_szWeapon_Secondary ), szValue ); g_CswWeapon_Secondary = cs_weapon_name_to_id ( szValue ); } else if( equal ( szKey , "warmup_msg_start" ) ) copy ( g_szMsg_Start , charsmax ( g_szMsg_Start ), szValue ); else if( equal ( szKey , "warmup_msg_end" ) ) copy ( g_szMsg_End , charsmax ( g_szMsg_End ), szValue ); else if( equal ( szKey , "warmup_msg_count" ) ) copy ( g_szMsg_Count , charsmax ( g_szMsg_Count ), szValue ); else if( equal ( szKey , "warmup_msg_color_r" ) ) g_Hud_Color [ 0 ] = str_to_num ( szValue ); else if( equal ( szKey , "warmup_msg_color_g" ) ) g_Hud_Color [ 1 ] = str_to_num ( szValue ); else if( equal ( szKey , "warmup_msg_color_b" ) ) g_Hud_Color [ 2 ] = str_to_num ( szValue ); } fclose ( szFile ); } public plugin_vars ( ) g_Cache_Freezetime = get_pcvar_num ( mp_freezetime ); /* =============================================================== */ public rmessage_StatusIcon ( id , dest , entity ) { static szIcon [ 8 ]; get_msg_arg_string ( 2 , szIcon , charsmax ( szIcon ) ); if( equal ( szIcon , "buyzone" ) && task_exists ( TASK_WARMUP ) ) return PLUGIN_HANDLED ; return PLUGIN_CONTINUE ; } public rmessage_TextMsg ( id , dest , entity ) { static szMessage [ 64 ]; get_msg_arg_string ( 2 , szMessage , charsmax ( szMessage ) ); if( equal ( szMessage , "#Game_Commencing" ) ) { g_Count = g_Time ; if( g_Count == - 1 ) return; set_dhudmessage ( g_Hud_Color [ 0 ], g_Hud_Color [ 1 ], g_Hud_Color [ 2 ], - 1.0 , 0.07 , 1 , 6.0 , 1.1 , 0.0 , 0.0 ); show_dhudmessage ( 0 , g_szMsg_Start ); remove_task ( TASK_WARMUP ); set_task ( 1.0 , "rfn_Count" , TASK_WARMUP , _ , _ , "b" ); set_pcvar_num ( mp_freezetime , 0 ); } if( equal ( szMessage , "#Game_will_restart_in" ) ) { set_dhudmessage ( g_Hud_Color [ 0 ], g_Hud_Color [ 1 ], g_Hud_Color [ 2 ], - 1.0 , 0.07 , 1 , 6.0 , 1.1 , 0.0 , 0.0 ); show_dhudmessage ( 0 , g_szMsg_End ); } } public rev_CurWeapon ( id ) { if( task_exists ( TASK_WARMUP ) && g_OnlyKnife ) engclient_cmd ( id , "weapon_knife" ); } public rham_PlayerSpawn ( id ) { if( task_exists ( TASK_WARMUP ) && is_user_alive ( id ) ) { strip_user_weapons ( id ); give_item ( id , "weapon_knife" ); if( ! g_OnlyKnife ) { give_item ( id , g_szWeapon_Primary ); cs_set_user_bpammo ( id , g_CswWeapon_Primary , 999 ); give_item ( id , g_szWeapon_Secondary ); cs_set_user_bpammo ( id , g_CswWeapon_Secondary , 999 ); } } } public rham_PlayerKilled ( victim , attacker , shouldgib ) { if( ! is_user_connected ( attacker ) || ! is_user_connected ( victim ) ) return; if( g_Respawn && task_exists ( TASK_WARMUP ) ) if( ! is_user_alive ( victim ) ) set_task ( g_TimeRespawn , "rfn_Respawn" , victim ); } /* =============================================================== */ public rfn_Count ( ) { -- g_Count ; set_dhudmessage ( g_Hud_Color [ 0 ], g_Hud_Color [ 1 ], g_Hud_Color [ 2 ], - 1.0 , 0.07 , 1 , 6.0 , 1.1 , 0.0 , 0.0 ); show_dhudmessage ( 0 , g_szMsg_Count , g_Count , g_Count == 1 ? "" : "s" ); if( ! g_Count ) { remove_task ( TASK_WARMUP ); set_cvar_num ( "sv_restartround" , 1 ); set_pcvar_num ( mp_freezetime , g_Cache_Freezetime ); } } public rfn_Respawn ( id ) { if( cs_get_user_team ( id ) == CS_TEAM_SPECTATOR || cs_get_user_team ( id ) == CS_TEAM_UNASSIGNED ) return; ExecuteHamB ( Ham_CS_RoundRespawn , id ); } /* =============================================================== */ stock cs_weapon_name_to_id ( const weapon [ ] ) { static const szWpnEntNames [][] = { "" , "weapon_p228" , "" , "weapon_scout" , "weapon_hegrenade" , "weapon_xm1014" , "weapon_c4" , "weapon_mac10" , "weapon_aug" , "weapon_smokegrenade" , "weapon_elite" , "weapon_fiveseven" , "weapon_ump45" , "weapon_sg550" , "weapon_galil" , "weapon_famas" , "weapon_usp" , "weapon_glock18" , "weapon_awp" , "weapon_mp5navy" , "weapon_m249" , "weapon_m3" , "weapon_m4a1" , "weapon_tmp" , "weapon_g3sg1" , "weapon_flashbang" , "weapon_deagle" , "weapon_sg552" , "weapon_ak47" , "weapon_knife" , "weapon_p90" } static i ; for( i = 0 ; i < sizeof szWpnEntNames ; i ++ ) if( equal ( weapon , szWpnEntNames [ i ] ) ) return i ; return 0 ; }
EDIT:
El archivo se crea automáticamente:
Código:
// Tiempo de calentamiento
warmup_time = 60
// Respawn activado/desactivado
warmup_respawn = 1
// Tiempo de respawn
warmup_time_respawn = 3.0
// Solamente con cuchillo
warmup_only_knife = 0
// Arma primaria para el calentamiento
warmup_weapon_primary = weapon_m4a1
// Arma secundaria para el calentamiento
warmup_weapon_secondary = weapon_deagle
// Mensaje para cuando comienza el calentamiento
warmup_msg_start = El calentamiento ha comenzado!!
// Mensaje para cuando finaliza el calentamiento
warmup_msg_end = El calentamiento ha finalizado!!
// Mensaje para el conteo del calentamiento
warmup_msg_count = Ronda de calentamiento: %i segundo%s
// Color R
warmup_msg_color_r = 255
// Color G
warmup_msg_color_g = 0
// Color B
warmup_msg_color_b = 0
Mensajes: 241
Temas: 113
Registro en: Aug 2020
Reputación:
0
27/12/2020, 10:20 PM
(Última modificación: 27/12/2020, 10:23 PM por Mecha . Edited 1 time in total.
Razón: me olvide agregar algo xD
)
(27/12/2020, 05:50 PM) Skylar escribió: Código PHP:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <hamsandwich> #if AMXX_VERSION_NUM < 183 #include <dhudmessage> #endif new const szPlugin [ ][ ] = { "Warmup" , "1.0" , "Sn!ff3r" }; /* =============================================================== */ #define TASK_WARMUP 1222 #define NAME_FILE "warmup_config" new g_Count ; new g_Time , g_Respawn , Float : g_TimeRespawn , g_OnlyKnife , g_szWeapon_Primary [ 30 ], g_CswWeapon_Primary , g_szWeapon_Secondary [ 30 ], g_CswWeapon_Secondary ; new g_szMsg_Start [ 100 ], g_szMsg_End [ 100 ], g_szMsg_Count [ 100 ], g_Hud_Color [ 3 ]; new mp_freezetime , g_Cache_Freezetime ; public plugin_init ( ) { register_plugin ( szPlugin [ 0 ], szPlugin [ 1 ], szPlugin [ 2 ] ); register_message ( get_user_msgid ( "TextMsg" ), "rmessage_TextMsg" ); register_message ( get_user_msgid ( "StatusIcon" ), "rmessage_StatusIcon" ); register_event ( "CurWeapon" , "rev_CurWeapon" , "be" , "1=1" , "2!29" ); RegisterHam ( Ham_Spawn , "player" , "rham_PlayerSpawn" , 1 ); RegisterHam ( Ham_Killed , "player" , "rham_PlayerKilled" ); } public plugin_cfg ( ) { mp_freezetime = get_cvar_pointer ( "mp_freezetime" ); plugin_config ( ); set_task ( 10.0 , "plugin_vars" ); } public plugin_config ( ) { new szConfigFile [ 128 ]; get_configsdir ( szConfigFile , charsmax ( szConfigFile ) ); formatex ( szConfigFile , charsmax ( szConfigFile ), "%s/%s.cfg" , szConfigFile , NAME_FILE ); new szFile = fopen ( szConfigFile , "rt" ); new szKey [ 300 ], szValue [ 300 ], szLineData [ 300 ]; while( ! feof ( szFile ) ) { fgets ( szFile , szLineData , charsmax ( szLineData ) ); trim ( szLineData ); if( ! szLineData [ 0 ] || szLineData [ 0 ] == ';' || ( szLineData [ 0 ] == '/' && szLineData [ 1 ] == '/' ) ) continue; strtok ( szLineData , szKey , charsmax ( szKey ), szValue , charsmax ( szValue ), '=' ); trim ( szKey ); trim ( szValue ); if( equal ( szKey , "warmup_time" ) ) g_Time = str_to_num ( szValue ); else if( equal ( szKey , "warmup_respawn" ) ) g_Respawn = str_to_num ( szValue ); else if( equal ( szKey , "warmup_time_respawn" ) ) g_TimeRespawn = str_to_float ( szValue ); else if( equal ( szKey , "warmup_only_knife" ) ) g_OnlyKnife = str_to_num ( szValue ); else if( equal ( szKey , "warmup_weapon_primary" ) ) { copy ( g_szWeapon_Primary , charsmax ( g_szWeapon_Primary ), szValue ); g_CswWeapon_Primary = cs_weapon_name_to_id ( szValue ); } else if( equal ( szKey , "warmup_weapon_secondary" ) ) { copy ( g_szWeapon_Secondary , charsmax ( g_szWeapon_Secondary ), szValue ); g_CswWeapon_Secondary = cs_weapon_name_to_id ( szValue ); } else if( equal ( szKey , "warmup_msg_start" ) ) copy ( g_szMsg_Start , charsmax ( g_szMsg_Start ), szValue ); else if( equal ( szKey , "warmup_msg_end" ) ) copy ( g_szMsg_End , charsmax ( g_szMsg_End ), szValue ); else if( equal ( szKey , "warmup_msg_count" ) ) copy ( g_szMsg_Count , charsmax ( g_szMsg_Count ), szValue ); else if( equal ( szKey , "warmup_msg_color_r" ) ) g_Hud_Color [ 0 ] = str_to_num ( szValue ); else if( equal ( szKey , "warmup_msg_color_g" ) ) g_Hud_Color [ 1 ] = str_to_num ( szValue ); else if( equal ( szKey , "warmup_msg_color_b" ) ) g_Hud_Color [ 2 ] = str_to_num ( szValue ); } fclose ( szFile ); } public plugin_vars ( ) g_Cache_Freezetime = get_pcvar_num ( mp_freezetime ); /* =============================================================== */ public rmessage_StatusIcon ( id , dest , entity ) { static szIcon [ 8 ]; get_msg_arg_string ( 2 , szIcon , charsmax ( szIcon ) ); if( equal ( szIcon , "buyzone" ) && task_exists ( TASK_WARMUP ) ) return PLUGIN_HANDLED ; return PLUGIN_CONTINUE ; } public rmessage_TextMsg ( id , dest , entity ) { static szMessage [ 64 ]; get_msg_arg_string ( 2 , szMessage , charsmax ( szMessage ) ); if( equal ( szMessage , "#Game_Commencing" ) ) { g_Count = g_Time ; if( g_Count == - 1 ) return; set_dhudmessage ( g_Hud_Color [ 0 ], g_Hud_Color [ 1 ], g_Hud_Color [ 2 ], - 1.0 , 0.07 , 1 , 6.0 , 1.1 , 0.0 , 0.0 ); show_dhudmessage ( 0 , g_szMsg_Start ); remove_task ( TASK_WARMUP ); set_task ( 1.0 , "rfn_Count" , TASK_WARMUP , _ , _ , "b" ); set_pcvar_num ( mp_freezetime , 0 ); } if( equal ( szMessage , "#Game_will_restart_in" ) ) { set_dhudmessage ( g_Hud_Color [ 0 ], g_Hud_Color [ 1 ], g_Hud_Color [ 2 ], - 1.0 , 0.07 , 1 , 6.0 , 1.1 , 0.0 , 0.0 ); show_dhudmessage ( 0 , g_szMsg_End ); } } public rev_CurWeapon ( id ) { if( task_exists ( TASK_WARMUP ) && g_OnlyKnife ) engclient_cmd ( id , "weapon_knife" ); } public rham_PlayerSpawn ( id ) { if( task_exists ( TASK_WARMUP ) && is_user_alive ( id ) ) { strip_user_weapons ( id ); give_item ( id , "weapon_knife" ); if( ! g_OnlyKnife ) { give_item ( id , g_szWeapon_Primary ); cs_set_user_bpammo ( id , g_CswWeapon_Primary , 999 ); give_item ( id , g_szWeapon_Secondary ); cs_set_user_bpammo ( id , g_CswWeapon_Secondary , 999 ); } } } public rham_PlayerKilled ( victim , attacker , shouldgib ) { if( ! is_user_connected ( attacker ) || ! is_user_connected ( victim ) ) return; if( g_Respawn && task_exists ( TASK_WARMUP ) ) if( ! is_user_alive ( victim ) ) set_task ( g_TimeRespawn , "rfn_Respawn" , victim ); } /* =============================================================== */ public rfn_Count ( ) { -- g_Count ; set_dhudmessage ( g_Hud_Color [ 0 ], g_Hud_Color [ 1 ], g_Hud_Color [ 2 ], - 1.0 , 0.07 , 1 , 6.0 , 1.1 , 0.0 , 0.0 ); show_dhudmessage ( 0 , g_szMsg_Count , g_Count , g_Count == 1 ? "" : "s" ); if( ! g_Count ) { remove_task ( TASK_WARMUP ); set_cvar_num ( "sv_restartround" , 1 ); set_pcvar_num ( mp_freezetime , g_Cache_Freezetime ); } } public rfn_Respawn ( id ) { if( cs_get_user_team ( id ) == CS_TEAM_SPECTATOR || cs_get_user_team ( id ) == CS_TEAM_UNASSIGNED ) return; ExecuteHamB ( Ham_CS_RoundRespawn , id ); } /* =============================================================== */ stock cs_weapon_name_to_id ( const weapon [ ] ) { static const szWpnEntNames [][] = { "" , "weapon_p228" , "" , "weapon_scout" , "weapon_hegrenade" , "weapon_xm1014" , "weapon_c4" , "weapon_mac10" , "weapon_aug" , "weapon_smokegrenade" , "weapon_elite" , "weapon_fiveseven" , "weapon_ump45" , "weapon_sg550" , "weapon_galil" , "weapon_famas" , "weapon_usp" , "weapon_glock18" , "weapon_awp" , "weapon_mp5navy" , "weapon_m249" , "weapon_m3" , "weapon_m4a1" , "weapon_tmp" , "weapon_g3sg1" , "weapon_flashbang" , "weapon_deagle" , "weapon_sg552" , "weapon_ak47" , "weapon_knife" , "weapon_p90" } static i ; for( i = 0 ; i < sizeof szWpnEntNames ; i ++ ) if( equal ( weapon , szWpnEntNames [ i ] ) ) return i ; return 0 ; }
EDIT:
El archivo se crea automáticamente:
Código:
// Tiempo de calentamiento
warmup_time = 60
// Respawn activado/desactivado
warmup_respawn = 1
// Tiempo de respawn
warmup_time_respawn = 3.0
// Solamente con cuchillo
warmup_only_knife = 0
// Arma primaria para el calentamiento
warmup_weapon_primary = weapon_m4a1
// Arma secundaria para el calentamiento
warmup_weapon_secondary = weapon_deagle
// Mensaje para cuando comienza el calentamiento
warmup_msg_start = El calentamiento ha comenzado!!
// Mensaje para cuando finaliza el calentamiento
warmup_msg_end = El calentamiento ha finalizado!!
// Mensaje para el conteo del calentamiento
warmup_msg_count = Ronda de calentamiento: %i segundo%s
// Color R
warmup_msg_color_r = 255
// Color G
warmup_msg_color_g = 0
// Color B
warmup_msg_color_b = 0
mmmm lo probe con los bots y funciona mal.
1- no se genera nada automatico.
2- no sale ningun hud que dice que estamos en calentamiento.
3- a la siguiente ronda sigo con el cuchillo.
4- no me da acceso a la tienda para comprar en la siguiente ronda.
(no se si eso es porque no funciona con los bots o nose)
Mensajes: 13
Temas: 3
Registro en: Oct 2020
Reputación:
0
algunos de esos vienen con respawn?
Mensajes: 106
Temas: 41
Registro en: May 2020
Reputación:
0
(31/01/2021, 01:23 AM) Xavi. escribió: algunos de esos vienen con respawn?
Xavi Edition. El que vende plugins y edita servidores a costilla de los editores de amxmodx-es.
Mensajes: 7,178
Temas: 93
Registro en: Aug 2014
Reputación:
63
Mensajes: 165
Temas: 23
Registro en: Oct 2018
Reputación:
0
(31/01/2021, 04:56 PM) Null2020 escribió: Xavi Edition. El que vende plugins y edita servidores a costilla de los editores de amxmodx-es.
De echo tiene su propio servidor xD, pero ya estamos volviendo esto off