Raised This Month: $ Target: $400
 0% 

[Req] Plugin HP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
combocarte112
Senior Member
Join Date: Jun 2016
Location: Romania
Old 11-18-2016 , 11:22   [Req] Plugin HP
Reply With Quote #1

hi,
i want a plugin. CT team will be start with 250 hp.
Thanks.
combocarte112 is offline
Send a message via Skype™ to combocarte112
Artifact
Veteran Member
Join Date: Jul 2010
Old 11-18-2016 , 12:53   Re: [Req] Plugin HP
Reply With Quote #2

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

public plugin_init() {
    
register_plugin("CT get mad""1.0""alliedmods member")
    
register_event("HLTV""event_new_round""a""1=0""2=0"
}

public 
event_new_round( ) {
    new 
players[32], playerCountid
    get_players
(playersplayerCount)
    
    for(new 
i=1playerCounti++) {
        
id players[i]
        if(!
is_user_alive(id) || !is_user_bot(id))
            return 
PLUGIN_HANDLED
        
if(cs_get_user_team(id) == CS_TEAM_CT) {
            
set_user_health(id255)
            
set_user_armor(id100)
        }
    }
    return 
PLUGIN_HANDLED

__________________
Artifact is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 11-18-2016 , 12:55   Re: [Req] Plugin HP
Reply With Quote #3

Here you go
I haven't test it but I think it will work fine
Attached Files
File Type: sma Get Plugin or Get Source (ct_250hp.sma - 613 views - 907 Bytes)
__________________
My plugin:
Celena Luna is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-18-2016 , 13:09   Re: [Req] Plugin HP
Reply With Quote #4

Why would you make such a simple plugin so complicated?!

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

public plugin_init()
{
    
register_plugin("250HP For CT""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
}

public 
OnPlayerSpawn(id)
{
    if(
is_user_alive(id) && get_user_team(id) == 2)
        
set_user_health(id250)

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 11-18-2016 , 13:28   Re: [Req] Plugin HP
Reply With Quote #5

ouch, making Zombie too much so I alway use complicate way
but it work the same way right?
__________________
My plugin:
Celena Luna is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 11-18-2016 , 13:32   Re: [Req] Plugin HP
Reply With Quote #6

Yap
__________________
Artifact is offline
combocarte112
Senior Member
Join Date: Jun 2016
Location: Romania
Old 11-18-2016 , 15:55   Re: [Req] Plugin HP
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
Why would you make such a simple plugin so complicated?!

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

public plugin_init()
{
    
register_plugin("250HP For CT""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
}

public 
OnPlayerSpawn(id)
{
    if(
is_user_alive(id) && get_user_team(id) == 2)
        
set_user_health(id250)

----------------------

And for T team?
combocarte112 is offline
Send a message via Skype™ to combocarte112
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 11-18-2016 , 16:13   Re: [Req] Plugin HP
Reply With Quote #8

Quote:
Originally Posted by combocarte112 View Post
----------------------

And for T team?
Why don't you simply ask them to add cvar?

amx_cvar "250hpteam" "1/2/3" [1 = T's][2 = CT's][3= Both]
Alber9091 is offline
combocarte112
Senior Member
Join Date: Jun 2016
Location: Romania
Old 11-18-2016 , 16:16   Re: [Req] Plugin HP
Reply With Quote #9

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

public plugin_init()
{
    register_plugin("120HP For CT", "1.0", "OciXCrom")
    RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
}

public OnPlayerSpawn(id)
{
    if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_B)
        set_user_health(id, 150)
}

How do I change this? For T Team.

Last edited by combocarte112; 11-18-2016 at 16:22.
combocarte112 is offline
Send a message via Skype™ to combocarte112
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-18-2016 , 16:24   Re: [Req] Plugin HP
Reply With Quote #10

combocarte, just add the

PHP Code:
if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_B && get_user_team(id) == 1
Just one thing:

Artifact:

PHP Code:
public event_new_round( ) {
    new 
players[32], playerCountid
    get_players
(playersplayerCount)
    
    for(new 
i=1playerCounti++) {
        
id players[i]
        if(!
is_user_alive(id) || !is_user_bot(id))
            return 
PLUGIN_HANDLED
        
if(cs_get_user_team(id) == CS_TEAM_CT) {
            
set_user_health(id255)
            
set_user_armor(id100)
        }
    }
    return 
PLUGIN_HANDLED

Can be

PHP Code:
public event_new_round( ) 
{
    new 
players[32], playerCountid
    get_players
(playersplayerCount,"ac""CT")
    
    for(new 
i=1playerCounti++) 
    {
        
id players[i]
        
set_user_health(id255)
        
set_user_armor(id100)
    }

If you want learn something about how to use get_players(), there's : https://www.amxmodx.org/api/amxmodx/get_players
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 11-18-2016 at 16:26.
EFFx 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 09:00.


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