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

[ZP] I am the Iron Man 1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay       
Nightfall1
Senior Member
Join Date: Aug 2008
Old 12-30-2010 , 16:42   [ZP] I am the Iron Man 1.2
Reply With Quote #1


- I am the Iron Man -


Description
  • Autor: Night Dreamer - (Nightfall1)
  • Help: bogdyutzu, Arkshine, Nextra, NiHiLaNTh
  • Release Day: 31/12/2010
  • Version: 1.2
  • Info: Transform your self in iron man

Cvar's
  • zp_extra_ironman.amxx http://www.game-monitor.com/search.p...&type=variable
    zp_iron_jump "700" - Who much it jump iron man
    zp_iron_damage "700" - Damage of iron man + Power Of Jump
    zp_iron_radius "400" - Radius of iron man for damage and knockback
    zp_iron_knockback "2" - Iron man knockback
    zp_iron_control "0" - Iron man can control in air


Changelog's
  • 1.0 first release
  • 1.1 Added knockback + optimization
  • 1.2 Remove fakemeta_ultils, added fun, remove unnecessary stuffs, added new cvar (zp_iron_control), plugin optimization...
Attached Files
File Type: zip zp_extra_ironman.zip (660.3 KB, 481 views)
File Type: sma Get Plugin or Get Source (zp_extra_ironman.sma - 996 views - 13.0 KB)
__________________
SIGNATURE

Last edited by Nightfall1; 12-31-2010 at 12:43.
Nightfall1 is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 12-30-2010 , 17:33   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #2

WOW! seriously you are Iron Man? I am kidding
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 12-30-2010 , 17:47   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #3

i am spongeman

but the description could be better...
__________________
vato loco [GE-S] is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 12-30-2010 , 17:59   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #4

Code suggestions:
- Indent your code properly and consistently.
- Your makros are inefficient. You are calling the pev native too often using this method.
- Isn't zp for counter-strike only? If so, you should use the equivalent cstrike natives instead of the fakemeta_util conversions.
- The same for things like fm_halflife_time, why not use the core function?
- The same for fun natives. They are often faster than fakemeta conversions.
- Is there a special reason for mixing EngFunc_Write's with the standard write functions?
- Are you sure that calling reset_cvar on Ham_Spawn is what you want to do (remember that some users might spawn later into the round and reset_cvar will reset all players)?

This is all I can see right now. It's hard to read, really.
__________________
In Flames we trust!
Nextra is offline
Nightfall1
Senior Member
Join Date: Aug 2008
Old 12-31-2010 , 06:33   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #5

What do you mean with "- Indent your code properly and consistently."
"- Your makros are inefficient." Why is inefficient ? Please tell my
"- Isn't zp for counter-strike only?" Yes is and i will update
fm_halflife_time equal with get_gametime
I will use fun in the next version
"- Is there a special reason for mixing EngFunc_Write's with the standard write functions?" NO
"Are you sure that calling reset_cvar on Ham_Spawn...." UPS
__________________
SIGNATURE
Nightfall1 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-31-2010 , 06:57   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #6

Quote:
What do you mean with "- Indent your code properly and consistently."
He means instead of :

Code:
public reset_cvar()
{
	for(new i = 1; i <= g_maxplayer; i++)
	{
	g_IronJump[i] = false
	g_IronMan[i] = false
	}
}
->

Code:
public reset_cvar()
{
	for(new i = 1; i <= g_maxplayer; i++)
	{
	      g_IronJump[i] = false
	      g_IronMan[i] = false
	}
}
Quote:
Please tell my
Your macros use pev_flags and are called together. You call several times pev_flags when it would be more appropriate to save the value one time before.

Quote:
fm_halflife_time equal with get_gametime
It returns get_gametime(), so just call directly get_gametime().

Quote:
"- Is there a special reason for mixing EngFunc_Write's with the standard write functions?"
There is a reason. He works with float, thus to avoid to do write_coord( floatround( ; it's more efficient to use EngFunc_WriteCoord.
__________________
Arkshine is offline
Nightfall1
Senior Member
Join Date: Aug 2008
Old 12-31-2010 , 07:45   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #7

"Your macros use pev_flags and are called together. You call several times pev_flags when it would be more appropriate to save the value one time before. "
I still don't get it ?
__________________
SIGNATURE
Nightfall1 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-31-2010 , 08:31   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #8

When you have severals same calls, it's more appropriate to cache the value before. The less native you call the better is.

Instead of :

if( native() ... native() )
...
if( native() ... )

You do :

new value = native();

if( value ...
...
if( value ...

You get the idea.
__________________
Arkshine is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 12-31-2010 , 08:55   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
There is a reason. He works with float, thus to avoid to do write_coord( floatround( ; it's more efficient to use EngFunc_WriteCoord.
He does not, that's why I asked.

Quote:
Originally Posted by Nightfall1 View Post
"Your macros use pev_flags and are called together. You call several times pev_flags when it would be more appropriate to save the value one time before. "
I still don't get it ?
I'll show you.

PHP Code:
    new pointer_on_ground = (pointer_is_ironman && is_partialground(iron) || pointer_is_ironman && is_onground(iron))
    if((
pointer_on_ground || is_inworld(iron)) && !is_inwater(iron)) 
You use is_partialground, is_onground, is_inworld and is_inwater.
Each of these makros calls pev(iron, pev_flags) and bit-checks a certain flag. This is inefficient. In this small excerpt alone you are calling pev(iron, pev_flags) four times although the value will and can not change during the function call. It would be much more efficient to do this (for example):

PHP Code:
#define is_onground(%1) (%1 & FL_ONGROUND)
#define is_partialground(%1) (%1 & FL_PARTIALGROUND)
#define is_inworld(%1) (%1 & FL_WORLDBRUSH)
#define is_inwater(%1) (%1 & FL_INWATER)

somefunctionid )
{
    new 
flags pev(idpev_flags);

    if(((
is_onground(flags) || is_partialonground(flags)) || is_inworld(flags)) && !is_inwater(flags))
   {
   }

/edit:
Also while I'm looking at it, you need to look at the conditionals in fw_IronTouch and the sequence of instructions.
- Don't get the cvar values and origin at the beginning. Only get them when you know you need them.
- At the beginning check every information you can already check directly. Check for g_IronMan, g_IronJump, is_user_alive and the weapon right at the beginning and abort the function if necessary.
- Then do all the flag checks.
- Then get all the cvar values, origins and do the rest of the instructions.
__________________
In Flames we trust!

Last edited by Nextra; 12-31-2010 at 09:05.
Nextra is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-31-2010 , 08:58   Re: [ZP] I am the Iron Man 1.1
Reply With Quote #10

He does not, that's why I asked.

You're right. Just seen "pev" which is associated in my mind to float value.
__________________
Arkshine 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 00:15.


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