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

How to set this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 11-18-2012 , 00:41   How to set this?
Reply With Quote #1

new Total = Frag =- Death
new Kd = Frag /= Death

This won't work :/
How to make this work..

Thanks..
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-18-2012 , 01:44   Re: How to set this?
Reply With Quote #2

Because none of that makes any sense.
__________________
fysiks is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 11-18-2012 , 02:08   Re: How to set this?
Reply With Quote #3

Mmm.. I have been trying to study c++, and if I understood right new = asd is like int asd; (Is that right?)

So i'm trying now do something little with amxx.
I tried make that Frag = 1 and Death = 1 so it can calculate kd and so on..

Here is whole code ( And yes, I know it's not working and there is a LOT to fix, i did't ever try to make it work, just trying to learn ):

Code:
#include <amxmodx>
#include <amxmisc>
#include <csx>

new Frag = 1
new Death = 1
new Total = (Frag =- Death)
new Kd = (Frag /= Death)

public plugin_init()
{
 register_plugin("K/D", "1.0", "Jonuz")
 register_clcmd ("say !kd", "Kdcounter")
}

public Kdinfo()
{
if player_kills;{
 ((Total + Frag))
}
if user_dies;
 {((Total + Death))
}}//blaah, i guess user_dies/kills is not correct for this, even if it's function..:D

{
 if (Total < 250 ) (
  print_chat {get_user_name(player, name, 31)} "'s is now" {Total} " kill ass plussalla!"    
 ) //will propalby spamm this shit when someone is has 250 more kill than dead.. when it works..:D
}

public Kdcounter()
{
client_print ("Player's " {%player} " kd is" {Kd}". He have" {Frag} "frags and " {Death} " death."}
} //No idea yet how to get player's name..
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.

Last edited by jonnzus; 11-19-2012 at 00:38.
jonnzus is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-18-2012 , 02:16   Re: How to set this?
Reply With Quote #4

Quote:
Originally Posted by jonnzus View Post
i did't ever try to make it work, just trying to learn ):
Then I would suggest, you start with something simple.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 11-18-2012 , 02:19   Re: How to set this?
Reply With Quote #5

I did guess this would be simple, at least if I got this work sometimes I will learn pretty much in this project..
e. I mean I didn't try to make it yet. Just testing things/reading more about amxx etc..
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.

Last edited by jonnzus; 11-18-2012 at 02:20.
jonnzus is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-18-2012 , 02:42   Re: How to set this?
Reply With Quote #6

I'm using this :
Maybe not the better formula but it works.


PHP Code:
enum {
    
STATS_KILLS,
    
STATS_DEATHS,
    
STATS_HEADSHOTS,
    
STATS_TEAMKILLING,
    
STATS_SHOTS,
    
STATS_HITS,
    
STATS_DAMAGE,
}

const 
MIN_FRAGS 10
const MIN_DEATHS 5

Float
:GetRatioid )
{
    if( 
is_user_botid ) )
    {
        return 
1.0
    
}

    new 
stats[8], fragsdeathscrap[8]
    
get_user_stats(idstatscrap)
    
frags stats[STATS_KILLS]
    
deaths stats[STATS_DEATHS]

    if( 
frags MIN_FRAGS && deaths MIN_DEATHS )
    {
        return -
1.0
    
}

    if( 
frags <= )
    {
        
frags 1
        deaths 
+= // oO
    
}
    if( 
deaths <= )
    {
        
deaths 1
    
}

    return 
floatdiv(float(frags), float(deaths))

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 11-18-2012 , 03:03   Re: How to set this?
Reply With Quote #7

Thanks, good example for me
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 11-18-2012 , 21:39   Re: How to set this?
Reply With Quote #8

As a note. Because i only briefly read your code.
Code:
new Total = (Frag =- Death)
is crazy.
1. why are you -attempting- to set your Frag as subtracted by Death?
2. its Frag -= Death to do Frag = Frag - Death
3. That is really ugly.
4. As another note new Kd = Frag /= Death will round to closest int. If you're looking for it to be a double (or decimal number) initialize Kd as Float Float Kd = stuffs
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz 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 05:40.


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