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

about armor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 03-21-2011 , 15:05   about armor
Reply With Quote #1

Hey guys,

I havent been here for ages, and i have forgotten all, so i created small plugin on spawn which includes extra lil bit of hp, armor and last but not least speed, the problem is that armor doesn't take damage at all, it's feels like you dont have. -- i'm sorry i have to learn it all over again. :/ here is code

PHP Code:
public fwHamPlayerSpawnPost(player)
{
    if (
is_user_alive(player))
    {
        new 
g_currentArmor pev(playerpev_armorvalue)
        new 
Float:g_newMaxSpeed fm_get_user_maxspeed(player) + 50.0
        set_pev
(playerpev_healthfloat(135))
        
set_pev(playerpev_maxspeedg_newMaxSpeed)
        
set_pev(playerpev_armorvalueg_currentArmor float(200))
    }
    
    return 
PLUGIN_CONTINUE
}

public 
fw_PlayerPreThink(player)
{
    new 
Float:g_newMaxSpeed fm_get_user_maxspeed(player) + 50.0
        
    set_pev
(playerpev_maxspeedg_newMaxSpeed)


how to fix it? Should i add Ham take damage also with armor?

and last question how can i create function when you can't buy armor anymore (i mean which is given on spawn) - like if you have one already, cause just bought armor will overwrite extra armor.

Thanks in advance.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 03-21-2011 , 18:40   Re: about armor
Reply With Quote #2

about your armor => engine => armor is simple
because u set only the armorvalue but the engine don't know the player as a real armor.

<cstrike>
PHP Code:
enum CsArmorType {
    
CS_ARMOR_NONE 0// no armor
    
CS_ARMOR_KEVLAR 1// armor
    
CS_ARMOR_VESTHELM // armor and helmet
};
/* Use this instead of fun's set_user_armor.
 * Appropriate message to update client's HUD will be sent if armortype is kevlar or vesthelm.
 */
native cs_set_user_armor(indexarmorvalueCsArmorType:armortype);

samplecs_set_user_armor(id100_:CS_ARMOR_VESTHELM
<fakemeta>
PHP Code:
enum
{
    
FM_CS_ARMOR_NONE 0// no armor
    
FM_CS_ARMOR_KEVLAR// armor
    
FM_CS_ARMOR_VESTHELM // armor and helmet
}

stock fm_cs_set_user_armor(idvaluetype)
{
    
set_pdata_int(id112type5)
    
    
set_pev(idpev_armorvaluefloat(value))
    
    if (
type FM_CS_ARMOR_NONE)
    {
        static 
msgArmorType
        
if (msgArmorType || (msgArmorType get_user_msgid("ArmorType")))
        {
            
emessage_begin(MSG_ONE_UNRELIABLEmsgArmorType_id)
            
ewrite_byte(type-1)
            
emessage_end()
        }
    }
}

samplefm_cs_set_user_armor(id100FM_CS_ARMOR_VESTHELM
__________________

Working on:
nothing
schmurgel1983 is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 03-22-2011 , 02:22   Re: about armor
Reply With Quote #3

Thanks man! I appreciate that. I'm gonna check it when i get back to home.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 03-22-2011 , 17:01   Re: about armor
Reply With Quote #4

Thanks dude, it work now! ;)
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! 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 14:54.


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