Mensajes: 173
Temas: 49
Registro en: Aug 2017
Reputación:
0
Hola necesito ayuda estoy trabajando en un TTT para youtube pero hay un problema al poner el extra item no se agrega al menu de compra del traidor (Target Gun) y intente crearle una native para agregarlo al menu directo y me salio este error
Código PHP:
AMX Mod X Compiler 1.9.0.5235 Copyright ( c ) 1997 - 2006 ITB CompuPhase Copyright ( c ) 2004 - 2013 AMX Mod X Team Warning : Symbol "client_disconnect" is marked as deprecated : Use client_disconnected () instead . on line 79 Error : Expected token : ";" , but found "}" on line 160 Error : Expected token : ";" , but found "}" on line 164 2 Errors . Could not locate output file C :\ Documents and Settings \ Administrador \ Escritorio \ ttt_item_target_gun . amx ( compile failed ).
Necesito su ayuda
Archivos adjuntos
Descargar AMXX / ttt_target_gun.sma (Tamaño: 7.54 KB / Descargas: 5)
Descargar AMXX / ttt_items_base.sma (Tamaño: 6.74 KB / Descargas: 3)
Ze_Jurassic_World_Z [52% ]
Ze_Jumping_Area [37% ]
(04/02/2019, 05:15 PM) kikizon2 escribió: Me voy por un tiempo y cuando regreso veo esto...
Mensajes: 45
Temas: 19
Registro en: Aug 2017
Reputación:
0
Seguro es de tabulación, llego a mi casa y me fijo.
Mensajes: 208
Temas: 56
Registro en: Nov 2018
Reputación:
1
Código PHP:
#include <amxmodx> #include <hamsandwich> #include <engine> #include <cs_weapons_api> #include <fun> #include <amx_settings_api> #include <ttt> #define WEAPON_CSWID CSW_DEAGLE #define WEAPON_NAME "weapon_deagle" new g_TargetGun , g_Glowing [ 33 ], g_Attacker [ 33 ], g_Count [ 33 ], g_pMsgScreeFade , g_pMsgScreeShake , g_MaxPlayers ; new g_szFiles [ 4 ][ TTT_FILELENGHT ], Cvars [ 10 ]; public plugin_precache () { const cantCases = 4 ; new szTypeFile [ 11 ], szPath [ 28 ]; for( new i = 0 ; i < cantCases ; i ++ ) { switch( i ) { case 0 : { szTypeFile = "MODEL_V" ; szPath = "models/ttt/v_targetgun.mdl" ; } case 1 : { szTypeFile = "MODEL_P" ; szPath = "models/ttt/p_targetgun.mdl" ; } case 2 : { szTypeFile = "MODEL_W" ; szPath = "models/ttt/w_targetgun.mdl" ; } case 3 : { szTypeFile = "SOUND_BEEP" ; szPath = "ttt/targetgun_beep.wav" ; } } if( ! amx_load_setting_string ( TTT_SETTINGSFILE , "TARGET GUN" , szTypeFile , g_szFiles [ i ], charsmax ( g_szFiles [])) ) { g_szFiles [ i ] = szPath ; amx_save_setting_string ( TTT_SETTINGSFILE , "TARGET GUN" , szTypeFile , g_szFiles [ i ]); } if( szTypeFile [ 0 ] == 'M' ) precache_model ( g_szFiles [ i ]); else precache_sound ( g_szFiles [ i ]); } } public plugin_init () { register_plugin ( "[TTT] Item: Target Gun" , TTT_VERSION , "SthoNy'" ); Cvars [ 0 ] = my_register_cvar ( "ttt_target_damage" , "300.0" , "Target gun explosion damage. (Default: 300.0)" ); Cvars [ 1 ] = my_register_cvar ( "ttt_target_radius" , "420.0" , "Target gun radius. (Default: 420.0)" ); Cvars [ 2 ] = my_register_cvar ( "ttt_target_clip" , "1" , "Target gun clip ammo. (Default: 1)" ); Cvars [ 3 ] = my_register_cvar ( "ttt_target_ammo" , "0" , "Target gun backpack ammo. (Default: 0)" ); Cvars [ 4 ] = my_register_cvar ( "ttt_target_speed" , "10.0" , "Target gun attack speed delay. (Default: 10.0)" ); Cvars [ 5 ] = my_register_cvar ( "ttt_target_reload" , "0.0" , "Target gun reload speed. (Default: 0.0)" ); Cvars [ 6 ] = my_register_cvar ( "ttt_target_recoil" , "0.0" , "Target gun recoil. (Default: 0.0)" ); Cvars [ 7 ] = my_register_cvar ( "ttt_price_target" , "2" , "Target gun price. (Default: 3)" ); Cvars [ 8 ] = my_register_cvar ( "ttt_max_targets" , "1" , "Maximum Target Gun per round. (Default: 1)" ); Cvars [ 9 ] = my_register_cvar ( "ttt_time_explode" , "3.0" , "Target gun time to explode (Default: 3.0)" ); g_MaxPlayers = get_maxplayers (); g_pMsgScreeFade = get_user_msgid ( "ScreenFade" ); g_pMsgScreeShake = get_user_msgid ( "ScreenShake" ); } public client_disconnected ( id ) remove_task ( id ); public ttt_plugin_cfg () g_TargetGun = ttt_buymenu_add ( "Target Gun" , get_pcvar_num ( Cvars [ 7 ]), PC_TRAITOR ); public ttt_gamemode ( gamemode ) { if( gamemode == GAME_ENDED || gamemode == GAME_RESTARTING || gamemode == GAME_PREPARING ) { for( new i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( g_Glowing [ i ]) { g_Glowing [ i ] = false ; set_user_rendering ( i ); } remove_task ( i ); g_Count [ i ] = 0 ; } } } public ttt_item_selected ( id , item , name [], price ) { if( g_TargetGun == item ) { if( g_Count [ id ] < get_pcvar_num ( Cvars [ 8 ])) { if( user_has_weapon ( id , WEAPON_CSWID )) engclient_cmd ( id , "drop" , WEAPON_NAME ); static data [ STOREABLE_STRUCTURE ]; if(! data [ STRUCT_CSWA_CSW ]) { data [ STRUCT_CSWA_ITEMID ] = g_TargetGun ; data [ STRUCT_CSWA_CSW ] = WEAPON_CSWID ; data [ STRUCT_CSWA_CLIP ] = get_pcvar_num ( Cvars [ 2 ]); data [ STRUCT_CSWA_MAXCLIP ] = get_pcvar_num ( Cvars [ 2 ]); data [ STRUCT_CSWA_AMMO ] = get_pcvar_num ( Cvars [ 3 ]); data [ STRUCT_CSWA_STACKABLE ] = true ; data [ STRUCT_CSWA_SILENCED ] = - 1 ; data [ STRUCT_CSWA_SPEEDDELAY ] = _ : get_pcvar_float ( Cvars [ 4 ]); data [ STRUCT_CSWA_DAMAGE ] = _ : 0 ; data [ STRUCT_CSWA_RELOADTIME ] = _ : get_pcvar_float ( Cvars [ 5 ]); data [ STRUCT_CSWA_RECOIL ] = _ : get_pcvar_float ( Cvars [ 6 ]); data [ STRUCT_CSWA_MODEL_V ] = g_szFiles [ 0 ]; data [ STRUCT_CSWA_MODEL_P ] = g_szFiles [ 1 ]; data [ STRUCT_CSWA_MODEL_W ] = g_szFiles [ 2 ]; } cswa_give_specific ( id , data ); client_print_color ( id , print_team_default , "%s Compraste una !gTarget Gun!" , TTT_TAG ); g_Count [ id ]++; return PLUGIN_HANDLED ; } else { client_print_color ( id , print_team_default , "%s Limite maximo de !gTarget Guns !nalcanzado !g(!t%d!n por ronda!g)" , TTT_TAG , get_pcvar_num ( Cvars [ 8 ])); } } return PLUGIN_CONTINUE ; } public cswa_damage ( weapon_id , victim , attacker , Float : damage ) { if( get_weapon_edict ( weapon_id , REPL_CSWA_ITEMID ) == g_TargetGun ) { client_print_color ( victim , print_team_default , "%s Han introducido un !tProyectil Explosivo !nen ti, !gEXPLOTARAS!" , TTT_TAG ); g_Glowing [ victim ] = true ; g_Attacker [ victim ] = attacker ; set_user_rendering ( victim , kRenderFxGlowShell , 255 , 0 , 0 , kRenderNormal , 30 ); emit_sound ( victim , CHAN_AUTO , g_szFiles [ 3 ], 1.0 , ATTN_NORM , 0 , PITCH_NORM ); set_task ( get_pcvar_float ( Cvars [ 9 ]), "targetgun_Explode" , victim ); Set_user_screenfade ( victim , 255 , 0 , 0 , 2 , 100 ); shake_user_screen ( victim ); } } public plugin_natives () { register_native ( "ttt_target_gun" , "native_give_weapon_add" , 1 ); } public native_give_weapon_add ( id ) { targetgun_Explode ( id ); } public targetgun_Explode ( id ) { if( ! is_user_alive ( id ) || ttt_get_gamemode () != GAME_STARTED || ! is_user_connected ( g_Attacker [ id ]) ) { remove_task ( id ); return PLUGIN_HANDLED ; } strip_user_weapons ( id ); Explode ( id ); CreateExplosion ( id ); remove_task ( id ); return PLUGIN_HANDLED ; } CreateExplosion ( id ) { static Float : origin [ 3 ]; entity_get_vector ( id , EV_VEC_origin , origin ); new victim = - 1 , Float : damage ; new Float : radius = get_pcvar_float ( Cvars [ 1 ]); new Float : dmg = get_pcvar_float ( Cvars [ 0 ]); while(( victim = find_ent_in_sphere ( victim , origin , radius )) != 0 ) { if( is_valid_ent ( victim ) && entity_get_float ( victim , EV_FL_takedamage ) != DAMAGE_NO ) { damage = ( dmg / radius )*( radius - entity_range ( id , victim )); if( damage > 0.0 && is_user_alive ( victim )) { ttt_set_playerdata ( victim , PD_KILLEDBYITEM , g_TargetGun ); ExecuteHam ( Ham_TakeDamage , victim , g_Attacker [ id ], g_Attacker [ id ], damage , DMG_BLAST ); entity_set_vector ( victim , EV_VEC_velocity , Float :{ 0.0 , 0.0 , 0.0 }); } } } ttt_set_playerdata ( id , PD_KILLEDBYITEM , g_TargetGun ); ExecuteHam ( Ham_TakeDamage , id , g_Attacker [ id ], g_Attacker [ id ], dmg , DMG_BLAST ); } Explode ( id ) { static origin [ 3 ]; get_user_origin ( id , origin , 0 ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_TAREXPLOSION ); write_coord ( origin [ 0 ]); write_coord ( origin [ 1 ]); write_coord ( origin [ 2 ]); message_end (); } public Set_user_screenfade ( index , rrr , ggg , bbb , duracion , alpha ) { message_begin ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , g_pMsgScreeFade , _ , index ); write_short ( duracion * 4096 ); write_short ( duracion * 4096 ); write_short ( 0x0000 ); write_byte ( rrr ); write_byte ( ggg ); write_byte ( bbb ); write_byte ( alpha ); message_end ( ); } stock shake_user_screen ( index ) { message_begin ( MSG_ONE , g_pMsgScreeShake , { 0 , 0 , 0 }, index ); write_short ( 1 << 14 ); write_short ( 1 << 14 ); write_short ( 1 << 14 ); message_end (); }
Aprendiendo scripting || Tratare ayudar en lo que pueda || PD: Soy pobre
Mensajes: 173
Temas: 49
Registro en: Aug 2017
Reputación:
0
(28/01/2019, 11:22 PM) whOo escribió: Código PHP:
#include <amxmodx> #include <hamsandwich> #include <engine> #include <cs_weapons_api> #include <fun> #include <amx_settings_api> #include <ttt> #define WEAPON_CSWID CSW_DEAGLE #define WEAPON_NAME "weapon_deagle" new g_TargetGun , g_Glowing [ 33 ], g_Attacker [ 33 ], g_Count [ 33 ], g_pMsgScreeFade , g_pMsgScreeShake , g_MaxPlayers ; new g_szFiles [ 4 ][ TTT_FILELENGHT ], Cvars [ 10 ]; public plugin_precache () { const cantCases = 4 ; new szTypeFile [ 11 ], szPath [ 28 ]; for( new i = 0 ; i < cantCases ; i ++ ) { switch( i ) { case 0 : { szTypeFile = "MODEL_V" ; szPath = "models/ttt/v_targetgun.mdl" ; } case 1 : { szTypeFile = "MODEL_P" ; szPath = "models/ttt/p_targetgun.mdl" ; } case 2 : { szTypeFile = "MODEL_W" ; szPath = "models/ttt/w_targetgun.mdl" ; } case 3 : { szTypeFile = "SOUND_BEEP" ; szPath = "ttt/targetgun_beep.wav" ; } } if( ! amx_load_setting_string ( TTT_SETTINGSFILE , "TARGET GUN" , szTypeFile , g_szFiles [ i ], charsmax ( g_szFiles [])) ) { g_szFiles [ i ] = szPath ; amx_save_setting_string ( TTT_SETTINGSFILE , "TARGET GUN" , szTypeFile , g_szFiles [ i ]); } if( szTypeFile [ 0 ] == 'M' ) precache_model ( g_szFiles [ i ]); else precache_sound ( g_szFiles [ i ]); } } public plugin_init () { register_plugin ( "[TTT] Item: Target Gun" , TTT_VERSION , "SthoNy'" ); Cvars [ 0 ] = my_register_cvar ( "ttt_target_damage" , "300.0" , "Target gun explosion damage. (Default: 300.0)" ); Cvars [ 1 ] = my_register_cvar ( "ttt_target_radius" , "420.0" , "Target gun radius. (Default: 420.0)" ); Cvars [ 2 ] = my_register_cvar ( "ttt_target_clip" , "1" , "Target gun clip ammo. (Default: 1)" ); Cvars [ 3 ] = my_register_cvar ( "ttt_target_ammo" , "0" , "Target gun backpack ammo. (Default: 0)" ); Cvars [ 4 ] = my_register_cvar ( "ttt_target_speed" , "10.0" , "Target gun attack speed delay. (Default: 10.0)" ); Cvars [ 5 ] = my_register_cvar ( "ttt_target_reload" , "0.0" , "Target gun reload speed. (Default: 0.0)" ); Cvars [ 6 ] = my_register_cvar ( "ttt_target_recoil" , "0.0" , "Target gun recoil. (Default: 0.0)" ); Cvars [ 7 ] = my_register_cvar ( "ttt_price_target" , "2" , "Target gun price. (Default: 3)" ); Cvars [ 8 ] = my_register_cvar ( "ttt_max_targets" , "1" , "Maximum Target Gun per round. (Default: 1)" ); Cvars [ 9 ] = my_register_cvar ( "ttt_time_explode" , "3.0" , "Target gun time to explode (Default: 3.0)" ); g_MaxPlayers = get_maxplayers (); g_pMsgScreeFade = get_user_msgid ( "ScreenFade" ); g_pMsgScreeShake = get_user_msgid ( "ScreenShake" ); } public client_disconnected ( id ) remove_task ( id ); public ttt_plugin_cfg () g_TargetGun = ttt_buymenu_add ( "Target Gun" , get_pcvar_num ( Cvars [ 7 ]), PC_TRAITOR ); public ttt_gamemode ( gamemode ) { if( gamemode == GAME_ENDED || gamemode == GAME_RESTARTING || gamemode == GAME_PREPARING ) { for( new i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( g_Glowing [ i ]) { g_Glowing [ i ] = false ; set_user_rendering ( i ); } remove_task ( i ); g_Count [ i ] = 0 ; } } } public ttt_item_selected ( id , item , name [], price ) { if( g_TargetGun == item ) { if( g_Count [ id ] < get_pcvar_num ( Cvars [ 8 ])) { if( user_has_weapon ( id , WEAPON_CSWID )) engclient_cmd ( id , "drop" , WEAPON_NAME ); static data [ STOREABLE_STRUCTURE ]; if(! data [ STRUCT_CSWA_CSW ]) { data [ STRUCT_CSWA_ITEMID ] = g_TargetGun ; data [ STRUCT_CSWA_CSW ] = WEAPON_CSWID ; data [ STRUCT_CSWA_CLIP ] = get_pcvar_num ( Cvars [ 2 ]); data [ STRUCT_CSWA_MAXCLIP ] = get_pcvar_num ( Cvars [ 2 ]); data [ STRUCT_CSWA_AMMO ] = get_pcvar_num ( Cvars [ 3 ]); data [ STRUCT_CSWA_STACKABLE ] = true ; data [ STRUCT_CSWA_SILENCED ] = - 1 ; data [ STRUCT_CSWA_SPEEDDELAY ] = _ : get_pcvar_float ( Cvars [ 4 ]); data [ STRUCT_CSWA_DAMAGE ] = _ : 0 ; data [ STRUCT_CSWA_RELOADTIME ] = _ : get_pcvar_float ( Cvars [ 5 ]); data [ STRUCT_CSWA_RECOIL ] = _ : get_pcvar_float ( Cvars [ 6 ]); data [ STRUCT_CSWA_MODEL_V ] = g_szFiles [ 0 ]; data [ STRUCT_CSWA_MODEL_P ] = g_szFiles [ 1 ]; data [ STRUCT_CSWA_MODEL_W ] = g_szFiles [ 2 ]; } cswa_give_specific ( id , data ); client_print_color ( id , print_team_default , "%s Compraste una !gTarget Gun!" , TTT_TAG ); g_Count [ id ]++; return PLUGIN_HANDLED ; } else { client_print_color ( id , print_team_default , "%s Limite maximo de !gTarget Guns !nalcanzado !g(!t%d!n por ronda!g)" , TTT_TAG , get_pcvar_num ( Cvars [ 8 ])); } } return PLUGIN_CONTINUE ; } public cswa_damage ( weapon_id , victim , attacker , Float : damage ) { if( get_weapon_edict ( weapon_id , REPL_CSWA_ITEMID ) == g_TargetGun ) { client_print_color ( victim , print_team_default , "%s Han introducido un !tProyectil Explosivo !nen ti, !gEXPLOTARAS!" , TTT_TAG ); g_Glowing [ victim ] = true ; g_Attacker [ victim ] = attacker ; set_user_rendering ( victim , kRenderFxGlowShell , 255 , 0 , 0 , kRenderNormal , 30 ); emit_sound ( victim , CHAN_AUTO , g_szFiles [ 3 ], 1.0 , ATTN_NORM , 0 , PITCH_NORM ); set_task ( get_pcvar_float ( Cvars [ 9 ]), "targetgun_Explode" , victim ); Set_user_screenfade ( victim , 255 , 0 , 0 , 2 , 100 ); shake_user_screen ( victim ); } } public plugin_natives () { register_native ( "ttt_target_gun" , "native_give_weapon_add" , 1 ); } public native_give_weapon_add ( id ) { targetgun_Explode ( id ); } public targetgun_Explode ( id ) { if( ! is_user_alive ( id ) || ttt_get_gamemode () != GAME_STARTED || ! is_user_connected ( g_Attacker [ id ]) ) { remove_task ( id ); return PLUGIN_HANDLED ; } strip_user_weapons ( id ); Explode ( id ); CreateExplosion ( id ); remove_task ( id ); return PLUGIN_HANDLED ; } CreateExplosion ( id ) { static Float : origin [ 3 ]; entity_get_vector ( id , EV_VEC_origin , origin ); new victim = - 1 , Float : damage ; new Float : radius = get_pcvar_float ( Cvars [ 1 ]); new Float : dmg = get_pcvar_float ( Cvars [ 0 ]); while(( victim = find_ent_in_sphere ( victim , origin , radius )) != 0 ) { if( is_valid_ent ( victim ) && entity_get_float ( victim , EV_FL_takedamage ) != DAMAGE_NO ) { damage = ( dmg / radius )*( radius - entity_range ( id , victim )); if( damage > 0.0 && is_user_alive ( victim )) { ttt_set_playerdata ( victim , PD_KILLEDBYITEM , g_TargetGun ); ExecuteHam ( Ham_TakeDamage , victim , g_Attacker [ id ], g_Attacker [ id ], damage , DMG_BLAST ); entity_set_vector ( victim , EV_VEC_velocity , Float :{ 0.0 , 0.0 , 0.0 }); } } } ttt_set_playerdata ( id , PD_KILLEDBYITEM , g_TargetGun ); ExecuteHam ( Ham_TakeDamage , id , g_Attacker [ id ], g_Attacker [ id ], dmg , DMG_BLAST ); } Explode ( id ) { static origin [ 3 ]; get_user_origin ( id , origin , 0 ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_TAREXPLOSION ); write_coord ( origin [ 0 ]); write_coord ( origin [ 1 ]); write_coord ( origin [ 2 ]); message_end (); } public Set_user_screenfade ( index , rrr , ggg , bbb , duracion , alpha ) { message_begin ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , g_pMsgScreeFade , _ , index ); write_short ( duracion * 4096 ); write_short ( duracion * 4096 ); write_short ( 0x0000 ); write_byte ( rrr ); write_byte ( ggg ); write_byte ( bbb ); write_byte ( alpha ); message_end ( ); } stock shake_user_screen ( index ) { message_begin ( MSG_ONE , g_pMsgScreeShake , { 0 , 0 , 0 }, index ); write_short ( 1 << 14 ); write_short ( 1 << 14 ); write_short ( 1 << 14 ); message_end (); }
Gracias me sirvio ahora quiero saber como ponerlo en el menu ya que intente pero solo se bugeo el mod y tuve que quitar el plugin y poner el anterior
Ze_Jurassic_World_Z [52% ]
Ze_Jumping_Area [37% ]
(04/02/2019, 05:15 PM) kikizon2 escribió: Me voy por un tiempo y cuando regreso veo esto...
Mensajes: 208
Temas: 56
Registro en: Nov 2018
Reputación:
1
(29/01/2019, 02:45 PM) LIL8ZINN escribió: (28/01/2019, 11:22 PM) whOo escribió: Código PHP:
#include <amxmodx> #include <hamsandwich> #include <engine> #include <cs_weapons_api> #include <fun> #include <amx_settings_api> #include <ttt> #define WEAPON_CSWID CSW_DEAGLE #define WEAPON_NAME "weapon_deagle" new g_TargetGun , g_Glowing [ 33 ], g_Attacker [ 33 ], g_Count [ 33 ], g_pMsgScreeFade , g_pMsgScreeShake , g_MaxPlayers ; new g_szFiles [ 4 ][ TTT_FILELENGHT ], Cvars [ 10 ]; public plugin_precache () { const cantCases = 4 ; new szTypeFile [ 11 ], szPath [ 28 ]; for( new i = 0 ; i < cantCases ; i ++ ) { switch( i ) { case 0 : { szTypeFile = "MODEL_V" ; szPath = "models/ttt/v_targetgun.mdl" ; } case 1 : { szTypeFile = "MODEL_P" ; szPath = "models/ttt/p_targetgun.mdl" ; } case 2 : { szTypeFile = "MODEL_W" ; szPath = "models/ttt/w_targetgun.mdl" ; } case 3 : { szTypeFile = "SOUND_BEEP" ; szPath = "ttt/targetgun_beep.wav" ; } } if( ! amx_load_setting_string ( TTT_SETTINGSFILE , "TARGET GUN" , szTypeFile , g_szFiles [ i ], charsmax ( g_szFiles [])) ) { g_szFiles [ i ] = szPath ; amx_save_setting_string ( TTT_SETTINGSFILE , "TARGET GUN" , szTypeFile , g_szFiles [ i ]); } if( szTypeFile [ 0 ] == 'M' ) precache_model ( g_szFiles [ i ]); else precache_sound ( g_szFiles [ i ]); } } public plugin_init () { register_plugin ( "[TTT] Item: Target Gun" , TTT_VERSION , "SthoNy'" ); Cvars [ 0 ] = my_register_cvar ( "ttt_target_damage" , "300.0" , "Target gun explosion damage. (Default: 300.0)" ); Cvars [ 1 ] = my_register_cvar ( "ttt_target_radius" , "420.0" , "Target gun radius. (Default: 420.0)" ); Cvars [ 2 ] = my_register_cvar ( "ttt_target_clip" , "1" , "Target gun clip ammo. (Default: 1)" ); Cvars [ 3 ] = my_register_cvar ( "ttt_target_ammo" , "0" , "Target gun backpack ammo. (Default: 0)" ); Cvars [ 4 ] = my_register_cvar ( "ttt_target_speed" , "10.0" , "Target gun attack speed delay. (Default: 10.0)" ); Cvars [ 5 ] = my_register_cvar ( "ttt_target_reload" , "0.0" , "Target gun reload speed. (Default: 0.0)" ); Cvars [ 6 ] = my_register_cvar ( "ttt_target_recoil" , "0.0" , "Target gun recoil. (Default: 0.0)" ); Cvars [ 7 ] = my_register_cvar ( "ttt_price_target" , "2" , "Target gun price. (Default: 3)" ); Cvars [ 8 ] = my_register_cvar ( "ttt_max_targets" , "1" , "Maximum Target Gun per round. (Default: 1)" ); Cvars [ 9 ] = my_register_cvar ( "ttt_time_explode" , "3.0" , "Target gun time to explode (Default: 3.0)" ); g_MaxPlayers = get_maxplayers (); g_pMsgScreeFade = get_user_msgid ( "ScreenFade" ); g_pMsgScreeShake = get_user_msgid ( "ScreenShake" ); } public client_disconnected ( id ) remove_task ( id ); public ttt_plugin_cfg () g_TargetGun = ttt_buymenu_add ( "Target Gun" , get_pcvar_num ( Cvars [ 7 ]), PC_TRAITOR ); public ttt_gamemode ( gamemode ) { if( gamemode == GAME_ENDED || gamemode == GAME_RESTARTING || gamemode == GAME_PREPARING ) { for( new i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( g_Glowing [ i ]) { g_Glowing [ i ] = false ; set_user_rendering ( i ); } remove_task ( i ); g_Count [ i ] = 0 ; } } } public ttt_item_selected ( id , item , name [], price ) { if( g_TargetGun == item ) { if( g_Count [ id ] < get_pcvar_num ( Cvars [ 8 ])) { if( user_has_weapon ( id , WEAPON_CSWID )) engclient_cmd ( id , "drop" , WEAPON_NAME ); static data [ STOREABLE_STRUCTURE ]; if(! data [ STRUCT_CSWA_CSW ]) { data [ STRUCT_CSWA_ITEMID ] = g_TargetGun ; data [ STRUCT_CSWA_CSW ] = WEAPON_CSWID ; data [ STRUCT_CSWA_CLIP ] = get_pcvar_num ( Cvars [ 2 ]); data [ STRUCT_CSWA_MAXCLIP ] = get_pcvar_num ( Cvars [ 2 ]); data [ STRUCT_CSWA_AMMO ] = get_pcvar_num ( Cvars [ 3 ]); data [ STRUCT_CSWA_STACKABLE ] = true ; data [ STRUCT_CSWA_SILENCED ] = - 1 ; data [ STRUCT_CSWA_SPEEDDELAY ] = _ : get_pcvar_float ( Cvars [ 4 ]); data [ STRUCT_CSWA_DAMAGE ] = _ : 0 ; data [ STRUCT_CSWA_RELOADTIME ] = _ : get_pcvar_float ( Cvars [ 5 ]); data [ STRUCT_CSWA_RECOIL ] = _ : get_pcvar_float ( Cvars [ 6 ]); data [ STRUCT_CSWA_MODEL_V ] = g_szFiles [ 0 ]; data [ STRUCT_CSWA_MODEL_P ] = g_szFiles [ 1 ]; data [ STRUCT_CSWA_MODEL_W ] = g_szFiles [ 2 ]; } cswa_give_specific ( id , data ); client_print_color ( id , print_team_default , "%s Compraste una !gTarget Gun!" , TTT_TAG ); g_Count [ id ]++; return PLUGIN_HANDLED ; } else { client_print_color ( id , print_team_default , "%s Limite maximo de !gTarget Guns !nalcanzado !g(!t%d!n por ronda!g)" , TTT_TAG , get_pcvar_num ( Cvars [ 8 ])); } } return PLUGIN_CONTINUE ; } public cswa_damage ( weapon_id , victim , attacker , Float : damage ) { if( get_weapon_edict ( weapon_id , REPL_CSWA_ITEMID ) == g_TargetGun ) { client_print_color ( victim , print_team_default , "%s Han introducido un !tProyectil Explosivo !nen ti, !gEXPLOTARAS!" , TTT_TAG ); g_Glowing [ victim ] = true ; g_Attacker [ victim ] = attacker ; set_user_rendering ( victim , kRenderFxGlowShell , 255 , 0 , 0 , kRenderNormal , 30 ); emit_sound ( victim , CHAN_AUTO , g_szFiles [ 3 ], 1.0 , ATTN_NORM , 0 , PITCH_NORM ); set_task ( get_pcvar_float ( Cvars [ 9 ]), "targetgun_Explode" , victim ); Set_user_screenfade ( victim , 255 , 0 , 0 , 2 , 100 ); shake_user_screen ( victim ); } } public plugin_natives () { register_native ( "ttt_target_gun" , "native_give_weapon_add" , 1 ); } public native_give_weapon_add ( id ) { targetgun_Explode ( id ); } public targetgun_Explode ( id ) { if( ! is_user_alive ( id ) || ttt_get_gamemode () != GAME_STARTED || ! is_user_connected ( g_Attacker [ id ]) ) { remove_task ( id ); return PLUGIN_HANDLED ; } strip_user_weapons ( id ); Explode ( id ); CreateExplosion ( id ); remove_task ( id ); return PLUGIN_HANDLED ; } CreateExplosion ( id ) { static Float : origin [ 3 ]; entity_get_vector ( id , EV_VEC_origin , origin ); new victim = - 1 , Float : damage ; new Float : radius = get_pcvar_float ( Cvars [ 1 ]); new Float : dmg = get_pcvar_float ( Cvars [ 0 ]); while(( victim = find_ent_in_sphere ( victim , origin , radius )) != 0 ) { if( is_valid_ent ( victim ) && entity_get_float ( victim , EV_FL_takedamage ) != DAMAGE_NO ) { damage = ( dmg / radius )*( radius - entity_range ( id , victim )); if( damage > 0.0 && is_user_alive ( victim )) { ttt_set_playerdata ( victim , PD_KILLEDBYITEM , g_TargetGun ); ExecuteHam ( Ham_TakeDamage , victim , g_Attacker [ id ], g_Attacker [ id ], damage , DMG_BLAST ); entity_set_vector ( victim , EV_VEC_velocity , Float :{ 0.0 , 0.0 , 0.0 }); } } } ttt_set_playerdata ( id , PD_KILLEDBYITEM , g_TargetGun ); ExecuteHam ( Ham_TakeDamage , id , g_Attacker [ id ], g_Attacker [ id ], dmg , DMG_BLAST ); } Explode ( id ) { static origin [ 3 ]; get_user_origin ( id , origin , 0 ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_TAREXPLOSION ); write_coord ( origin [ 0 ]); write_coord ( origin [ 1 ]); write_coord ( origin [ 2 ]); message_end (); } public Set_user_screenfade ( index , rrr , ggg , bbb , duracion , alpha ) { message_begin ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , g_pMsgScreeFade , _ , index ); write_short ( duracion * 4096 ); write_short ( duracion * 4096 ); write_short ( 0x0000 ); write_byte ( rrr ); write_byte ( ggg ); write_byte ( bbb ); write_byte ( alpha ); message_end ( ); } stock shake_user_screen ( index ) { message_begin ( MSG_ONE , g_pMsgScreeShake , { 0 , 0 , 0 }, index ); write_short ( 1 << 14 ); write_short ( 1 << 14 ); write_short ( 1 << 14 ); message_end (); }
Gracias me sirvio ahora quiero saber como ponerlo en el menu ya que intente pero solo se bugeo el mod y tuve que quitar el plugin y poner el anterior
en que se bugeaba
Aprendiendo scripting || Tratare ayudar en lo que pueda || PD: Soy pobre
Mensajes: 173
Temas: 49
Registro en: Aug 2017
Reputación:
0
(29/01/2019, 08:32 PM) whOo escribió: (29/01/2019, 02:45 PM) LIL8ZINN escribió: (28/01/2019, 11:22 PM) whOo escribió: Código PHP:
#include <amxmodx> #include <hamsandwich> #include <engine> #include <cs_weapons_api> #include <fun> #include <amx_settings_api> #include <ttt> #define WEAPON_CSWID CSW_DEAGLE #define WEAPON_NAME "weapon_deagle" new g_TargetGun , g_Glowing [ 33 ], g_Attacker [ 33 ], g_Count [ 33 ], g_pMsgScreeFade , g_pMsgScreeShake , g_MaxPlayers ; new g_szFiles [ 4 ][ TTT_FILELENGHT ], Cvars [ 10 ]; public plugin_precache () { const cantCases = 4 ; new szTypeFile [ 11 ], szPath [ 28 ]; for( new i = 0 ; i < cantCases ; i ++ ) { switch( i ) { case 0 : { szTypeFile = "MODEL_V" ; szPath = "models/ttt/v_targetgun.mdl" ; } case 1 : { szTypeFile = "MODEL_P" ; szPath = "models/ttt/p_targetgun.mdl" ; } case 2 : { szTypeFile = "MODEL_W" ; szPath = "models/ttt/w_targetgun.mdl" ; } case 3 : { szTypeFile = "SOUND_BEEP" ; szPath = "ttt/targetgun_beep.wav" ; } } if( ! amx_load_setting_string ( TTT_SETTINGSFILE , "TARGET GUN" , szTypeFile , g_szFiles [ i ], charsmax ( g_szFiles [])) ) { g_szFiles [ i ] = szPath ; amx_save_setting_string ( TTT_SETTINGSFILE , "TARGET GUN" , szTypeFile , g_szFiles [ i ]); } if( szTypeFile [ 0 ] == 'M' ) precache_model ( g_szFiles [ i ]); else precache_sound ( g_szFiles [ i ]); } } public plugin_init () { register_plugin ( "[TTT] Item: Target Gun" , TTT_VERSION , "SthoNy'" ); Cvars [ 0 ] = my_register_cvar ( "ttt_target_damage" , "300.0" , "Target gun explosion damage. (Default: 300.0)" ); Cvars [ 1 ] = my_register_cvar ( "ttt_target_radius" , "420.0" , "Target gun radius. (Default: 420.0)" ); Cvars [ 2 ] = my_register_cvar ( "ttt_target_clip" , "1" , "Target gun clip ammo. (Default: 1)" ); Cvars [ 3 ] = my_register_cvar ( "ttt_target_ammo" , "0" , "Target gun backpack ammo. (Default: 0)" ); Cvars [ 4 ] = my_register_cvar ( "ttt_target_speed" , "10.0" , "Target gun attack speed delay. (Default: 10.0)" ); Cvars [ 5 ] = my_register_cvar ( "ttt_target_reload" , "0.0" , "Target gun reload speed. (Default: 0.0)" ); Cvars [ 6 ] = my_register_cvar ( "ttt_target_recoil" , "0.0" , "Target gun recoil. (Default: 0.0)" ); Cvars [ 7 ] = my_register_cvar ( "ttt_price_target" , "2" , "Target gun price. (Default: 3)" ); Cvars [ 8 ] = my_register_cvar ( "ttt_max_targets" , "1" , "Maximum Target Gun per round. (Default: 1)" ); Cvars [ 9 ] = my_register_cvar ( "ttt_time_explode" , "3.0" , "Target gun time to explode (Default: 3.0)" ); g_MaxPlayers = get_maxplayers (); g_pMsgScreeFade = get_user_msgid ( "ScreenFade" ); g_pMsgScreeShake = get_user_msgid ( "ScreenShake" ); } public client_disconnected ( id ) remove_task ( id ); public ttt_plugin_cfg () g_TargetGun = ttt_buymenu_add ( "Target Gun" , get_pcvar_num ( Cvars [ 7 ]), PC_TRAITOR ); public ttt_gamemode ( gamemode ) { if( gamemode == GAME_ENDED || gamemode == GAME_RESTARTING || gamemode == GAME_PREPARING ) { for( new i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( g_Glowing [ i ]) { g_Glowing [ i ] = false ; set_user_rendering ( i ); } remove_task ( i ); g_Count [ i ] = 0 ; } } } public ttt_item_selected ( id , item , name [], price ) { if( g_TargetGun == item ) { if( g_Count [ id ] < get_pcvar_num ( Cvars [ 8 ])) { if( user_has_weapon ( id , WEAPON_CSWID )) engclient_cmd ( id , "drop" , WEAPON_NAME ); static data [ STOREABLE_STRUCTURE ]; if(! data [ STRUCT_CSWA_CSW ]) { data [ STRUCT_CSWA_ITEMID ] = g_TargetGun ; data [ STRUCT_CSWA_CSW ] = WEAPON_CSWID ; data [ STRUCT_CSWA_CLIP ] = get_pcvar_num ( Cvars [ 2 ]); data [ STRUCT_CSWA_MAXCLIP ] = get_pcvar_num ( Cvars [ 2 ]); data [ STRUCT_CSWA_AMMO ] = get_pcvar_num ( Cvars [ 3 ]); data [ STRUCT_CSWA_STACKABLE ] = true ; data [ STRUCT_CSWA_SILENCED ] = - 1 ; data [ STRUCT_CSWA_SPEEDDELAY ] = _ : get_pcvar_float ( Cvars [ 4 ]); data [ STRUCT_CSWA_DAMAGE ] = _ : 0 ; data [ STRUCT_CSWA_RELOADTIME ] = _ : get_pcvar_float ( Cvars [ 5 ]); data [ STRUCT_CSWA_RECOIL ] = _ : get_pcvar_float ( Cvars [ 6 ]); data [ STRUCT_CSWA_MODEL_V ] = g_szFiles [ 0 ]; data [ STRUCT_CSWA_MODEL_P ] = g_szFiles [ 1 ]; data [ STRUCT_CSWA_MODEL_W ] = g_szFiles [ 2 ]; } cswa_give_specific ( id , data ); client_print_color ( id , print_team_default , "%s Compraste una !gTarget Gun!" , TTT_TAG ); g_Count [ id ]++; return PLUGIN_HANDLED ; } else { client_print_color ( id , print_team_default , "%s Limite maximo de !gTarget Guns !nalcanzado !g(!t%d!n por ronda!g)" , TTT_TAG , get_pcvar_num ( Cvars [ 8 ])); } } return PLUGIN_CONTINUE ; } public cswa_damage ( weapon_id , victim , attacker , Float : damage ) { if( get_weapon_edict ( weapon_id , REPL_CSWA_ITEMID ) == g_TargetGun ) { client_print_color ( victim , print_team_default , "%s Han introducido un !tProyectil Explosivo !nen ti, !gEXPLOTARAS!" , TTT_TAG ); g_Glowing [ victim ] = true ; g_Attacker [ victim ] = attacker ; set_user_rendering ( victim , kRenderFxGlowShell , 255 , 0 , 0 , kRenderNormal , 30 ); emit_sound ( victim , CHAN_AUTO , g_szFiles [ 3 ], 1.0 , ATTN_NORM , 0 , PITCH_NORM ); set_task ( get_pcvar_float ( Cvars [ 9 ]), "targetgun_Explode" , victim ); Set_user_screenfade ( victim , 255 , 0 , 0 , 2 , 100 ); shake_user_screen ( victim ); } } public plugin_natives () { register_native ( "ttt_target_gun" , "native_give_weapon_add" , 1 ); } public native_give_weapon_add ( id ) { targetgun_Explode ( id ); } public targetgun_Explode ( id ) { if( ! is_user_alive ( id ) || ttt_get_gamemode () != GAME_STARTED || ! is_user_connected ( g_Attacker [ id ]) ) { remove_task ( id ); return PLUGIN_HANDLED ; } strip_user_weapons ( id ); Explode ( id ); CreateExplosion ( id ); remove_task ( id ); return PLUGIN_HANDLED ; } CreateExplosion ( id ) { static Float : origin [ 3 ]; entity_get_vector ( id , EV_VEC_origin , origin ); new victim = - 1 , Float : damage ; new Float : radius = get_pcvar_float ( Cvars [ 1 ]); new Float : dmg = get_pcvar_float ( Cvars [ 0 ]); while(( victim = find_ent_in_sphere ( victim , origin , radius )) != 0 ) { if( is_valid_ent ( victim ) && entity_get_float ( victim , EV_FL_takedamage ) != DAMAGE_NO ) { damage = ( dmg / radius )*( radius - entity_range ( id , victim )); if( damage > 0.0 && is_user_alive ( victim )) { ttt_set_playerdata ( victim , PD_KILLEDBYITEM , g_TargetGun ); ExecuteHam ( Ham_TakeDamage , victim , g_Attacker [ id ], g_Attacker [ id ], damage , DMG_BLAST ); entity_set_vector ( victim , EV_VEC_velocity , Float :{ 0.0 , 0.0 , 0.0 }); } } } ttt_set_playerdata ( id , PD_KILLEDBYITEM , g_TargetGun ); ExecuteHam ( Ham_TakeDamage , id , g_Attacker [ id ], g_Attacker [ id ], dmg , DMG_BLAST ); } Explode ( id ) { static origin [ 3 ]; get_user_origin ( id , origin , 0 ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_TAREXPLOSION ); write_coord ( origin [ 0 ]); write_coord ( origin [ 1 ]); write_coord ( origin [ 2 ]); message_end (); } public Set_user_screenfade ( index , rrr , ggg , bbb , duracion , alpha ) { message_begin ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , g_pMsgScreeFade , _ , index ); write_short ( duracion * 4096 ); write_short ( duracion * 4096 ); write_short ( 0x0000 ); write_byte ( rrr ); write_byte ( ggg ); write_byte ( bbb ); write_byte ( alpha ); message_end ( ); } stock shake_user_screen ( index ) { message_begin ( MSG_ONE , g_pMsgScreeShake , { 0 , 0 , 0 }, index ); write_short ( 1 << 14 ); write_short ( 1 << 14 ); write_short ( 1 << 14 ); message_end (); }
Gracias me sirvio ahora quiero saber como ponerlo en el menu ya que intente pero solo se bugeo el mod y tuve que quitar el plugin y poner el anterior
en que se bugeaba
Lo que hacia era que como que bloqueaba el menu de "
/buy " para Detective y Traidor y lo quite y se arreglo pero seguia saliendo el karma y la HP
Ze_Jurassic_World_Z [52% ]
Ze_Jumping_Area [37% ]
(04/02/2019, 05:15 PM) kikizon2 escribió: Me voy por un tiempo y cuando regreso veo esto...