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

Spawn with Armor


Post New Thread Reply   
 
Thread Tools Display Modes
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-16-2009 , 08:20   Re: Spawn with Armor
Reply With Quote #11

Quote:
Originally Posted by Sn!ff3r View Post
Cstrike module
whats wrong?
__________________
xPaw is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 04-16-2009 , 08:25   Re: Spawn with Armor
Reply With Quote #12

Nothing so far lol
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 04-16-2009 , 09:12   Re: Spawn with Armor
Reply With Quote #13

Cool! Hot Plugin
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 04-16-2009 , 11:20   Re: Spawn with Armor
Reply With Quote #14

Quote:
Originally Posted by xPaw View Post
whats wrong?
Anyone still use it? ;)
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-16-2009 , 11:34   Re: Spawn with Armor
Reply With Quote #15

CVAR names are kinda strange to me.
If the amount of armor is set by sv_armor_amount, then armor type should be set by sv_armor_type. Though it has nothing to do with plugin optimization, that would only be less confusing.
Quote:
Originally Posted by Sn!ff3r View Post
Anyone still use it? ;)
I can't see a reason for a person who is having a CS server to not have enabled CStrike module. It just sounds strange.
__________________

Last edited by hleV; 04-16-2009 at 11:37.
hleV is offline
Old 04-16-2009, 11:36
hleV
This message has been deleted by hleV. Reason: Double-post.
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-16-2009 , 11:51   Re: Spawn with Armor
Reply With Quote #16

Quote:
Originally Posted by Sn!ff3r View Post
Anyone still use it? ;)
Use fakemeta instead of cs_set_user_amor and you have to use 2 natives, 1 to set armor, another one to set armor type, so cstrike native should be 2 times faster or even more.
I don't even consider you need 3 more natives to send a ArmorType message.

-edit-
Seems that i was wrong, when you don't send a message, FM is faster, but you actually need to send the message.
PHP Code:
public profid )
{
    for(new 
ii<10000i++)
    {
        
cs_set_user_armor(id100CS_ARMOR_VESTHELM)
        
fm_set_user_armor(id100.02)
        
fm_cs_set_user_armor(id100.02)
    }
    return 
PLUGIN_HANDLED
}

fm_set_user_armor(idFloat:amounttype)
{
    
set_pev(idpev_armorvalueamount)
    
set_pdata_int(id112type)
}

fm_cs_set_user_armor(idFloat:amounttype)
{
    
set_pev(idpev_armorvalueamount)
    
set_pdata_int(id112type)

    if ( 
type )
    {
        
message_beginMSG_ONE_UNRELIABLE gmsgArmorType id )
        
write_bytetype == )
        
message_end();
    }

Code:
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                  register_plugin |          1 | 0.000001 / 0.000001 / 0.000001
   n |                   register_clcmd |          1 | 0.000006 / 0.000006 / 0.000006
   n |                   get_user_msgid |          1 | 0.000001 / 0.000001 / 0.000001
   n |                cs_set_user_armor |      10000 | 0.006480 / 0.000001 / 0.000080
   n |                          set_pev |      20000 | 0.003963 / 0.000000 / 0.000001
   n |                    set_pdata_int |      20000 | 0.003909 / 0.000000 / 0.000068
   n |                    message_begin |      10000 | 0.002382 / 0.000000 / 0.000001
   n |                       write_byte |      10000 | 0.002153 / 0.000000 / 0.000000
   n |                      message_end |      10000 | 0.003001 / 0.000000 / 0.000023
   p |                      plugin_init |          1 | 0.000001 / 0.000001 / 0.000001
   p |                             prof |          1 | 0.005654 / 0.005654 / 0.005654
   f |                fm_set_user_armor |      10000 | 0.005802 / 0.000001 / 0.000046
   f |             fm_cs_set_user_armor |      10000 | 0.011227 / 0.000001 / 0.000045
0 natives, 0 public callbacks, 2 function calls were not executed.
Summary
Code:
type |                             name |      calls | time / min / max
-------------------------------------------------------------------
   n |                cs_set_user_armor |      10000 | 0.006480 / 0.000001 / 0.000080
   f |                fm_set_user_armor |      10000 | 0.005802 / 0.000001 / 0.000046
   f |             fm_cs_set_user_armor |      10000 | 0.011227 / 0.000001 / 0.000045
0 natives, 0 public callbacks, 2 function calls were not executed.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-16-2009 at 12:04.
ConnorMcLeod is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 04-16-2009 , 13:30   Re: Spawn with Armor
Reply With Quote #17

Quote:
Originally Posted by DarkGod View Post
Simple, useful, original. Good job.
PS: You don't have to check if the value is higher than 0 in that if statement, only for info this
__________________

anakin_cstrike is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-16-2009 , 13:44   Re: Spawn with Armor
Reply With Quote #18

You're wrong, it could fuck up the players armor, armor type would be 0, and armor will se to 100? what it will be?
__________________
xPaw is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-16-2009 , 14:20   Re: Spawn with Armor
Reply With Quote #19

You should also check if amount set by plugin is > 0, because if you set armortype to 1 or 2, and set armorvalue to 0, then players won't be able to pick'up ground armors.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 04-17-2009 , 03:01   Re: Spawn with Armor
Reply With Quote #20

Quote:
Originally Posted by xPaw View Post
You're wrong, it could fuck up the players armor, armor type would be 0, and armor will se to 100? what it will be?
You're using clamp so "> 0" and "0" is the same thing in this case.
__________________


Last edited by anakin_cstrike; 04-17-2009 at 03:12.
anakin_cstrike 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 08:52.


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