Raised This Month: $ Target: $400
 0% 

Aiming the teammate and enemy info


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GarbageBox
Senior Member
Join Date: Feb 2010
Old 01-07-2011 , 09:50   Aiming the teammate and enemy info
Reply With Quote #1

This code is I write, but as everyone know I am a newbie.
This time, I want to ask how can I to detect a player are aiming enemy?
As you look, I use "if(... == CS_TEAM_T){set_hudmessage....}" below. But I want to also add if when the player are terrorists, they aim the enemy also show the hud message.
I try to add else in if (... == ...), but it seem a wrong structure...
I dont know how to do it.
Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "Aim replacer"
#define VERSION "1.0"
#define AUTHOR ".:)"

new SzTeamMates[32]

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_event("StatusValue", "set_team", "be", "1=1")
	register_event("StatusValue", "show_status", "be", "1=2", "2!0")
	register_event("StatusValue", "hide_status", "be", "1=1", "2=0")
	
	return PLUGIN_CONTINUE
}

public set_team(id)
{
	SzTeamMates[id] = read_data(2)
}	
	
public hide_status(id)
{
	set_hudmessage(0, 0, 0, 0.0, 0.0, 0, 0.0, 0.01, 0.0, 0.0, 4)
	show_hudmessage(id, "")
}

public show_status(id)
{
	new SzName[32], SzPid = read_data(2)
	get_user_name(SzPid, SzName, 31)
	new CsTeams:SzUserTeam = cs_get_user_team(id)
	if (SzTeamMates[id] == 1)
	{
		new SzClip, SzAmmo, SzSzWpnId = get_user_weapon(SzPid, SzClip, SzAmmo)
		new SzWpnName[32]
		get_weaponname(SzSzWpnId, SzWpnName, 31)
		if(SzUserTeam == CS_TEAM_T)
		{
			set_hudmessage(0, 50, 255, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, 4)
			show_hudmessage(id, "%s^n%d HP^n%d AP^n%s", SzName, get_user_health(SzPid) ,get_user_armor(SzPid), SzWpnName[7])
		}
		else
		if(SzUserTeam == CS_TEAM_CT)
		{
			set_hudmessage(255, 50, 0, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, 4)
			show_hudmessage(id, "%s^n%d HP^n%d AP^n%s", SzName, get_user_health(SzPid) ,get_user_armor(SzPid), SzWpnName[7])
		}
	}
}
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox is offline
 


Thread Tools
Display Modes

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 01:57.


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