Raised This Month: $ Target: $400
 0% 

AddToFullPack exchange?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-29-2015 , 09:12   AddToFullPack exchange?
Reply With Quote #1

Hello,

My code is:
Code:
/* Class generated by AMXX STUDIO */

#include <amxmodx>
#include <fakemeta>

public plugin_init() {
	register_plugin("Visible mine", "1.0", "benq");
	
	register_forward(FM_AddToFullPack, "FwdAddToFullPack", 1)
}

public FwdAddToFullPack(es_handle, e, ent, host, hostflags, player, pSet){
	if(!is_user_connected(host))
		return;

	if(!pev_valid(ent))
		return;
	
	new classname[5];
	pev(ent, pev_classname, classname, 4);
	if(equal(classname, "mine"))
	{
		set_es(es_handle, ES_RenderMode, kRenderTransAdd);
		set_es(es_handle, ES_RenderAmt, 255.0);
	}
}
and I tested the profiler. The result was shocking:
Code:
date: Sat Aug 29 13:11:25 2015 map: de_dust2
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                  register_plugin |          1 | 0.000000 / 0.000000 / 0.000000
   n |                 register_forward |          1 | 0.000001 / 0.000001 / 0.000001
   n |                is_user_connected |   97695176 | 53.584341 / 0.000000 / 0.006235
   n |                        pev_valid |    3027522 | 1.853765 / 0.000000 / 0.000815
   n |                              pev |    2287037 | 1.426752 / 0.000000 / 0.000842
   n |                            equal |    2287037 | 1.262358 / 0.000000 / 0.000790
   n |                           set_es |      18190 | 0.011435 / 0.000000 / 0.000085
   n |                        read_data |        981 | 0.000544 / 0.000000 / 0.000007
   p |                 FwdAddToFullPack |   97685575 | 116.755105 / 0.000000 / 0.006407
   p |                      plugin_init |          1 | 0.000005 / 0.000005 / 0.000005
Is there any other function that the player could see the mines invisible?
Sorry, my english is weak...
BeNq! is offline
Old 08-29-2015, 09:46
JusTGo
This message has been deleted by JusTGo. Reason: nvm...
Old 08-29-2015, 18:01
BeNq!
This message has been deleted by BeNq!.
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-30-2015 , 15:19   Re: AddToFullPack exchange?
Reply With Quote #4

Help please.
BeNq! is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 08-30-2015 , 20:47   Re: AddToFullPack exchange?
Reply With Quote #5

Use it on spawn or whenever you like.
I'm not sure if set_user_rendering would work the same way.
PHP Code:
stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16) {
    new 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);

    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtfloat(amount));

    return 
1;

SpeeDeeR is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-31-2015 , 02:06   Re: AddToFullPack exchange?
Reply With Quote #6

set_user_rendering works in the same way as fm_set_rendering, but it seems you cannot use it on non player entities(it does a check with CHECK_PLAYER which basically check if player is between 1 and MaxClients)
__________________
HamletEagle is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-31-2015 , 06:42   Re: AddToFullPack exchange?
Reply With Quote #7

I'm working with amxx plugin for the Call of Duty modification for CS 1.6 server and I have a question about one class.
The first class has invisibility and the second class can see that first guy.
For now I'm using AddToFullPack function for the second guy to see the first oneinvisible player but it's really hard on the processor usage, it simply executes too many times...
Is there any other function I could use for that kind of check with better optimalization, not so resource heavy?
BeNq! is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 09-02-2015 , 20:55   Re: AddToFullPack exchange?
Reply With Quote #8

Quote:
Originally Posted by BeNq! View Post
I'm working with amxx plugin for the Call of Duty modification for CS 1.6 server and I have a question about one class.
The first class has invisibility and the second class can see that first guy.
For now I'm using AddToFullPack function for the second guy to see the first oneinvisible player but it's really hard on the processor usage, it simply executes too many times...
Is there any other function I could use for that kind of check with better optimalization, not so resource heavy?
https://forums.alliedmods.net/showpo...14&postcount=8

Last edited by SpeeDeeR; 09-02-2015 at 20:56.
SpeeDeeR is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-31-2015 , 06:55   Re: AddToFullPack exchange?
Reply With Quote #9

I am not sure, but pev_groupinfo might help.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 09-01-2015 , 20:06   Re: AddToFullPack exchange?
Reply With Quote #10

Quote:
Originally Posted by NiHiLaNTh View Post
I am not sure, but pev_groupinfo might help.
Quote:
Originally Posted by BeNq! View Post
An example?
https://forums.alliedmods.net/showthread.php?t=205453
https://forums.alliedmods.net/showpo...3&postcount=14
https://forums.alliedmods.net/showthread.php?t=200238
SpeeDeeR 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 22:17.


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