Cerere rezolvare eroare

Cereri de pluginuri noi, skinuri in CS, etc.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Armoda
Membru, skill 0
Membru, skill 0
Posts: 10
Joined: 24 Aug 2010, 14:31
Detinator Steam: Nu
CS Status: Invat domne`
Detinator server CS: Iasi.CSWorld.Ro
Contact:

09 Sep 2010, 10:55

Code: Select all

L 09/09/2010 - 01:54:04: [AMXX] Displaying debug trace (plugin "amx_gag.amxx")
L 09/09/2010 - 01:54:04: [AMXX] Run time error 4: index out of bounds 
L 09/09/2010 - 01:54:04: [AMXX]    [0] phpX7ATTh.sma::CMD_GagPlayer (line 124)
Folosesc acest plugin de amx_gag :
| Afiseaza codul
#define VoiceCommMute 0			
    #define BlockNameChange 1	
    #define LogAdminActions 1	
    #define DefaultGagTime 600.0  // 10 minute ia gag	
    #define PlaySound 0
    #define GagReason 0		
    #define MaxPlayers 32
    #define AllowOtherPlugin2Interface 1

    #include <amxmodx>
    #include <amxmisc>
    // #include <engine>  // Activati doar daca puneti '1' la 'VoicecommMute'.

    new g_GagPlayers[MaxPlayers+1]
    #if GagReason == 1
    new gs_GagReason[MaxPlayers+1][48]
    #endif

    public plugin_init() 
    { 
    	register_plugin("AMX gag","1.8.3","EKS") 
    	register_clcmd("say","block_gagged") 
    	register_clcmd("say_team","block_gagged") 
    	register_concmd("amx_gag","CMD_GagPlayer",ADMIN_KICK,"<nume sau #userid> - jucatoru nu mai poate sa vorbeasca") 
    	register_concmd("amx_ungag","CMD_UnGagPlayer",ADMIN_KICK,"<nume sau #userid> - scoate mute de la jucator") 
    } 

    public block_gagged(id){  
    	if(!g_GagPlayers[id]) return PLUGIN_CONTINUE 
    	new cmd[5] 
    	read_argv(0,cmd,4) 
    	if ( cmd[3] == '_' )
    		{ 
    		if (g_GagPlayers[id] & 2){ 
    #if GagReason == 1
    			client_print(id,print_chat,"Ai primit gag din urmatoarul motiv : %s",gs_GagReason[id]) 
    #else
    			client_print(id,print_chat,"Ai primit gag pentru limbaj inadecvat !") 
    #endif

    #if PlaySound == 1
    			client_cmd(id,"spk barney/youtalkmuch")
    #endif
    			return PLUGIN_HANDLED 
    			} 
    		} 
    	else if (g_GagPlayers[id] & 1)   { 
    #if GagReason == 1
    			client_print(id,print_chat,"Ai primit gag din urmatoarul motiv : %s",gs_GagReason[id]) 
    #else
    			client_print(id,print_chat,"Ai primit gag pentru limbaj inadecvat !") 
    #endif
    #if PlaySound == 1
    			client_cmd(id,"spk barney/youtalkmuch")
    #endif
    		return PLUGIN_HANDLED 
    		} 
    	return PLUGIN_CONTINUE 
    	} 
    public CMD_GagPlayer(id,level,cid) 
    { 
    	if(!cmd_access (id,level,cid,1)) return PLUGIN_HANDLED
    	new arg[32],VictimID
    	
    	read_argv(1,arg,31)  			
    	VictimID = cmd_target(id,arg,8)		
    	if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } 
    	new s_Flags[4],VictimName[32],AdminName[32],flags,ShowFlags[32],CountFlags,s_GagTime[8],Float:f_GagTime

    	read_argv(2,arg,31) 
    	if (!arg[0]) 
    	{
    		f_GagTime = DefaultGagTime
    		format(s_Flags,7,"abc")
    	}
    	else
    	{
    		if(contain(arg,"m")!=-1 && contain(arg,"!")==-1) 
    		{
    			copyc(s_GagTime,7,arg, 'm')
    			f_GagTime = floatstr(s_GagTime) * 60
    		}
    		else if(isdigit(arg[0])&& contain(arg,"!")==-1) 
    		{
    			format(s_GagTime,7,arg)
    			f_GagTime = floatstr(s_GagTime)
    		}
    		read_argv(3,arg,8)
    		if (!arg[0])
    			format(s_Flags,7,"abc")
    		else if(contain(arg,"!")==-1)		
    			format(s_Flags,7,arg)
    		else if(contain(arg,"!")!=-1)		
    			format(s_Flags,7,"abc")
    		if (f_GagTime == 0.0)
    		{
    			read_argv(2,arg,8)
    			if(contain(arg,"!")!=-1)
    				format(s_Flags,3,"abc") 
    			else
    				format(s_Flags,3,arg) 
    			f_GagTime = DefaultGagTime
    		}
    #if GagReason == 1
    		new GagReasonFound=0
    		for(new i=2;i<=4;i++)
    		{
    			read_argv(i,arg,31)
    			if(contain(arg,"!")!=-1)
    			{	
    				read_args(arg,31)
    				new tmp[32]
    				copyc(tmp,32,arg,33)
    				copy(gs_GagReason[VictimID],47,arg[strlen(tmp)+1])
    				GagReasonFound = 1
    			}
    		}
    		if(GagReasonFound == 0)	
    			format(gs_GagReason[VictimID],47,"")
    #endif
    	}

    	flags = read_flags(s_Flags)
    	g_GagPlayers[VictimID] = flags 
    #if VoiceCommMute == 1
    	if(flags & 4) 
    		set_speak(VictimID, SPEAK_MUTED)
    #endif
    	new TaskParm[1]		
    	TaskParm[0] = VictimID
    	set_task( f_GagTime,"task_UnGagPlayer",VictimID,TaskParm,1) 

    	CountFlags = 0
    	if (flags & 1)
    	{
    		format(ShowFlags,31,"say")
    		CountFlags++
    	}
    	if (flags & 2)
    	{
    		if(CountFlags)
    			format(ShowFlags,31,"%s / say_team",ShowFlags)
    		if(!CountFlags)
    			format(ShowFlags,31,"say_team")
    		if (!CountFlags)				/// IN TESTE!
    			format(ShowFlags,31,"say_team @")	///
    	}
    #if VoiceCommMute != 0
    	if(flags & 4)
    	{
    		if(CountFlags)
    			format(ShowFlags,31,"%s / voicecomm",ShowFlags)
    		if(!CountFlags)
    			format(ShowFlags,31,"voicecomm")		
    	}
    #endif
    	get_user_name(id,AdminName,31)
    	get_user_name(VictimID,VictimName,31)
    	switch(get_cvar_num("amx_show_activity"))   
    	{ 
    #if GagReason == 1
    		case 2:   client_print(0,print_chat,"Admin %s : Gag %s pentru 10 minute !",AdminName,VictimName)
       		case 1:   client_print(0,print_chat,"Admin : Gag %s pentru 10 minute !",VictimName) 
    #else
    		case 2:   client_print(0,print_chat,"Admin %s : Gag %s pentru 10 minute !",AdminName,VictimName)
       		case 1:   client_print(0,print_chat,"Admin : Gag %s pentru 10 minute !",VictimName) 
    #endif
    	 
    	 }	
    #if LogAdminActions == 1
    	new parm[5] 
    	parm[0] = VictimID
    	parm[1] = id
    	parm[2] = 0
    	parm[3] = flags
    	parm[4] = floatround(Float:f_GagTime)
    	LogAdminAction(parm)
    #endif
    	return PLUGIN_HANDLED
    } 

    public CMD_UnGagPlayer(id,level,cid)   
    {
    	new arg[32],VictimID
    	read_argv(1,arg,31)  			
    	
    	VictimID = cmd_target(id,arg,8)		
    	if ((get_user_flags(VictimID) & ADMIN_IMMUNITY) && VictimID != id || !cmd_access (id,level,cid,2) ) { return PLUGIN_HANDLED; } 

    	new AdminName[32],VictimName[32] 

    	get_user_name(id,AdminName,31)		
    	get_user_name(VictimID,VictimName,31)

    	if(!g_GagPlayers[VictimID])		
    	{
    		console_print(id," Jucatorul %s nu a primit gag sau i s-a scos gagul !",arg)
    		return PLUGIN_HANDLED
    	}
    	switch(get_cvar_num("amx_show_activity"))   
    	{ 
       		case 2:   client_print(0,print_chat,"Admin %s : Ungag %s !",AdminName,VictimName) 
       		case 1:   client_print(0,print_chat,"Admin : Ungag %s !",VictimName) 
      	}

    #if LogAdminActions == 1
    	new parm[3] 
    	parm[0] = VictimID
    	parm[1] = id
    	parm[2] = 1
    	LogAdminAction(parm)
    #endif
    	remove_task(VictimID)		
    	UnGagPlayer(VictimID)		
    	return PLUGIN_HANDLED
    } 

    public client_disconnect(id) 
    { 
    	if(g_GagPlayers[id]) 
    	{
    		new Nick[32],Authid[35]
    		get_user_name(id,Nick,31)
    		get_user_authid(id,Authid,34)
    		client_print(0,print_chat,"Jucatorul cu gag (%s) a iesit de pe server !",Nick)
    		remove_task(id)		
    		UnGagPlayer(id)		
    	}
    }
    #if BlockNameChange == 1
    public client_infochanged(id)
    {
    	if(g_GagPlayers[id])
    	{
    		new newname[32], oldname[32]
    		get_user_info(id, "name", newname,31)
    		get_user_name(id,oldname,31)
    	
    		if (!equal(oldname,newname))
    		{
    			client_print(id,print_chat,"")
    			set_user_info(id,"name",oldname)
    		}
    	}
    }
    #endif
    public task_UnGagPlayer(TaskParm[])	
    {
    	new VictimName[32]
    	get_user_name(TaskParm[0],VictimName,31)
    	client_print(0,print_chat,"",VictimName)
    	UnGagPlayer(TaskParm[0])
    }
    #if LogAdminActions == 1
    stock LogAdminAction(parm[])
    { 
    	new VictimName[32],AdminName[32],AdminAuth[35],VictimAuth[35]
    	get_user_name(parm[1],AdminName,31)
    	get_user_name(parm[0],VictimName,31)
    	get_user_authid(parm[1],AdminAuth,34)
    	get_user_authid(parm[0],VictimAuth,34)

    #if GagReason == 1
    	if(parm[2] == 0)
    		log_amx("Cmd: ADMIN %s: a dat GAG la '%s' <%s> pentru %d de secunde ( %d ) Motiv: %s",AdminName,VictimName,VictimAuth,parm[4],parm[3],gs_GagReason[parm[0]])
    #else
    	if(parm[2] == 0)
    		log_amx("Cmd: ADMIN %s: a dat GAG la '%s' <%s> pentru %d de secunde ( %d )",AdminName,VictimName,VictimAuth,parm[4],parm[3])
    #endif
    	if(parm[2] == 1)
    		log_amx("Cmd: ADMIN %s: a dat GAG la '%s' <%s>",AdminName,VictimName,VictimAuth)
    }
    #endif
    stock UnGagPlayer(id) 
    { 
    #if VoiceCommMute == 1
    	if(g_GagPlayers[id] & 4)	
    	{
    		if(get_cvar_num("sv_alltalk") == 1)
    			set_speak(id, SPEAK_ALL)
    		else 
    			set_speak(id, SPEAK_NORMAL)
    	}
    #endif
    	g_GagPlayers[id] = 0
    #if GagReason == 1
    	setc(gs_GagReason[id],31,0)
    #endif
    }
    #if AllowOtherPlugin2Interface == 1
    public func_AddGag(id)
    {
    	g_GagPlayers[id] = 7 
    	new TaskParm[1]		
    	TaskParm[0] = id
    #if VoiceCommMute == 1
    	set_speak(id, SPEAK_MUTED)
    #endif
    	set_task( DefaultGagTime,"task_UnGagPlayer",id,TaskParm,1)
    }

    public func_RemoveGag(id)
    {
    	remove_task(id)		
    	UnGagPlayer(id)
    }
    #endif
Gasesc acele erori in logs , nu stiu de la ce ar putea fi ! Poate ma ajuta un priceput sa rezolv acest plugin sa functioneze bine, il rog frumos ! Multumesc
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests