Raised This Month: $ Target: $400
 0% 

Help start round...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elpouletorange
Senior Member
Join Date: Oct 2007
Old 10-21-2007 , 10:30   Help start round...
Reply With Quote #1

How can i give health at start of round to someone??
elpouletorange is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-21-2007 , 10:47   Re: Help start round...
Reply With Quote #2

First make sure you well understand this tut : http://forums.alliedmods.net/showthread.php?t=42159

Use ResetHud event to give player HP.
Then it will depend on whitch module you wish to use.
Most simple to use is get / set_user_health
ConnorMcLeod is offline
elpouletorange
Senior Member
Join Date: Oct 2007
Old 10-21-2007 , 11:02   Re: Help start round...
Reply With Quote #3

So if a do:
PHP Code:
public event_player_spawn(id
{
    
set_user_health(idskill_strenght 5)
    
set_user_armor............
    ........................

at spawning the player get 101hp ??

or i should do:
PHP Code:
#define MAX_PLAYERS 32
new bool:g_restart_attempt[MAX_PLAYERS 1]
 
public 
plugin_init() {
    
register_event("ResetHUD""event_hud_reset""be")
    
register_clcmd("fullupdate""clcmd_fullupdate"
    
register_event("TextMsg""event_restart_attempt""a""2=#Game_will_restart_in")
}
 
public 
clcmd_fullupdate() {
    return 
PLUGIN_HANDLED_MAIN
}
 
public 
event_restart_attempt() {
    new 
players[32], num
    get_players
(playersnum"a")
    for (new 
inum; ++i)
        
g_restart_attempt[players[i]] = true
}
 
public 
event_hud_reset(id) {
    if (
g_restart_attempt[id]) {
        
g_restart_attempt[id] = false
        
return
    }
    
event_player_spawn(id)
}
 
// this function is called on player spawn
public event_player_spawn(id) {
    
set_user_health(idskill_strenght 5)
    
set_user_armor(idskill_defence 10)
    
set_user_gravity(id800 skill_dexterity 50)
    
set_user_maxspeed(id100 skill_agility 5)

and do this is correct ?
PHP Code:
skill_strenght(id) = skill_strenght(id) + 

Last edited by elpouletorange; 10-21-2007 at 11:16.
elpouletorange is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-21-2007 , 20:17   Re: Help start round...
Reply With Quote #4

Quote:
Originally Posted by elpouletorange View Post
and do this is correct ?
PHP Code:
skill_strenght(id) = skill_strenght(id) + 

No. First, you have to define it as being an array. So, you would have to define it like this.
PHP Code:
new skill_strenght[33]; 
Then, you would rewrite that line like this
PHP Code:
skill_strenght[id]++; 
OR
PHP Code:
skill_strenght[id] = skill_strenght[id] + 1
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-21-2007 , 14:09   Re: Help start round...
Reply With Quote #5

I'd assume its:

PHP Code:
set_user_health(idget_user_health(id) + (skill_strengt 5)) 
I take that you want to add skill_strength * 5 to the existing health. Otherwise, what you have right now is replacing the user's health with skill_blahblah * 5
__________________
M249-M4A1 is offline
elpouletorange
Senior Member
Join Date: Oct 2007
Old 10-21-2007 , 19:21   Re: Help start round...
Reply With Quote #6

skill_strenght dont need (id) ? Because its not a global.. it can be 0 for one and 49 for anorther ??
elpouletorange 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 01:23.


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