Raised This Month: $ Target: $400
 0% 

Last CT get hp speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ady20
Member
Join Date: Sep 2012
Old 10-29-2012 , 13:48   Last CT get hp speed
Reply With Quote #1

I am trying to make a plugin where the last CT will get 200 HP and 380 speed, but I don't have any succes lol.
Here is what I've done so far
Attached Files
File Type: sma Get Plugin or Get Source (GiveLastCT.sma - 520 views - 1,012 Bytes)
Ady20 is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 10-29-2012 , 15:12   Re: Last CT get hp speed
Reply With Quote #2

Tell us what's not working..
Torge is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-29-2012 , 15:23   Re: Last CT get hp speed
Reply With Quote #3

I maybe can do it for you, but i have one question... You want CT get more 200hp or that last CT have 200hp?
__________________
Jhob94 is offline
Ady20
Member
Join Date: Sep 2012
Old 10-29-2012 , 15:40   Re: Last CT get hp speed
Reply With Quote #4

Torge - well nothing is working... I get a lot of errors when compiling :O
Jhob - I want that the last CT get 200 more HP so he will have 300
Ady20 is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 10-29-2012 , 18:07   Re: Last CT get hp speed
Reply With Quote #5

Don't work because your "id" will do nothing.

Try this,

PHP Code:
#include < amxmodx >
#include < fun >

new g_iCtHpBonus

public plugin_init( ) 

    
register_plugin"GiveLastCT""1.0""Ady20" )
    
    
register_event"DeathMsg""EventDeath""a" )
    
g_iCtHpBonus register_cvar"amx_last_ct_hp_bonus""200" )  
}

public 
EventDeath( )
{
    new 
Players32 ]
    new 
iNum
    
    get_players
PlayersiNum"ae""CT" )
    
    if( 
iNum == )
    {
        new 
iHealth get_user_healthPlayers] )
        new 
iHealthToGive get_pcvar_numg_iCtHpBonus )
        
        
set_user_healthPlayers], iHealth iHealthToGive )
        
set_user_maxspeedPlayers[0], 2.0 )
    }


Last edited by guipatinador; 10-29-2012 at 18:09.
guipatinador is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 10-30-2012 , 04:17   Re: Last CT get hp speed
Reply With Quote #6

Quote:
Originally Posted by guipatinador View Post
Don't work because your "id" will do nothing.

Try this,

PHP Code:
#include < amxmodx >
#include < fun >

new g_iCtHpBonus

public plugin_init( ) 

    
register_plugin"GiveLastCT""1.0""Ady20" )
    
    
register_event"DeathMsg""EventDeath""a" )
    
g_iCtHpBonus register_cvar"amx_last_ct_hp_bonus""200" )  
}

public 
EventDeath( )
{
    new 
Players32 ]
    new 
iNum
    
    get_players
PlayersiNum"ae""CT" )
    
    if( 
iNum == )
    {
        new 
iHealth get_user_healthPlayers] )
        new 
iHealthToGive get_pcvar_numg_iCtHpBonus )
        
        
set_user_healthPlayers], iHealth iHealthToGive )
        
set_user_maxspeedPlayers[0], 2.0 )
    }

Checking for last player using deathmsg is not good
EpicMonkey is offline
Ady20
Member
Join Date: Sep 2012
Old 10-30-2012 , 04:26   Re: Last CT get hp speed
Reply With Quote #7

Thanks a lot it worked.
Ady20 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:53.


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