Am si eu nevoie de ajutor cu acest plugin.
Am primit o eroare si nu stiu exact de ce si cum sa o repar. Serverul a picat in urma acestei erori.
[ PLUGIN ]
- | Afiseaza codul
#include <amxmodx> #include <amxmisc> #include <fvault> #include <colorchat> #include <cstrike> #define TASK_CANCEL 235 #define MAX_PREFIX_CHARS 25 native get_gold_coins( id ) native set_gold_coins( id, num ) new const PrefixVault[] = "Buy_Prefix_Vault"; new g_iTrialPeriod[ 33 ] new g_iUID[ 33 ] new g_szPrefix[ 33 ][ 32 ] new g_szUntilDate[ 33 ][ 32 ] new bool: g_bAllowedChange[ 33 ] new g_iDays[ 33 ], g_iItem[ 33 ] new const g_szRestrictString[][] = { "/", "*", "owner", "admin", "founder", "co-owner", "insane", "VIP", "GOLD", "SILVER", "administrator", "moderator", "helper", "slot", "****", "****", "sugi", "****", "retard", "manager" } new const g_iSortCoins[ 7 ][ 2 ] = { { 3, 50 }, { 5, 100 }, { 7, 300 }, { 10, 500 }, { 15, 700 }, { 30, 1200 }, { 365, 3500 } } public plugin_init() { register_plugin( "Buy Prefix Days", "1.0", "LLGRo" ) register_clcmd( "say /buytag", "buy_prefix" ) register_clcmd( "say", "say_prefix" ) register_clcmd( "say_team", "say_team_prefix" ) register_concmd( "set_my_prefix", "check_my_prefix" ) set_task( 20.0, "task_check_trial", .flags = "b" ) } public task_check_trial() { for( new id = 1; id <= get_maxplayers(); id++ ) { if( !is_user_connected( id ) ) continue if( !g_szPrefix[ id ][ 0 ] ) continue if( get_systime() > g_iTrialPeriod[ id ] ) { ColorChat( id, GREY, "^1(^4LLG^1) Your ^4Prefix^1 period is^4 Over^1 !" ) g_szPrefix[ id ][ 0 ] = EOS g_iTrialPeriod[ id ] = 0 g_szUntilDate[ id ][ 0 ] = EOS g_iDays[ id ] = 0 new sid[ 35 ]; get_user_authid( id, sid, charsmax( sid ) ) fvault_remove_key( PrefixVault, sid ) } } } public say_prefix( id ) { new text[ 100 ] read_args( text, charsmax( text ) ) remove_quotes( text ) if( !text[ 0 ] ) return PLUGIN_HANDLED new prefix_be[ 40 ] if( g_szPrefix[ id ][ 0 ] ) formatex( prefix_be, charsmax( prefix_be ), "^1(^4%s^1) ", g_szPrefix[ id ] ) ColorChat( 0, cs_get_user_team( id ) == CS_TEAM_T ? RED:BLUE, "%s%s^3%n:%s %s", is_user_alive( id ) ? "":"^1*DEAD* ", prefix_be, id, get_user_flags( id ) & ADMIN_RESERVATION ? "^4":"^1", text ) return PLUGIN_HANDLED_MAIN } public say_team_prefix( id ) { new text[ 100 ] read_args( text, charsmax( text ) ) remove_quotes( text ) if( !text[ 0 ] ) return PLUGIN_HANDLED new prefix_be[ 40 ] if( g_szPrefix[ id ][ 0 ] ) formatex( prefix_be, charsmax( prefix_be ), "^1(^4%s^1) ", g_szPrefix[ id ] ) for( new i = 1; i <= get_maxplayers(); i++ ) { if( !is_user_connected( i ) ) continue if( cs_get_user_team( id ) != cs_get_user_team( i ) ) continue ColorChat( i, cs_get_user_team( id ) == CS_TEAM_T ? RED:BLUE, "^1(%sTerrorist) %s%s^3%n:%s %s", cs_get_user_team( id ) == CS_TEAM_CT ? "Counter-":"", is_user_alive( id ) ? "":"^1*DEAD* ", prefix_be, id, get_user_flags( id ) & ADMIN_RESERVATION ? "^4":"^1", text ) } return PLUGIN_HANDLED_MAIN } public client_putinserver( id ) { g_bAllowedChange[ id ] = false g_szPrefix[ id ][ 0 ] = EOS g_szUntilDate[ id ][ 0 ] = EOS g_iTrialPeriod[ id ] = 0 g_iDays[ id ] = 0 g_iItem[ id ] = -1 Load_Data( id ) set_task( 2.0, "task_check_trial" ) } public client_disconnected( id ) { g_iTrialPeriod[ id ] = 0 g_szPrefix[ id ][ 0 ] = EOS g_szUntilDate[ id ][ 0 ] = EOS g_bAllowedChange[ id ] = false g_iDays[ id ] = 0 g_iItem[ id ] = -1 remove_task( id + TASK_CANCEL ) } public Load_Data( id ) { new szAuthId[ 35 ] get_user_authid( id, szAuthId, charsmax( szAuthId ) ) if( !szAuthId[ 0 ] || ( !equal(szAuthId, "STEAM_", 6 ) && !equal( szAuthId, "VALVE_", 6 ) ) ) return new szBuffer[ 56 ], data[ 4 ][ 32 ] g_iUID[ id ] = get_user_userid( id ) if( fvault_get_data( PrefixVault, szAuthId, szBuffer, charsmax( szBuffer ) ) ) { if( g_iUID[ id ] == get_user_userid( id ) ) { parse( szBuffer, data[ 0 ], charsmax( data[] ), data[ 1 ], charsmax( data[] ), data[ 2 ], charsmax( data[] ) ) g_iTrialPeriod[ id ] = str_to_num( data[ 0 ] ) formatex( g_szPrefix[ id ], charsmax( g_szPrefix[] ), data[ 1 ] ) formatex( g_szUntilDate[ id ], charsmax( g_szUntilDate[] ), data[ 2 ] ) } } } public Save_Data( id ) { new szAuthId[ 35 ] get_user_authid( id, szAuthId, charsmax( szAuthId ) ) if( g_iUID[ id ] != get_user_userid( id ) ) { ColorChat( id, RED, "^1(^4LLG^1) Error happened with your ^4Prefix Data^1. ^1Please contact the ^4owner^1." ) return } if( !equal( szAuthId, "STEAM_", 6 ) ) return new szBuffer[ 56 ] formatex( szBuffer, charsmax( szBuffer ), "%d ^"%s^" %s", g_iTrialPeriod[ id ], g_szPrefix[ id ], g_szUntilDate[ id ] ) fvault_pset_data( PrefixVault, szAuthId, szBuffer ) } public buy_prefix( id ) { if( g_iDays[ id ] || g_szPrefix[ id ][ 0 ] ) { ColorChat( id, BLUE, "^1(^4Until^1): %s^4 (%s)", until_time( g_iTrialPeriod[ id ] - get_systime() ), g_szUntilDate[ id ] ) ColorChat( id, BLUE, "^1(^4LLG^1) You already have^4 TAG^1, contact ^4owner ^1for any changes." ) return PLUGIN_HANDLED } new menu = menu_create( "\r(LLG)\y Buy Tag", "handle_prefix" ) for( new i; i < 7; i++ ) { menu_additem( menu, fmt( "\yTAG \r%d \wDays - \y%d (Gold Coins)", g_iSortCoins[ i ][ 0 ], g_iSortCoins[ i ][ 1 ] ) ) } menu_display( id, menu ) return PLUGIN_HANDLED } public handle_prefix( id, menu, item ) { if( item == MENU_EXIT ) { menu_destroy( menu ) return PLUGIN_HANDLED } if( get_gold_coins( id ) < g_iSortCoins[ item ][ 1 ] ) { ColorChat( id, RED, "^1(^4LLG^1) You don't have enough^4 Gold Coins^1 for it." ) return PLUGIN_HANDLED } g_iDays[ id ] = g_iSortCoins[ item ][ 0 ] g_iItem[ id ] = item ColorChat( id, BLUE, "^1(^4LLG^1) You choose^3 %d days^1. Write your ^4prefix ^1now:", g_iSortCoins[ item ][ 0 ] ) set_his_prefix( id, item ) menu_destroy( menu ) return PLUGIN_HANDLED } public set_his_prefix( id, days ) { g_bAllowedChange[ id ] = true client_cmd( id, "messagemode set_my_prefix" ) set_task( 30.0, "cancel_prefix", id + TASK_CANCEL ) } public cancel_prefix( task ) { new id = task - TASK_CANCEL if( g_bAllowedChange[ id ] ) { client_cmd( id, "cancelselect" ) g_bAllowedChange[ id ] = false ColorChat( id, RED, "^1(^4LLG^1) You did not write anything in^4 30 seconds^1, please try again." ) g_iDays[ id ] = 0 } } public check_my_prefix( id ) { if( g_bAllowedChange[ id ] ) { new string[ 32 ], bool: can_change = true read_args( string, charsmax( string ) ) for( new i; i < sizeof( g_szRestrictString ) ; i++ ) { if( containi( string, g_szRestrictString[ i ] ) != -1 ) { client_print( id, print_chat, "You are not allowed to use that Prefix. Please try again." ) can_change = false break } if( strlen( string ) - 2 > MAX_PREFIX_CHARS ) { client_print( id, print_chat, "Maximum Characters for Prefix is: %d, Try again.", MAX_PREFIX_CHARS ) can_change = false break } } if( can_change ) { g_iTrialPeriod[ id ] = get_systime() + ( 86400 * g_iDays[ id ] ) format_time( g_szUntilDate[ id ], charsmax( g_szUntilDate[] ), "%m/%d/%Y-%I:%M:%S", g_iTrialPeriod[ id ] ) remove_quotes( string ) formatex( g_szPrefix[ id ], charsmax( g_szPrefix[] ), string ) ColorChat( id, BLUE, "^1(^4LLG^1) Your prefix is now:^4 %s", g_szPrefix[ id ] ) if( g_iDays[ id ] == 10000 ) { formatex( g_szUntilDate[ id ], charsmax( g_szUntilDate[] ), "1 Year" ) } Save_Data( id ) set_gold_coins( id, get_gold_coins( id ) - g_iSortCoins[ g_iItem[ id ] ][ 1 ] ) } g_bAllowedChange[ id ] = false g_iDays[ id ] = 0 g_iItem[ id ] = -1 } return PLUGIN_HANDLED } public until_time( const iTime ) { new seconds = iTime new days = seconds / 86400; seconds = seconds % 86400; new hours = seconds / 3600; seconds = seconds % 3600; new minutes = seconds / 60; seconds = seconds % 60; new text[ 200 ] formatex( text, charsmax( text ), "%d days, %d hours, %d minutes", days, hours, minutes ) return text }
- | Afiseaza codul
L 02/06/2022 - 10:20:08: Start of error session. L 02/06/2022 - 10:20:08: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20220206.log") L 02/06/2022 - 10:20:08: [CSTRIKE] Invalid player 2 L 02/06/2022 - 10:20:08: [AMXX] Displaying debug trace (plugin "llg_buy_tag.amxx", version "1.0") L 02/06/2022 - 10:20:08: [AMXX] Run time error 10: native error (native "cs_get_user_team") L 02/06/2022 - 10:20:08: [AMXX] [0] llg_buy_tag.sma::say_prefix (line 107) L 02/06/2022 - 10:49:59: Start of error session. L 02/06/2022 - 10:49:59: Info (map "de_dust2x2") (file "addons/amxmodx/logs/error_20220206.log") L 02/06/2022 - 10:49:59: [CSTRIKE] Invalid player 5 L 02/06/2022 - 10:49:59: [AMXX] Displaying debug trace (plugin "llg_buy_tag.amxx", version "1.0") L 02/06/2022 - 10:49:59: [AMXX] Run time error 10: native error (native "cs_get_user_team") L 02/06/2022 - 10:49:59: [AMXX] [0] llg_buy_tag.sma::say_prefix (line 107) L 02/06/2022 - 12:09:44: [CSTRIKE] Invalid player 6 L 02/06/2022 - 12:09:44: [AMXX] Displaying debug trace (plugin "llg_buy_tag.amxx", version "1.0") L 02/06/2022 - 12:09:44: [AMXX] Run time error 10: native error (native "cs_get_user_team") L 02/06/2022 - 12:09:44: [AMXX] [0] llg_buy_tag.sma::say_prefix (line 107) L 02/06/2022 - 13:15:36: [CSTRIKE] Invalid player 7 L 02/06/2022 - 13:15:36: [AMXX] Displaying debug trace (plugin "llg_buy_tag.amxx", version "1.0") L 02/06/2022 - 13:15:36: [AMXX] Run time error 10: native error (native "cs_get_user_team") L 02/06/2022 - 13:15:36: [AMXX] [0] llg_buy_tag.sma::say_prefix (line 107) L 02/06/2022 - 13:30:19: [CSTRIKE] Invalid player 10 L 02/06/2022 - 13:30:19: [AMXX] Displaying debug trace (plugin "llg_buy_tag.amxx", version "1.0") L 02/06/2022 - 13:30:19: [AMXX] Run time error 10: native error (native "cs_get_user_team") L 02/06/2022 - 13:30:19: [AMXX] [0] llg_buy_tag.sma::say_prefix (line 107)