Raised This Month: $51 Target: $400
 12% 

Help with HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lucho.
Member
Join Date: Jul 2012
Location: Buenos Aires, Argentina
Old 05-28-2014 , 18:24   Help with HUD
Reply With Quote #1

Hello, sorry for my bad english. I'm just doing a kills / deaths by HUD but when I try HUD bugged me. please help me fix D:

PHP Code:
show_hudmessage (Players[i], "-Name: %s^n-Kills: %d^n-deaths: %d^n-K/D: %d^n-Headshots :%d"szNameg_frags[Players[i]], get_user_deaths(Players[i]), (g_frags[Players[i]] / get_user_deaths(Players[i])), g_Hskill[Players[i]]) 

Last edited by Lucho.; 05-28-2014 at 18:26.
Lucho. is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 05-29-2014 , 01:34   Re: Help with HUD
Reply With Quote #2

1. post all code
2. tell us all your problems
swapped is offline
Lucho.
Member
Join Date: Jul 2012
Location: Buenos Aires, Argentina
Old 05-31-2014 , 15:14   Re: Help with HUD
Reply With Quote #3

No need to put all the code as it is in that line the bug.
What I want is to divide kills by deaths and give me the result in the hud where "K / D" said. No if he understood. for example
Kills 10
Deaths: 5
K/D: 2.0
Lucho. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-31-2014 , 23:50   Re: Help with HUD
Reply With Quote #4

You have to change the kills and deaths to floating point values before you can divide. Then, you have to use %f and not %d to show the value.

Code:
Float:kdr = float(kills)/float(deaths)
__________________

Last edited by fysiks; 06-01-2014 at 02:20. Reason: fixed my variable tagging.
fysiks is offline
Lucho.
Member
Join Date: Jul 2012
Location: Buenos Aires, Argentina
Old 06-01-2014 , 00:19   Re: Help with HUD
Reply With Quote #5

Thanks leave the code

PHP Code:
float(g_frags[Players[i]]) / float((get_user_deaths(Players[i]))) 
Lucho. 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 07:11.


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