Raised This Month: $ Target: $400
 0% 

Setting Humans HP On Spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jeremyjohn
BANNED
Join Date: Jun 2009
Location: Malaysia
Old 09-10-2010 , 03:36   Setting Humans HP On Spawn
Reply With Quote #1

Hi I need help in coding this script:

If the user IS NOT is_user_zombie then when cs_user_spawn he gets set_user_health to 255 or 450 if possible I'm kind of very new to amx coding.

Need this for a biohazard server as i tried to use this http://forums.alliedmods.net/showthread.php?p=702749 but it's also intercepting with the zombies health when zombies re-spawn

Thanks in advance.

Last edited by jeremyjohn; 09-10-2010 at 03:47.
jeremyjohn is offline
Send a message via MSN to jeremyjohn
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-10-2010 , 14:06   Re: Setting Humans HP On Spawn
Reply With Quote #2

Hooking player spawn:
http://forums.alliedmods.net/showthread.php?t=42159

Using the other functions:
http://www.amxmodx.org/funcwiki.php

Download the Biohazard package and save the biohazard.inc file from addons/amxmodx/scripting/include:
http://forums.alliedmods.net/showthread.php?p=598310

Include the file in your code and you will be able to use the function is_user_zombie.

Then, you will need to compile the code locally since you are using a custom include:
http://forums.alliedmods.net/showthread.php?t=130511
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
jeremyjohn
BANNED
Join Date: Jun 2009
Location: Malaysia
Old 09-10-2010 , 15:16   Re: Setting Humans HP On Spawn
Reply With Quote #3

I know how to complie and include biohazard into the plugin that's not the thing i need help with.. the thing i need help with is how do i arrange it in amxx scripting format.. I'm still very noob in that


I wan to know how to arrange it in the proper format something like:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <biohazard>
 
if user is not (is_user_zombiethen on (cs_user_spawn) ((set_user_health) (255)) 
1st of all is the above script possible of working in that type of way?

Sorry for my bad english.
jeremyjohn is offline
Send a message via MSN to jeremyjohn
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 09-10-2010 , 15:54   Re: Setting Humans HP On Spawn
Reply With Quote #4

Quote:
Originally Posted by jeremyjohn View Post
I know how to complie and include biohazard into the plugin that's not the thing i need help with.. the thing i need help with is how do i arrange it in amxx scripting format.. I'm still very noob in that


I wan to know how to arrange it in the proper format something like:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <biohazard>
 
if user is not (is_user_zombiethen on (cs_user_spawn) ((set_user_health) (255)) 
1st of all is the above script possible of working in that type of way?

Sorry for my bad english.
That isn't anywhere correct.

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

#define PLUGIN "Set Health"
#define VERSION "1.0"
#define AUTHOR "GXLZPGX"

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHER )
    
register_logevent"RoundStart"2"1=Round_Start" )
}

public 
RoundStart()
{
    if( !
is_user_zombie )
    {
        
set_user_healthid100 )
    }

__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-10-2010 , 19:50   Re: Setting Humans HP On Spawn
Reply With Quote #5

Quote:
Originally Posted by GXLZPGX View Post
That isn't anywhere correct.

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

#define PLUGIN "Set Health"
#define VERSION "1.0"
#define AUTHOR "GXLZPGX"

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHER )
    
register_logevent"RoundStart"2"1=Round_Start" )
}

public 
RoundStart()
{
    if( !
is_user_zombie )
    {
        
set_user_healthid100 )
    }

That's not anywhere near correct, either.

@jeremyjohn
You are in the Scripting Help section, so you are expected to know how to script.
I just told you everything you need to do to even make this plugin.
If you don't want to make it yourself, then say so and I'll move this to Suggestions/Requests where it belongs.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 09-10-2010 , 20:52   Re: Setting Humans HP On Spawn
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
That's not anywhere near correct, either.

@jeremyjohn
You are in the Scripting Help section, so you are expected to know how to script.
I just told you everything you need to do to even make this plugin.
If you don't want to make it yourself, then say so and I'll move this to Suggestions/Requests where it belongs.
The only thing I got wrong, was the id inside of set_user_health, and the fact that it's on round start. Other than that I see no problem.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-10-2010 , 21:21   Re: Setting Humans HP On Spawn
Reply With Quote #7

Not too sure about how biohazard works, but in zombie plague, people aren't zombie as soon as they spawn. After they spawn, they have to wait for maybe 10-20 seconds, and then someone get's infected. So basically u would be setting everyone's HP to 250 or w/e. Unless biohazard is different? :O

Oh and btw GXL, you would have to use a for loop on the round_start because you cannot just pass a id paramter

Last edited by nikhilgupta345; 09-10-2010 at 21:23.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 09-10-2010 , 21:33   Re: Setting Humans HP On Spawn
Reply With Quote #8

Quote:
Originally Posted by nikhilgupta345 View Post
Not too sure about how biohazard works, but in zombie plague, people aren't zombie as soon as they spawn. After they spawn, they have to wait for maybe 10-20 seconds, and then someone get's infected. So basically u would be setting everyone's HP to 250 or w/e. Unless biohazard is different? :O

Oh and btw GXL, you would have to use a for loop on the round_start because you cannot just pass a id paramter
I've already said that I messed up with the id. Thanks for repeating it. It was a quicky.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX 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 00:29.


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