AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Modify default hp (https://forums.alliedmods.net/showthread.php?t=129267)

Mandiii 06-10-2010 18:30

Modify default hp
 
I want to modify the default hp of a individual player, and i want it saved so that when the player come back to the server he still has that hp.

YamiKaitou 06-10-2010 18:38

Re: Modify default hp
 
Set the users HP on spawn

Mandiii 06-10-2010 18:42

Re: Modify default hp
 
Could you provide an example please. :)

wrecked_ 06-10-2010 18:51

Re: Modify default hp
 
Code:
#include <amxmodx> #include <hamsandwich> #include <fun> #define START_HEALTH    150 public plugin_init() {     register_plugin( "HP Modifier", "1.0", "Wrecked" )         RegisterHam( Ham_Spawn, "player", "HamSpawnPost", 1 ) } public HamSpawnPost( id ) {     if( is_user_alive( id ) )     {         set_user_health( id, START_HEALTH )     } }

EDIT: Oh, hi there, drekes. =]

drekes 06-10-2010 18:53

Re: Modify default hp
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init()
    
RegisterHam(Ham_Spawn"player""Fwd_Ham_Spawn_Post"1);
    
public 
Fwd_Ham_Spawn_Post(id)
{
    if(
is_user_alive(id))
        
set_user_health(id/* hp you want*/);


Edit: Damn Wrecked


All times are GMT -4. The time now is 05:24.

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