Cum rezolv si eu erorile astea din consola serverului?:
Code: Select all
L 04/19/2017 - 08:09:59: Server cvar "gal_version" = "1.1.290"
L 04/19/2017 - 08:09:59: Invalid multi-lingual line (file "cstrike/addons/amxmodx/data/lang/galileo.txt" key "// $Revision: 288 $ $Date: 2009-02-18 22:02:21 -0500 (Wed, 18 Feb 2009) $" lang "")
L 04/19/2017 - 08:09:59: Server cvar "amx_nextmap" = "awp_linkmania"
L 04/19/2017 - 08:09:59: [restrict_name.amxx] No restricted names found in "addons/amxmodx/configs/restricted_things.ini".
L 04/19/2017 - 08:09:59: Function "fPrintCustomText" was not found
L 04/19/2017 - 08:09:59: [AMXX] Displaying debug trace (plugin "ultimate_gag.amxx", version "Special Admin Gag")
L 04/19/2017 - 08:09:59: [AMXX] Run time error 19: function not found
L 04/19/2017 - 08:09:59: [AMXX] [0] ultimate_gag.sma::plugin_init (line 65)
L 04/19/2017 - 08:09:59: Server cvar "Silly C4" = "1.2"
L 04/19/2017 - 08:09:59: [AMXX] Failed to open dictionary file: cstrike/addons/amxmodx/data/lang/hostage_protection.txt
L 04/19/2017 - 08:09:59: [hostage_protection.amxx] ML_NOTFOUND: HP_FAILPLUGIN
- ultimate_gag | Afiseaza codul
#include < amxmodx > #include < amxmisc > #include < fakemeta > #include < engine > #include < nvault > #define PLUGIN "Special Admin Gag" #define VERSION "1.0" #define COMMAND_ACCESS ADMIN_KICK // accesu adminilor pentru comanda #define MAX_PLAYERS 32 + 1 #define SAVEDATA_FILE "GagSaveDataFile" enum { INFO_NAME }; new const bars[ ] = "/"; new command[ ] [ ] = { "/gag" }; new Caccess[ ] = { COMMAND_ACCESS, COMMAND_ACCESS }; new const gGagFileName[ ] = "gag_words.ini"; new const gGagThinkerClassname[ ] = "GagThinker_"; new PlayerGagged[ MAX_PLAYERS ]; new PlayerGagTime[ MAX_PLAYERS ]; new JoinTime[ MAX_PLAYERS ]; new szName[ 33 ]; new g_Words[ 562 ] [ 32 ], g_Count; new gCvarSwearGagTime; new gCvarGagMinuteLimit; new gCvarGagMinuteInSeconds; new gCvarAdminGag; new gCvarWords; new gMaxPlayers; new iVault; new SaveDataFile [ 128 ]; public plugin_init( ) { register_plugin( PLUGIN, PLUGIN, "Cristi .C" ); register_concmd( "amx_gag", "CommandGag" ); register_concmd( "amx_ungag", "CommandUngag" ); register_clcmd( "say", "CheckGag" ); register_clcmd( "say_team", "CheckGag" ); register_clcmd( "say", "command_chat" ); register_clcmd ( "say /adminsonly", "fPrintCustomText" ); register_clcmd ( "say adminsonly", "fPrintCustomText" ); register_clcmd ( "say /supremeonly", "fPrintCustomTexts" ); register_clcmd ( "say supremeonly", "fPrintCustomTexts" ); register_clcmd ( "say /globaleonly", "fPrintCustomTextss" ); register_clcmd ( "say globalonly", "fPrintCustomTextss" ); GagThinker( ); register_think( gGagThinkerClassname, "Forward_GagThinker" ); gCvarSwearGagTime = register_cvar( "amx_autogag_time", "10" ); // minutele pentru gag cand ia autogag gCvarGagMinuteLimit = register_cvar( "amx_gag_minute_limit", "300" ); // limita maxima pentru gag minute gCvarGagMinuteInSeconds = register_cvar( "amx_gag_minute_in_seconds", "60" ); // minute in secunde gCvarAdminGag = register_cvar( "amx_admingag", "1" ); // poti da si la admini gag daca e egal cu 1, daca e 0 nu poti gCvarWords = register_cvar( "amx_maxwords", "200" ); // lista maxima de cuvinte in gag_words.ini iVault = nvault_open( "GagSystem" ); if( iVault == INVALID_HANDLE ) { set_fail_state( "nValut returned invalid handle!" ); } gMaxPlayers = get_maxplayers( ); new DataDir [ 64 ]; get_datadir ( DataDir, 63 ); format ( SaveDataFile, 127, "%s/%s.dat", DataDir, SAVEDATA_FILE ); } public plugin_cfg( ) { static szConfigDir[ 64 ], iFile[ 64 ]; get_localinfo ( "amxx_configsdir", szConfigDir, 63 ); formatex ( iFile , charsmax( iFile ) , "%s/%s" , szConfigDir, gGagFileName ); if( !file_exists( iFile ) ) { write_file( iFile, "# Pune aici cuvintele jignitoare sau reclamele", -1 ); } new szBuffer[ 128 ]; new szFile = fopen( iFile, "rt" ); while( !feof( szFile ) ) { fgets( szFile, szBuffer, charsmax( szBuffer ) ); if( szBuffer[ 0 ] == '#' ) { continue; } parse( szBuffer, g_Words[ g_Count ], sizeof g_Words[ ] - 1 ); g_Count++; if( g_Count >= get_pcvar_num ( gCvarWords ) ) { break; } } fclose( szFile ); } public client_putinserver( id ) { if ( is_user_connected( id ) ) { JoinTime[ id ] = get_systime( ); Load ( id ); } } public client_disconnect ( id ) { if ( PlayerGagged [ id ] ) Save ( id ); } public SaveData ( client ) { new Name [ 32 ]; get_user_name ( client, Name, 31 ); new _Gagged = PlayerGagged [ client ]; new _GagTime = PlayerGagTime [ client ]; new StrongData [ 1024 ]; formatex ( StrongData, sizeof ( StrongData ) - 1, "^"%i^" ^"%i^"", _Gagged, _GagTime ); new Save [ 1024 ]; format ( Save, sizeof ( Save ) - 1, "^"%s^" %s", Name, StrongData ); new Line [ 128 ], Linie, IsPlayer = false, Arg1 [ 32 ]; new FileOpen = fopen ( SaveDataFile, "rt" ); while ( !feof ( FileOpen ) ) { fgets ( FileOpen, Line, 127 ); trim ( Line ); parse ( Line, Arg1, 31 ); if ( equali ( Arg1, Name ) ) { write_file ( SaveDataFile, Save, Linie ); IsPlayer = true; break; } Linie++; } fclose ( FileOpen ); if ( !IsPlayer ) write_file ( SaveDataFile, Save, -1 ); } public LoadData ( client ) { new Name [ 32 ]; get_user_name ( client, Name, 31 ); new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ], Arg3 [ 32 ]; new FileOpen = fopen ( SaveDataFile, "rt" ); while ( !feof ( FileOpen ) ) { fgets ( FileOpen, Line, 127 ); trim ( Line ); parse ( Line, Arg1, 31, Arg2, 31, Arg3, 31 ); if ( equali ( Arg1, Name ) ) { PlayerGagged [ client ] = str_to_num ( Arg2 ); PlayerGagTime [ client ] = str_to_num ( Arg3 ); IsPlayer = true; break; } } fclose ( FileOpen ); if ( !IsPlayer ) { PlayerGagged [ client ] = 0; PlayerGagTime [ client ] = 0; } } public command_chat( index ) { static szArg[ 192 ], command2[ 192 ]; read_args( szArg, charsmax ( szArg ) ); if( ! szArg [ 0 ] ) return PLUGIN_CONTINUE; remove_quotes( szArg[0] ); for( new x; x < sizeof command; x++ ) { if ( equal ( szArg, command [ x ], strlen ( command [ x ] ) ) ) { if ( get_user_flags ( index ) & Caccess [ x ] ) { replace( szArg, charsmax ( szArg ), bars, "" ); formatex( command2, charsmax(command2), "amx_%s", szArg ); client_cmd( index, command2 ); } break; } } return PLUGIN_CONTINUE; } public CheckGag( id ) { new szSaid[ 300 ]; read_args( szSaid, charsmax( szSaid ) ); remove_quotes( szSaid ); if( !UTIL_IsValidMessage( szSaid ) ) { return PLUGIN_HANDLED; } if ( PlayerGagged[ id ] == 1 ) { PlayerGagged[ id ] = 1; chat_color( id, "^1 Ai primit^4 gag^1 pentru limbaj vulgar, asteapta^4 %d^1 minute!", PlayerGagTime[ id ] ); return PLUGIN_HANDLED; } else { new i; for( i = 0; i < get_pcvar_num ( gCvarWords ); i++ ) { if( containi( szSaid, g_Words[ i ] ) != -1 ) { if( get_pcvar_num( gCvarAdminGag ) == 0 ) { if ( is_user_admin ( id ) ) { return 1; } } PlayerGagged[ id ] = 1; PlayerGagTime[ id ] = get_pcvar_num ( gCvarSwearGagTime ); set_speak( id, SPEAK_MUTED ); chat_color( id, "^1 You've been^4 Auto-Gagged^1 for your behavior.^3 %d minutes^1 remaining", PlayerGagTime[ id ] ); //SaveGagedPlayers( id ); return PLUGIN_HANDLED; } } } return PLUGIN_CONTINUE; } public CommandGag( id ) { if( !(get_user_flags( id ) & COMMAND_ACCESS ) ) { client_cmd( id, "echo Nu ai acces la aceasta comanda!" ); return 1; } new szArg[ 32 ], szMinutes[ 32 ]; read_argv( 1, szArg, charsmax ( szArg ) ); if( equal( szArg, "" ) ) { client_cmd( id, "echo amx_gag < nume > < minute >" ); return 1; } new iPlayer = cmd_target( id, szArg, CMDTARGET_ALLOW_SELF ); if( !iPlayer ) { client_cmd( id, "echo Jucatorul specificat nu a fost gasit!" ); return 1; } if ( get_pcvar_num( gCvarAdminGag ) == 0 ) { if ( is_user_admin( iPlayer ) ) { client_cmd( id, "echo Nu poti da gag la Admini!" ); return 1; } } read_argv( 2, szMinutes, charsmax ( szMinutes ) ); new iMinutes = str_to_num( szMinutes ); if ( iMinutes > get_pcvar_num ( gCvarGagMinuteLimit ) ) { console_print( id, "Ai setat %d minute, iar limita maxima de minute este %d! Setare automata pe %d.", iMinutes, get_pcvar_float ( gCvarGagMinuteLimit ), get_pcvar_float ( gCvarGagMinuteLimit ) ); iMinutes = get_pcvar_num( gCvarGagMinuteLimit ) ; } get_user_name( iPlayer, szName, sizeof ( szName ) -1 ); if( PlayerGagged[ iPlayer ] == 1 ) { client_cmd( id, "echo Jucatorul %s are deja gag!", GetInfo( iPlayer, INFO_NAME ) ); return 1; } PlayerGagged[ iPlayer ] = 1; PlayerGagTime[ iPlayer ] = iMinutes; set_speak( iPlayer, SPEAK_MUTED ); chat_color(0, "^1 ADMIN^4 %s^1 GAG^3 %s^1 for^4 %d^1 minutes", GetInfo( id, INFO_NAME ), GetInfo( iPlayer, INFO_NAME ), iMinutes ); chat_color(iPlayer, "^1 Ai primit^4 gag^1 pentru limbaj vulgar." ); //SaveGagedPlayers( id ); return PLUGIN_HANDLED; } public CommandUngag( id ) { if( !(get_user_flags( id ) & COMMAND_ACCESS ) ) { client_cmd( id, "echo Nu ai acces la aceasta comanda!" ); return 1; } new szArg[ 32 ]; read_argv( 1, szArg, charsmax( szArg ) ); if( equal( szArg, "" ) ) { client_cmd( id, "echo amx_ungag < nume > !" ); return 1; } new iPlayer = cmd_target ( id, szArg, CMDTARGET_ALLOW_SELF ); if( !iPlayer ) { client_cmd( id, "echo Jucatorul specificat nu a fost gasit!" ); return 1; } if( PlayerGagged[ iPlayer ] == 0 ) { console_print( id, "Jucatorul %s nu are Gag!", GetInfo( iPlayer, INFO_NAME ) ); return 1; } PlayerGagged[ iPlayer ] = 0; PlayerGagTime[ iPlayer ] = 0; set_speak( iPlayer, SPEAK_NORMAL ); chat_color(0, "^1 Admin^4 a dat %s^1 ungag^4 jucatorului %s.", GetInfo( id, INFO_NAME ), GetInfo( iPlayer, INFO_NAME ) ); Save( iPlayer ); return PLUGIN_HANDLED; } public Forward_GagThinker( iEntity ) { if ( pev_valid( iEntity ) ) { set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 ) ; new id; for ( id = 1; id <= gMaxPlayers; id++ ) { if ( is_user_connected ( id ) && ! is_user_bot( id ) && PlayerGagged[ id ] == 1 && PlayerGagTime[ id ] > 0 && ( ( get_systime( ) - JoinTime[ id ] ) >= get_pcvar_num ( gCvarGagMinuteInSeconds ) ) ) { JoinTime[ id ] = get_systime( ); PlayerGagTime[ id ] -= 1; if ( PlayerGagTime[ id ] <= 0 ) { PlayerGagTime[ id ] = 0; PlayerGagged[ id ] = 0; set_speak( id, SPEAK_NORMAL ); Save(id) } } } } } stock GagThinker( ) { new iEntity = create_entity ( "info_target" ); if( ! pev_valid ( iEntity ) ) { return PLUGIN_HANDLED; } set_pev ( iEntity, pev_classname, gGagThinkerClassname ); set_pev ( iEntity, pev_nextthink, get_gametime( ) + 1.0 ); return PLUGIN_HANDLED; } stock GetInfo( id, const iInfo ) { new szInfoToReturn[ 64 ]; switch( iInfo ) { case INFO_NAME: { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); copy( szInfoToReturn, sizeof ( szInfoToReturn ) -1, szName ); } } return szInfoToReturn; } stock bool:UTIL_IsValidMessage( const szSaid[ ] ) { new iLen = strlen( szSaid ); if( !iLen ) { return false; } for( new i = 0; i < iLen; i++ ) { if( szSaid[ i ] != ' ' ) { return true; } } return false; } public Load( id ) { new szIp[ 40 ], szVaultKey[ 64 ], szVaultData[ 64 ]; get_user_ip( id, szIp, charsmax ( szIp ) ); formatex( szVaultKey, charsmax( szVaultKey ), "%s", szIp ); nvault_get( iVault, szVaultKey, szVaultData, charsmax ( szVaultData ) ); new iGagOn[ 32 ], iGagTime [ 32 ]; parse( szVaultData, iGagOn, charsmax ( iGagOn ), iGagTime, charsmax ( iGagTime ) ); PlayerGagged[ id ] = str_to_num ( iGagOn ); PlayerGagTime[ id ] = str_to_num ( iGagTime ); } public Save( id ) { new szIp[ 40 ], szVaultKey[ 64 ], szVaultData[ 64 ]; get_user_ip( id, szIp, charsmax( szIp ) ); formatex( szVaultKey, charsmax( szVaultKey ), "%s", szIp ); formatex( szVaultData, charsmax( szVaultData ), "%i %i", PlayerGagged[ id ], PlayerGagTime[ id ] ); nvault_set( iVault, szVaultKey, szVaultData ); } public plugin_end( ) { nvault_close( iVault ); } stock chat_color(const id, const input[], any:...) { new count = 1, players[32] static msg[320] vformat(msg, 190, input, 3) replace_all(msg, 190, "!g", "^4") replace_all(msg, 190, "!n", "^1") replace_all(msg, 190, "!t", "^3") replace_all(msg, 190, "!t2", "^0") if (id) players[0] = id; else get_players(players, count, "ch") for (new i = 0; i < count; i++) { if (is_user_connected(players)) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players) write_byte(players) write_string(msg) message_end() } } }
- hostage_protection | Afiseaza codul
/* Copyleft 2016 @ HamletEagle Plugin Theard: https://forums.alliedmods.net/showthread.php?t=242948 Hostage Protection is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Hostage Protection; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <amxmodx> #include <hamsandwich> #include <engine> #include <cstrike> #include <fun> #include <fakemeta> #if AMXX_VERSION_NUM >= 183 #include <csx> #endif #define PluginName "Hostage Protection" #define PluginVersion "1.8" #define PluginAuthor "HamletEagle" #define ValidPlayer(%0) (1 <= %0 <= MaxPlayers) enum _:CvarsData { Slap, Ban, Punish, Blood, Team } new MaxPlayers new HandleCvars[CvarsData] new bool:IsAmxBansRunning new HamHook:HandleCHostageTraceAttackHook new HamHook:HandleCHostageTakeDamageHook stock const m_rgpPlayerItems_CBasePlayer[ 6 ] = { 367 , 368 , ... } const XO_PLAYER = 5 public plugin_init() { register_plugin ( .plugin_name = PluginName, .version = PluginVersion, .author = PluginAuthor ) register_dictionary("hostage_protection.txt") new const HostageEntity[] = "hostage_entity" HandleCHostageTraceAttackHook = RegisterHam(Ham_TraceAttack, HostageEntity, "CHostage_TraceAttack", false) HandleCHostageTakeDamageHook = RegisterHam(Ham_TakeDamage , HostageEntity, "CHostage_TakeDamage" , false) HandleCvars[Slap ] = register_cvar("hp_slap_value", "25") HandleCvars[Ban ] = register_cvar("hp_ban_time" , "10") HandleCvars[Punish ] = register_cvar("hp_punishment", "4" ) HandleCvars[Blood ] = register_cvar("hp_showblood" , "0" ) HandleCvars[Team ] = register_cvar("hp_blockteam" , "b" ) register_event("HLTV", "OnNewRound_Event", "a", "1=0", "2=0") MaxPlayers = get_maxplayers() CheckMapType() } public plugin_cfg() { if(is_plugin_loaded("amxbans_core.amxx", true) != -1) { IsAmxBansRunning = true } } public plugin_pause() { DisableHamForward(HandleCHostageTraceAttackHook) DisableHamForward(HandleCHostageTakeDamageHook) } public plugin_unpause() { EnableHamForward(HandleCHostageTraceAttackHook) EnableHamForward(HandleCHostageTakeDamageHook) } CheckMapType() { #if AMXX_VERSION_NUM < 183 new const EntClasses[][] = { "func_hostage_rescue", "info_hostage_rescue", "hostage_entity", "monster_entity" } for(new i; i < sizeof EntClasses; i++) { if(find_ent_by_class(-1, EntClasses)) { //At least a needed ent is here, return return } } #else if(get_map_objectives() & MapObjective_Hostage) { return } #endif log_amx("%L", LANG_SERVER, "HP_FAILPLUGIN") pause("a") } public CHostage_TraceAttack(Ent, Attacker) { if(GetTeamToBlock(get_user_team(Attacker))) { if(get_pcvar_num(HandleCvars[Punish]) != 0) { PunishPlayer(Attacker) } return HAM_SUPERCEDE } return HAM_IGNORED } public CHostage_TakeDamage(Victim, Inflictor, Attacker) { if(ValidPlayer(Attacker)) { if(GetTeamToBlock(get_user_team(Attacker))) { if(get_pcvar_num(HandleCvars[Punish]) != 0) { PunishPlayer(Attacker) } return HAM_SUPERCEDE } } return HAM_IGNORED } public OnNewRound_Event() { if(!get_pcvar_num(HandleCvars[Blood])) { EnableHamForward(HandleCHostageTraceAttackHook) } else { DisableHamForward(HandleCHostageTraceAttackHook) } } PunishPlayer(Attacker) { new Userid = get_user_userid(Attacker) switch(get_pcvar_num(HandleCvars[Punish])) { case 1: { server_cmd("amx_slap #%i %i", Userid, get_pcvar_num(HandleCvars[Slap])) } case 2: { server_cmd("amx_slay #%i", Userid) } case 3: { if(!IsAmxBansRunning) { server_cmd("amx_ban #%i %i ^"%L^"", Userid, get_pcvar_num(HandleCvars[Ban]), Userid, "HP_NOTALLOWED") } else { server_cmd("amx_ban %i #%i ^"%L^"", get_pcvar_num(HandleCvars[Ban]), Userid, "HP_NOTALLOWED") } } case 4 : { switch(random_num(1, 3)) { case 1: { set_user_health(Attacker, (get_user_health(Attacker) / 2)) } case 2: { cs_set_user_money(Attacker, (cs_get_user_money(Attacker) / 2)) } case 3: { if(!HasOnlyKnife(Attacker)) { strip_user_weapons(Attacker) give_item(Attacker, "weapon_knife") } } } } } } HasOnlyKnife(id) { for(new i = 1; i < 5; i++)//5 because on cs_ maps player can't have a c4 { if(get_pdata_cbase(id, m_rgpPlayerItems_CBasePlayer, XO_PLAYER) != -1) { if(i != 3) { return false } } } return true } bool:GetTeamToBlock(PlayerTeam) { new TeamIdentifier[2] get_pcvar_string(HandleCvars[Team], TeamIdentifier, charsmax(TeamIdentifier)) new Index switch(TeamIdentifier[0]) { case 't': { Index = 1 } case 'c': { Index = 2 } case 'b': { Index = 3 } } if(Index == 3 || PlayerTeam == Index) { return true } return false }
Multumesc.