Raised This Month: $ Target: $400
 0% 

Map Health


Post New Thread Reply   
 
Thread Tools Display Modes
DarkSkif
Member
Join Date: Oct 2009
Location: Russia
Old 01-18-2010 , 04:28   Re: Map Health
Reply With Quote #11

Hehe... shlakbaum . Good plugin
__________________
Who is here?
DarkSkif is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-18-2010 , 06:46   Re: Map Health
Reply With Quote #12

Per maps .cfg files exists for this king of settings.
Also your settings are inconsistent, if you use cvar for team restriction, use cvar for health, or do all in the .ini file.
End, you have to check if player is alive in spawn forward.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-18-2010 at 06:52.
ConnorMcLeod is offline
SHLAKBAUM
Member
Join Date: May 2009
Old 01-18-2010 , 09:21   Re: Map Health
Reply With Quote #13

Small update.
__________________
[Steam]
[IMG]http://a.**************/img693/1005/afterglow.png[/IMG]
SHLAKBAUM is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 01-18-2010 , 10:58   Re: Map Health
Reply With Quote #14

Quote:
Originally Posted by SHLAKBAUM View Post
Small update.
Fakemeta converted to fun:
PHP Code:
/*
*
* Link - http://forums.alliedmods.net/showthread.php?t=115844
*
* Cvars:
* mh_enable 1/0 - Enable/disable plugin
* mh_team 0/1/2 - What team set health? (0 - both, 1 - CT, 2 - T)
*
* Credits:
* DJ_WEST
*
* Changelog:
* v0.5
* - First Release
* v0.5.1
* - Added check is alive player (thanks ConnorMcLeod)
*
*/

#include <amxmodx>
#include <amxmisc>
#include < fun >
#include <hamsandwich>

#define PLUGIN "Map Health"
#define VERSION "0.5.1"
#define AUTHOR "SHLAKBAUM & Eg@r4$ul{"

new g_Enableg_iTeamg_iHealth

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_Enable register_cvar("mh_enable""1")    
    
g_iTeam register_cvar("mh_team""0")
    
    if(
get_pcvar_num(g_Enable))
    {
        new 
szConfigsDir[256], szMapFile[256], szMapName[32], szLine[32]
        
        
get_mapname(szMapNamesizeof(szMapName) -1)
        
get_configsdir(szConfigsDirsizeof(szConfigsDir) -1)
        
format(szMapFile255"%s/MapHealth/%s.ini"szConfigsDirszMapName)
    
        new 
file fopen(szMapFile"r")
        if(!
file)
        {
            return 
PLUGIN_HANDLED
        
}

        while(!
feof(file))
        {
            
fgets(fileszLinecharsmax(szLine))
            
g_iHealth str_to_num(szLine)
        }
        
fclose(file)
        
        if(!
g_iHealth)
        {
            return 
PLUGIN_HANDLED
        
}
        
        
RegisterHam(Ham_Spawn"player""fwdHamPlayerSpawnPost"1)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
fwdHamPlayerSpawnPost(id)
{
    if(
get_user_team(id) != get_pcvar_num(g_iTeam) && is_user_alive(id))
    {
        
set_user_healthidg_iHealth );
    }

Are you lazy, a?
__________________

floatman is offline
SHLAKBAUM
Member
Join Date: May 2009
Old 01-18-2010 , 12:34   Re: Map Health
Reply With Quote #15

@floatman, I don't think this is a good idea
__________________
[Steam]
[IMG]http://a.**************/img693/1005/afterglow.png[/IMG]
SHLAKBAUM is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 01-18-2010 , 12:37   Re: Map Health
Reply With Quote #16

Fun is faster then Fakemeta!
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 01-19-2010 , 06:45   Re: Map Health
Reply With Quote #17

Quote:
Originally Posted by crazyeffect View Post
Fun is faster then Fakemeta!
But he doesn't understand.
__________________

floatman is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-19-2010 , 10:01   Re: Map Health
Reply With Quote #18

Quote:
Originally Posted by crazyeffect View Post
Fun is faster then Fakemeta!
In this situation (setting hp) it's the same just because it both calls 1 native, but fun is still better because it doesnt check for enum (pev_health) and such things.. lol
__________________
xPaw is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-01-2010 , 11:33   Re: Map Health
Reply With Quote #19

Basically the same as Connor's plugin.

Unapproved.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 20:40.


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