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

change a 35hp map to 100 hp


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
veliflst
Member
Join Date: Aug 2013
Old 06-06-2020 , 22:49   change a 35hp map to 100 hp
#1

I want to put a map in my gungame, but it makes player have 35 health at start

I need players to have 100 hp

please help, how do I do it

on this map

https://gamebanana.com/maps/200641

Last edited by DarkDeviL; 12-30-2023 at 11:25. Reason: Restore to previous version.
veliflst is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 06-07-2020 , 00:02   Re: change a 35hp map to 100 hp
#2

Code:
#include <amxmodx> #include <hamsandwich> #include <fun> new const map[] = "35hp_2"; new mapname[32]; public plugin_init(){     get_mapname(mapname, charsmax(mapname));         if (equal(mapname, map) != -1){         RegisterHam(Ham_Spawn, "player", "Spawn", 1);     } } public client_disconnected(id){     if (task_exists(id)){         remove_task(id);     } } public Spawn(id){     set_task(1.5, "reset_health", id); } public reset_health(id){     if (is_user_alive(id)){         set_user_health(id, 100);     } }
__________________
Relaxing is offline
Firippu
Senior Member
Join Date: Jan 2007
Old 06-07-2020 , 02:33   Re: change a 35hp map to 100 hp
#3

To make things more complicated; here are a few more methods.

This finds the damage-causing entity by classname then removes it.
PHP Code:
new iEntity find_ent_by_class(-1,"game_player_hurt")
if(
is_valid_ent(iEntity)) remove_entity(iEntity
This one finds the same entity from above but this time finds its location & kicks the crap out of it, lowering its damage to zero, rendering it harmless.
PHP Code:
new iEntity=find_ent_in_sphere(-1,Float:{0.0,400.0,384.0},1.0)
if(
is_valid_ent(iEntity)) DispatchKeyValue(iEntity,"dmg","0"
Finally, this scopes out its puny foot soldiers one by one, identifying them by their model, then choking them out.
PHP Code:
new iEntity
for(new iNum=49iNum<=72iNum++) {
    static 
szModel[4]
    static 
szNum[3]
    
num_to_str(iNum,szNum,2)
    
szModel[0]='^0'
    
strcat(szModel,"*",1)
    
strcat(szModel,szNum,3)

    
iEntity=find_ent_by_model(-1,"trigger_multiple",szModel)
    if(
is_valid_ent(iEntity)) remove_entity(iEntity)

__________________
Firippu is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-07-2020 , 07:30   Re: change a 35hp map to 100 hp
#4

Quote:
To make things more complicated; here are a few more methods.
I'd say to make things properly rather than complicated. The first method should work for most maps and it's the better solution.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Closed Thread


Thread Tools
Display Modes

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 06:54.


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