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

Take 10% of a Player's Score?

broken avatar :(
Created 11 years ago
by jbird
0 Members and 1 Guest are viewing this topic.
2,340 views
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
jbird's Groups
Everything I try just takes 0 points
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Code Snippet
Plaintext
tmp_score = player.score * .1;

tmp_score is 10%.
Marked as best answer by jbird 11 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 5 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
Code Snippet
Plaintext
        points = int( player.score * .1);
        player maps\_zombiemode_score::minus_to_player_score( points );

i havent tested it but that should do it, ive noticed when it comes to multiplying out percentages of a players score it has to be cast to int otherwise it comes out to be 0

Double Post Merge: June 18, 2015, 10:01:51 pm
Code Snippet
Plaintext
        points = int( player.score * .1);
        player maps\_zombiemode_score::minus_to_player_score( points );

ive noticed when it comes to multiplying out percentages of a players score it has to be cast to int otherwise it comes out to be 0
Last Edit: June 18, 2015, 10:01:51 pm by buttkicker845
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
Code Snippet
Plaintext
        points = int( player.score * .1);
        player maps\_zombiemode_score::minus_to_player_score( points );

i havent tested it but that should do it, ive noticed when it comes to multiplying out percentages of a players score it has to be cast to int otherwise it comes out to be 0

Thank you! You have solved my problem! I did not know about int.
Last Edit: June 18, 2015, 10:33:27 pm by jbird
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 22 September 2013
Last active: 6 months ago
Posts
326
Respect
Forum Rank
Perk Hacker
Primary Group
Mapper
My Groups
More
Personal Quote
Zombie Mapper and Gamer
Signature
My Custom Zombie Maps:

- Nazi zombie Legion
- City of Hell
- The Abandoned Mine
- The Last Undead House (Finished)

more custom zombie maps coming soon
×
gamer9294's Groups
Mapper Has released one or more maps to the UGX-Mods community.
gamer9294's Contact & Social Links
hi man,

also make a if/else statement to check that the player could not be lower then 0 points you know like -470 points as sample.


Code Snippet
Plaintext
points = int( player.score * .1);
player maps\_zombiemode_score::minus_to_player_score( points );


change it to this:

Code Snippet
Plaintext
points = int( player.score * .1);
if(player.score > points)
{
    player maps\_zombiemode_score::minus_to_player_score( points );
}


this will make sure that the points could not be lower then 0


maybe it is useful for you :)


best regards,
Gamer9294


broken avatar :(
×
broken avatar :(
[UGX] Developer
Location: nlLimburg, Netherlands
Date Registered: 28 October 2013
Last active: 2 years ago
Posts
764
Respect
Forum Rank
The Decider
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
[UGX] Developer
×
Lukkie1998's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Mapper Has released one or more maps to the UGX-Mods community.
UGX Chat Moderator Has the ability to mute, kick, or ban chat members for being abusive or breaking the rules of the forum.
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
2015 Participant
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
hi man,

also make a if/else statement to check that the player could not be lower then 0 points you know like -470 points as sample.


Code Snippet
Plaintext
points = int( player.score * .1);
player maps\_zombiemode_score::minus_to_player_score( points );


change it to this:

Code Snippet
Plaintext
points = int( player.score * .1);
if(player.score > points)
{
    player maps\_zombiemode_score::minus_to_player_score( points );
}


this will make sure that the points could not be lower then 0


maybe it is useful for you :)


best regards,
Gamer9294
You can't get below 0 if you only take 10% off everytime. If i have 10 point, it would take off one point (which won't work in waw because points get rounded up by 10). What i'm trying to say is if the player has less than 100 points, this thing can cause things like score HUD not changing, etc.

Lukkie1998
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 22 September 2013
Last active: 6 months ago
Posts
326
Respect
Forum Rank
Perk Hacker
Primary Group
Mapper
My Groups
More
Personal Quote
Zombie Mapper and Gamer
×
gamer9294's Groups
Mapper Has released one or more maps to the UGX-Mods community.
gamer9294's Contact & Social Links
You can't get below 0 if you only take 10% off everytime. If i have 10 point, it would take off one point (which won't work in waw because points get rounded up by 10). What i'm trying to say is if the player has less than 100 points, this thing can cause things like score HUD not changing, etc.

Lukkie1998


okay thanks for the advice I was forgetten that xD 

yeah correct man ;)


best regards,
Gamer9294

 
Loading ...