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

Entity Lab (Engine based) [Final]


Post New Thread Reply   
 
Thread Tools Display Modes
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 09-08-2008 , 19:29   Re: Entity Lab (Engine based) [Final]
Reply With Quote #11

Excellent plugin. Very useful for info and troubleshooting.
One thing, DOD doesn't have a radar, so the plugin errored in the 'showOnRadar' routine. To correct this, I inserted the following:
Code:
 
public showOnRadar(id, ent) 
{
   new modname[16]
   get_modname(modname,15)
   if (equali(modname, "dod"))
       return
 
    new Float: ori_min[3]
    new Float: ori_max[3] 
 
    entity_get_vector(ent,EV_VEC_absmin,ori_min)
    entity_get_vector(ent,EV_VEC_absmax,ori_max) 
 
    message_begin(MSG_ONE_UNRELIABLE, m_fakeHostage, {0,0,0}, id);
    write_byte(id);
    write_byte(21);
    write_coord(floatround((ori_max[0]+ori_min[0])/2));
    write_coord(floatround((ori_max[1]+ori_min[1])/2));
    write_coord(floatround((ori_max[2]+ori_min[2])/2));
    message_end();
    message_begin(MSG_ONE_UNRELIABLE, m_fakeHostageDie, {0,0,0}, id);
    write_byte(21);
    message_end();
}
You may want to check for the cstrike mod to allow the routine to execute at all. In other words:
Code:
 
public showOnRadar(id, ent) 
{
   new modname[16]
   get_modname(modname,15)
   if (!equali(modname, "cstrike"))
       return
 
    blah blah blah
}
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Miczu
Member
Join Date: Jul 2007
Old 09-09-2008 , 04:26   Re: Entity Lab (Engine based) [Final]
Reply With Quote #12

I don't think, that geting mod name is a best way...

Could someone try it for me on other mods?
Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "msgid test"
#define VERSION "0.1"
#define AUTHOR "Miczu"

new m_fakeHostage
new m_fakeHostageDie

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /test","test")
	
	m_fakeHostage = get_user_msgid("HostagePos");
	m_fakeHostageDie = get_user_msgid("HostageK");
}

public test(id)
{
	client_print(id,print_chat,"Test start")
	client_print(id,print_chat,"Hostage    : %d",m_fakeHostage)
	client_print(id,print_chat,"Hostage Die: %d",m_fakeHostageDie)
}
On cstrike it return 123 and 124.
I hope that on mods with no radar it will return something like 0 or -1
__________________
Entity Lab - ultimate entity data source

Last edited by Miczu; 09-09-2008 at 04:30.
Miczu is offline
Miczu
Member
Join Date: Jul 2007
Old 09-09-2008 , 05:49   Re: Entity Lab (Engine based) [Final]
Reply With Quote #13

When i give this in cstrike:
Code:
m_fakeHostage = get_user_msgid("not_existing_msgid");
I got a 0, but it's still posible, that "HostagePos" is still in hl1 engine and it will not return 0.
__________________
Entity Lab - ultimate entity data source
Miczu is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 09-09-2008 , 08:26   Re: Entity Lab (Engine based) [Final]
Reply With Quote #14

There's many ways to skin a cat (I prefer pliers) but checking the modname is pretty common. You could always set a global boolean variable in the plugin_init dependent on the modname and test it in the routine. It'd be a lot quicker. Its up to you. I got it working for me, so I'm happy. Thanks again for your work.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Miczu
Member
Join Date: Jul 2007
Old 09-09-2008 , 08:40   Re: Entity Lab (Engine based) [Final]
Reply With Quote #15

It would be hell to add all mod names with/without radar XD

It would be great if the mod would return if i can use radar (by returning 0). And it would work without additional code (only extra if).

@Vet could you check on dod what num it return?
__________________
Entity Lab - ultimate entity data source
Miczu is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 09-09-2008 , 09:44   Re: Entity Lab (Engine based) [Final]
Reply With Quote #16

Quote:
Originally Posted by Miczu View Post
@Vet could you check on dod what num it return?
If you're refering to the applaunch ID, for DOD its 30.

Code:
Counter-Strike: 10
Team Fortress Classic: 20
Day of Defeat: 30
Half-Life: 70
Condition Zero: 80
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Miczu
Member
Join Date: Jul 2007
Old 09-09-2008 , 09:56   Re: Entity Lab (Engine based) [Final]
Reply With Quote #17

No, this code 2. post on this page
__________________
Entity Lab - ultimate entity data source
Miczu is offline
Miczu
Member
Join Date: Jul 2007
Old 09-09-2008 , 15:26   Re: Entity Lab (Engine based) [Final]
Reply With Quote #18

Could someone test this?
Just run on hl1 mod (dod?) without radar and "say /test".

Plz tell me what it return (for karma).
Attached Files
File Type: sma Get Plugin or Get Source (test.sma - 928 views - 568 Bytes)
__________________
Entity Lab - ultimate entity data source
Miczu is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 09-09-2008 , 16:46   Re: Entity Lab (Engine based) [Final]
Reply With Quote #19

Test on DOD returns ...
Hostage : 0
Hostage Die: 0

I'm pretty sure thos 2 messages don't exist for DOD.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Miczu
Member
Join Date: Jul 2007
Old 09-09-2008 , 16:49   Re: Entity Lab (Engine based) [Final]
Reply With Quote #20

So i will make code for all modes with it

And without geting extra data like mod name :]

Thx Vet (karma for you).

=====================================

Bug fix:
-radar bug on mod whitout it (fixed)
__________________
Entity Lab - ultimate entity data source

Last edited by Miczu; 09-09-2008 at 16:56.
Miczu 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:47.


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