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

[OP4] Monstername


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Opposing Force        Category:   Fun Stuff        Approver:   ConnorMcLeod (74)
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 08-07-2011 , 11:06   [OP4] Monstername
Reply With Quote #1



Opposing Foce Monster Name

Description:
Show monster's and players's name with health and armor where player aimning. For Opposing Force Coop.
Attached Files
File Type: sma Get Plugin or Get Source (op4_monstername.sma - 1300 views - 7.1 KB)
__________________
The functional way is the right way

Last edited by GordonFreeman (RU); 06-11-2012 at 03:48.
GordonFreeman (RU) is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 08-23-2011 , 00:54   Re: [OP4] Monstername
Reply With Quote #2

Updated!
Now used only Fakemeta.
Normal name show.
Work correctly now (finnaly i get list of all ent in op4)
__________________
The functional way is the right way
GordonFreeman (RU) is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-23-2011 , 05:15   Re: [OP4] Monstername
Reply With Quote #3

You better use a trie here instead of calling x equals.
Also, make more checks, like entid should be > maxplayers, so it avoids you executes code for nothing..
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-30-2012 , 02:31   Re: [OP4] Monstername
Reply With Quote #4

No changes, consider to use tries and you can submit it again.
Unapproved.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 06-01-2012 , 02:32   Re: [OP4] Monstername
Reply With Quote #5

ConnorMcLeod, i did. Now using Trie, removed loop. Added playername show.
Why allot of moderators start reviewing plugins?
__________________
The functional way is the right way
GordonFreeman (RU) is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-01-2012 , 02:45   Re: [OP4] Monstername
Reply With Quote #6

Better than if nobody do anything lol.

I don't think you need to check TrieKeyExists, when TrieGetCell already returns 0 or 1 on same conditions.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-01-2012 at 02:47.
ConnorMcLeod is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 06-01-2012 , 02:57   Re: [OP4] Monstername
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
Better than if nobody do anything lol.

I don't think you need to check TrieKeyExists, when TrieGetCell already returns 0 or 1 on same conditions.
0 for enemies [red hud color]
1 for friends [green hud color]

you think, would be good if

0 if entity not in list [no hud]
1 for enemies [red hud color]
2 for friends [green hud color]

?
__________________
The functional way is the right way
GordonFreeman (RU) is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-01-2012 , 10:44   Re: [OP4] Monstername
Reply With Quote #8

Was saying that TrieGetCell returns 0 when the key doesn't exist, not the byref cell value, you do what you want with your plugin features
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Jozodezokokotar
Junior Member
Join Date: Apr 2011
Location: Czech Republic
Old 06-02-2012 , 12:48   Re: [OP4] Monstername
Reply With Quote #9

I believe the plugin needs some kind of code "delay" to prevent hud message flickering.
Any ideas how to make this?
Jozodezokokotar is offline
Send a message via Skype™ to Jozodezokokotar
Jozodezokokotar
Junior Member
Join Date: Apr 2011
Location: Czech Republic
Old 06-02-2012 , 14:55   Re: [OP4] Monstername
Reply With Quote #10

I tried this, it works... partially, but still the FM_PlayerPostThink is being called many times per second. Is there a way to optimizing this, please?

code is also a bit modified to show health percentage for monster_apache, don't mind that.

Code:
new pica

public fw_PlayerPostThink(id){
	
	pica ++
	if (pica >= 60 ) {
	
	static ent,bh
	static classname[32],hpinfo[18]
	get_user_aiming(id,ent,bh)
	
	if(!ent)
		return
		
	static health,armor

	if(0<ent<=g_maxplayers){
		return

	}else{
		pica = 0
		pev(ent,pev_classname,classname,31)
		
		if(!TrieKeyExists(g_vodka,classname)||pev(ent,pev_deadflag)!=DEAD_NO)
			return
			
		health = pev(ent,pev_health)
		new hratio = procentaPico(health)
		
		TrieGetCell(g_vodka,classname,armor)
		
		
		TrieGetString(g_lolka,classname,classname,31)
		 
		formatex(hpinfo,17,"(%d%s)",hratio,"%")

	}
	
	if(health<=0)
		return

	set_hudmessage(206, 24, 0, -1.0, 0.60, 0, 0.0, 2.0, 0.0, 0.2, -1)
	show_hudmessage(id,"%s %s",classname,hpinfo)
	} else {
	return
	}
}

public procentaPico(int) {
	new hratio_tmp = floatround((floatdiv( float(int), float(apachehetloch)) * 100), floatround_ceil )
	return hratio_tmp	
}
Jozodezokokotar is offline
Send a message via Skype™ to Jozodezokokotar
Reply


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 07:26.


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