UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Health

broken avatar :(
Created 8 years ago
by cris428
0 Members and 1 Guest are viewing this topic.
2,965 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 May 2016
Last active: 8 years ago
Posts
0
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
cris428's Groups
cris428's Contact & Social Links
Can you change your health and zombies health.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 7 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
Signature
×
liamsa669's Groups
liamsa669's Contact & Social Links
jep...
players:
Code Snippet
Plaintext
players = get_players();
for(i=0;i<players.size;i++)
{
players[i].health = #;
players[i].maxhealth = #;
}

zombies:
_zombiemode_spawners.gsc line 10:
Code Snippet
Plaintext
level.zombie_health = 150; 
Last Edit: May 26, 2016, 04:55:26 pm by liamsa669
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 2 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
Signature
"Deleted code is debugged code." - Jeff Sickel
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
jep...
players:
Code Snippet
Plaintext
players = get_players();
for(i=0;i<players.size;i++)
{
players.health = #;
players.maxhealth = #;
}
You mean this?
Code Snippet
Plaintext
players = getPlayers(); // Fuck your utility functions :)
for( i = 0; i < players.size; i++ ) {
// Players is an array, why are you setting a variable on an array?
// Changed it to the i-th element of the array
players[i].maxhealth = 100; // Change this line
players[i].health = players[i].maxhealth;
}
Last Edit: May 26, 2016, 05:03:14 pm by JR-Imagine
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 7 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
liamsa669's Groups
liamsa669's Contact & Social Links
You mean this?
Code Snippet
Plaintext
players = getEntArray( "player", "classname" ); // Fuck your utility functions :)
for( i = 0; i < players.size; i++ ) {
// Players is an array, why are you setting a variable on an array?
// Changed it to the i-th element of the array
players[i].maxhealth = 100; // Change this line
players[i].health = players[i].maxhealth;
}
theres not really any diffrence... u just wanted to b cool and confussing to people who are new to scripting so u used a diffrent method of gethering player data. ohhh... shit i forgot the s :D thx 4 remembering, i wrote that right b4 i left to go to a mass 4 my school cuz... they wont allow me to graduate if i dont :'(
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 2 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
theres not really any diffrence... u just wanted to b cool and confussing to people who are new to scripting so u used a diffrent method of gethering player data. ohhh... shit i forgot the s :D thx 4 remembering, i wrote that right b4 i left to go to a mass 4 my school cuz... they wont allow me to graduate if i dont :'(
I wanted to be cool? If by "be cool" you mean not call a utility function which literally just returns the result of getPlayers() and waste execution time, then yes, I wanted to be cool. ;) (Pro tip: Before using a utility function, check what it does to make sure it's not completely useless. :P)

I do a lot of CoD4 stuff so I forgot getPlayers() was even a thing, figured get_players() would just call getEntArray(), guess not. getEntArray() will obviously be less efficient, therefore edited my previous post.

Anyways, main point was that you were setting the variables on the array instead of the element.
Last Edit: May 26, 2016, 05:05:50 pm by JR-Imagine
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 May 2016
Last active: 8 years ago
Posts
0
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
cris428's Groups
cris428's Contact & Social Links
Thanks so much for the response guys

 
Loading ...