Raised This Month: $ Target: $400
 0% 

set_user_health / set_user_armor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BigDontCry
Member
Join Date: Nov 2007
Location: Sweden
Old 11-07-2007 , 16:03   set_user_health / set_user_armor
Reply With Quote #1

Hey =)

I'm just playing around with all the syntaxes you can use with AMXX... And I made this so that the clients would have 150 HP and 150 Armor when they spawn...

Well... they have..... Sort of... =)

I can take an M4A1 and shoot all my bullets to the head, still they don't die... Until I put a knife in their head...

Why?

PHP Code:
public plugin_init() {
 
  
register_plugin("TestPlug""1.0""")
 
}
public 
client_PreThink(id) {
 
 if(
is_user_connected(id)) {
   
set_user_health(id150)
   
set_user_armor(id150)
 
   
entity_set_float(idEV_FL_fuser20.0)
 }

__________________
Big Men Don't Cry

Quote:
[20:23] [email protected]: I don't know how
[20:23] [email protected]: I'm only 15
[20:23] [email protected]: I don't know anything
BigDontCry is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-07-2007 , 16:08   Re: set_user_health / set_user_armor
Reply With Quote #2

public client_PreThink(id)

That is called every frame.
So you're setting the clients hp to 150 about 100 times every second...
[ --<-@ ] Black Rose is offline
BigDontCry
Member
Join Date: Nov 2007
Location: Sweden
Old 11-07-2007 , 16:09   Re: set_user_health / set_user_armor
Reply With Quote #3

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
public client_PreThink(id)

That is called every frame.
So you're setting the clients hp to 150 about 100 times every second...

Ok, nice to know that... But how come I can kill them with the knife? ;D
__________________
Big Men Don't Cry

Quote:
[20:23] [email protected]: I don't know how
[20:23] [email protected]: I'm only 15
[20:23] [email protected]: I don't know anything
BigDontCry is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-07-2007 , 16:12   Re: set_user_health / set_user_armor
Reply With Quote #4

You might do enough dmg to kill them in one hit.
Then they wouldn't be able to heal up as the damage is done directly.

This is how you would set their health and armor at spawn.

Code:
#include <amxmodx> #include <fun> new bool:g_restart_attempt[33]; public plugin_init() {     register_plugin("", "", "")         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 public event_restart_attempt() {     new players[32], num;         get_players(players, num, "a");         for ( new i ; i < num ; ++i)         g_restart_attempt[players[i]] = true; } public event_hud_reset(id) {     if (g_restart_attempt[id]) {         g_restart_attempt[id] = false;         return;     }         set_user_health(id, 150)     set_user_armor(id, 150) }

Last edited by [ --<-@ ] Black Rose; 11-07-2007 at 16:16.
[ --<-@ ] Black Rose is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-07-2007 , 17:56   Re: set_user_health / set_user_armor
Reply With Quote #5

I'd imagine it to be true in Counter-Strike as well that a stab in the head will do more than 100 damage...a good way to tell is to type %h after you get killed. If it's below 0, yep.

So you may want to set it above 150 to prevent that.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
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:14.


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