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

Solved 1 HP for all


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Magicher0ex
Member
Join Date: Dec 2019
Old 09-22-2020 , 09:02   1 HP for all
Reply With Quote #1

Hey guys, can anyone make a plugin with cvar. I want all players to have a only 1 hp. If anyone add a command /hp for admins that will be great.

Last edited by Magicher0ex; 09-22-2020 at 15:48.
Magicher0ex is offline
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 09-22-2020 , 14:21   Re: 1 HP for all
Reply With Quote #2

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "r0ma'"

// Comment next line if you want only for the current round
#define ALL_ROUNDS

#if defined ALL_ROUNDS
new g_iActive;
#endif
new g_iMaxPlayers;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
#if defined ALL_ROUNDS
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1);
    
#endif
    
    
register_clcmd("say /hp""clcmd_hp");
    
    
g_iMaxPlayers get_maxplayers();
}

#if defined ALL_ROUNDS
public fw_PlayerSpawn_Post(id) {
    if(
g_iActive && is_user_alive(id))
        
set_user_health(id1);
}
#endif

public clcmd_hp(id) {
    if(!(
get_user_flags(id) & ADMIN_CVAR))
        return 
PLUGIN_HANDLED;
    
    
#if defined ALL_ROUNDS
    
g_iActive =! g_iActive;
    
client_print(idprint_chat"[AMXX] 1 Hp %s"g_iActive "ON" "OFF");
    
    if(
g_iActive) {
    
#else
    
client_print(idprint_chat"[AMXX] 1 Hp ON");
    
#endif
        
for(new 1<= g_iMaxPlayersi++) {
            if(
is_user_alive(i))
                
set_user_health(i1);
        }
    
#if defined ALL_ROUNDS
    
}
    
#endif
    
    
return PLUGIN_HANDLED;

__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'
r0ma is offline
Send a message via MSN to r0ma
Magicher0ex
Member
Join Date: Dec 2019
Old 09-22-2020 , 15:47   Re: 1 HP for all
Reply With Quote #3

Quote:
Originally Posted by r0ma View Post
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "r0ma'"

// Comment next line if you want only for the current round
#define ALL_ROUNDS

#if defined ALL_ROUNDS
new g_iActive;
#endif
new g_iMaxPlayers;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
#if defined ALL_ROUNDS
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1);
    
#endif
    
    
register_clcmd("say /hp""clcmd_hp");
    
    
g_iMaxPlayers get_maxplayers();
}

#if defined ALL_ROUNDS
public fw_PlayerSpawn_Post(id) {
    if(
g_iActive && is_user_alive(id))
        
set_user_health(id1);
}
#endif

public clcmd_hp(id) {
    if(!(
get_user_flags(id) & ADMIN_CVAR))
        return 
PLUGIN_HANDLED;
    
    
#if defined ALL_ROUNDS
    
g_iActive =! g_iActive;
    
client_print(idprint_chat"[AMXX] 1 Hp %s"g_iActive "ON" "OFF");
    
    if(
g_iActive) {
    
#else
    
client_print(idprint_chat"[AMXX] 1 Hp ON");
    
#endif
        
for(new 1<= g_iMaxPlayersi++) {
            if(
is_user_alive(i))
                
set_user_health(i1);
        }
    
#if defined ALL_ROUNDS
    
}
    
#endif
    
    
return PLUGIN_HANDLED;

Thank you! Works perfect!
Magicher0ex 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 07:38.


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