Raised This Month: $51 Target: $400
 12% 

Help easyinfo.amxx


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cosmin.gl
New Member
Join Date: Oct 2020
Location: Spain
Old 09-05-2022 , 05:18   Help easyinfo.amxx
Reply With Quote #1

Hello! I also have a problem with the easyinfo plugin. I will leave the error and the source below!!
Can someone help me to solve it?

L 09/04/2022 - 17:48:25: [AMXX] Displaying debug trace (plugin "easyinfo.amxx", version "0.2")
L 09/04/2022 - 17:48:25: [AMXX] Run time error 4: index out of bounds
L 09/04/2022 - 17:48:25: [AMXX] [0] zpiqlosf.sma.p::damage_event (line 27)


HTML Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
	register_plugin("Stats","0.2","Dah-Veeeed")
	set_task(2.0,"the_main",0,_,_,"b")
	register_event("Damage","damage_event","b","2!0","3=0","4!0")
	register_cvar("amx_info","1")
}

new damage[33] = 0

public client_putinserver(id) {
	damage[id] = 0
}

public client_disconnect(id) {
	damage[id] = 0
}

public damage_event(id)
{
	new attacker = get_user_attacker(id)
	new dmg = read_data(2)
	
	damage[attacker] += dmg
}


public the_main() {
	if(!get_cvar_num("amx_info")) {
		return PLUGIN_HANDLED
	}
	new players[32],num,i
	new message[200]
	get_players(players,num)
	for(i = 0; i <= num; i++)
	{
		new id = players[i]
		
		if(is_user_connected(id)) {
			new name[33]
			new ping
			new loss
			get_user_name(id,name,32)
			new frags = get_user_frags(id)
			new deaths = get_user_deaths(id)
			get_user_ping(id,ping,loss)
			
			set_hudmessage (0,0,255, 0.01, 0.29, 0, 6.0, 2.0, 0.1, 0.2, 4 )
			format(message,199," %s ^n Frags: %i ^n Deaths: %i ^n Total Damage: %i ^n Ping: %i",name,frags,deaths,damage,ping)
			show_hudmessage(id,message) 
		}
	}
	return PLUGIN_CONTINUE
}

Last edited by cosmin.gl; 09-05-2022 at 05:19.
cosmin.gl is offline
Send a message via AIM to cosmin.gl
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-05-2022 , 06:50   Re: Help easyinfo.amxx
Reply With Quote #2

make sure that get_user_attacker() returns player id
jimaway is offline
Old 09-05-2022, 12:48
zXCaptainXz
This message has been deleted by zXCaptainXz. Reason: wrong thread LOL
731
Member
Join Date: Aug 2006
Old 09-05-2022 , 13:13   Re: Help easyinfo.amxx
Reply With Quote #3

try

Code:
public damage_event(id)
{
	new attacker = get_user_attacker(id)
	if(attacker < 1 || attacker > get_maxplayers())
	{
		return
	}
	new dmg = read_data(2)
	
	damage[attacker] += dmg
}
731 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode