Raised This Month: $ Target: $400
 0% 

Stop_user_hp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 06-05-2010 , 17:05   Stop_user_hp
Reply With Quote #1

Fixed

Last edited by SaM.ThE.MaN; 06-06-2010 at 05:48.
SaM.ThE.MaN is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 06-05-2010 , 18:12   Re: Stop_user_hp
Reply With Quote #2

That's because you registered Health event (this event is called whenever player health changes) and you set player max health there. Instead of that you should register post spawn (you can use hamsandwich) and set it there.

Your way of setting player max health based on level is a total failure. You needed 500 lines of code while you could achieve the same effect using 2 lines:
PHP Code:
public Health(id)
    
set_user_health(id100 PlayerLevel[id]) 
__________________
Impossible is Nothing
Sylwester is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 06-06-2010 , 04:30   Re: Stop_user_hp
Reply With Quote #3

oh, thanx ...
Actually what i did was
PHP Code:
public Health(id)
    
set_user_health(id100 PlayerLevel
I forgot to add id after player .. so it kept sayin array must be indexed, therefore i did it the other way ,
anyways back to the topic:
Quote:
you should register post spawn (you can use hamsandwich) and set it there.
can you show me how i am supposed to do that
SaM.ThE.MaN is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-06-2010 , 04:43   Re: Stop_user_hp
Reply With Quote #4

Quote:
Originally Posted by SaM.ThE.MaN View Post
oh, thanx ...
Actually what i did was
PHP Code:
public Health(id)
    
set_user_health(id100 PlayerLevel
I forgot to add id after player .. so it kept sayin array must be indexed, therefore i did it the other way ,
anyways back to the topic:


can you show me how i am supposed to do that
Add #include <hamsandwich>

Then:

PHP Code:
register_event("Health""Health""be"); 

PHP Code:
RegisterHam(Ham_Spawn"player""Health"1
And:

PHP Code:
public Health(id)
{
set_user_health(id100 PlayerLevel[id])  


PHP Code:
public Health(id)
{
    if(
is_user_alive(id))
    {
        
set_user_health(id100 PlayerLevel[id]) 
    } 

__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 06-06-2010 , 05:16   Re: Stop_user_hp
Reply With Quote #5

oh thanx alot m8 ,
well am not so familiar with ham sandwich , but now i get think i get what it does
SaM.ThE.MaN is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-06-2010 , 17:12   Re: Stop_user_hp
Reply With Quote #6

Everybody trying to script AMX Mod X plugins should have read this tutorial before asking questions.
__________________
fysiks is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-06-2010 , 17:18   Re: Stop_user_hp
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
Everybody trying to script AMX Mod X plugins should have read this tutorial before asking questions.
Truth be told
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Reply


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 05:27.


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