Raised This Month: $ Target: $400
 0% 

Please tell me one basic thing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-19-2013 , 07:27   Please tell me one basic thing
Reply With Quote #1

My plugin shows the Kills Per Minute Rate of a player....


for this, a simple calculation is to be done.

PHP Code:
public info(id){
new 
userTime
    userTime 
get_user_time(id)
    
    new 
frags 
    frags 
get_user_frags(id)

    new 
deaths
    
deaths get_user_deaths(id)
    
    new 
kpm
    kpm 
deaths/frags*userTime
    
    set_hudmessage
(25500, -1.00.01)    
    
show_hudmessage(id"You killed %i , Died %i times and playing form %i seconds^n[KPM RATE : %i]",frags,deaths,userTimekpm)

what is the mistake the "kpm =.........Time" line??

Last edited by ezio_auditore; 11-19-2013 at 07:28.
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-19-2013 , 08:02   Re: Please tell me one basic thing
Reply With Quote #2

userTime is in Seconds, not Minutes. Plus, your calculation is incorrect, KPM = Kills / Minutes
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-19-2013 , 09:04   Re: Please tell me one basic thing
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
userTime is in Seconds, not Minutes. Plus, your calculation is incorrect, KPM = Kills / Minutes
the function info never gets called....
what's the mistake
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-19-2013 , 09:08   Re: Please tell me one basic thing
Reply With Quote #4

Are you even calling the function? We can't help you there as you don't provide all of the code
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-19-2013 , 09:18   Re: Please tell me one basic thing
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
Are you even calling the function? We can't help you there as you don't provide all of the code

well...
if i provide the whole code and you correct it then i post it in new plugin submission, a moderator post will appear saying plugin originally posted by you....
i know how to call a function..
i typed register_clcmd("say /kpm","info")
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-19-2013 , 09:22   Re: Please tell me one basic thing
Reply With Quote #6

We cannot assist you if we don't see more of the code
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-19-2013 , 09:36   Re: Please tell me one basic thing
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
We cannot assist you if we don't see more of the code
PHP Code:
 #include <amxmodx>
 #include <amxmisc>
public plugin_init() {
register_plugin("Kills per minute""1.0""AssAssIN_IMpossible")
register_clcmd("say /info","info")
 }
public 
info(id){
new 
userTime
    userTime 
get_user_time(id)
    
    new 
frags 
    frags 
get_user_frags(id)
    new 
deaths
    
deaths get_user_deaths(id)
    
    new 
kpm
    kpm 
deaths/frags*userTime
    
    set_hudmessage
(25500, -1.00.01)    
    
show_hudmessage(id"You killed %i , Died %i times and playing form %i seconds^n[KPM RATE : %i]",frags,deaths,userTimekpm)

__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-19-2013 , 23:45   Re: Please tell me one basic thing
Reply With Quote #8

Everything looks fine to me except that your calculation of KPM is completely wrong and also the y-position of your HUD message is questionable. I'm not even sure you will be able to see it with that value. Test it with the default, -1, for both x- and y-position (assuming you are not able to see the message).
__________________
fysiks is online now
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-20-2013 , 07:32   Re: Please tell me one basic thing
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
Everything looks fine to me except that your calculation of KPM is completely wrong and also the y-position of your HUD message is questionable. I'm not even sure you will be able to see it with that value. Test it with the default, -1, for both x- and y-position (assuming you are not able to see the message).
when i type debug after the plugin name in plugins.ini, it says something is wrong with line 30 (divisions)
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-20-2013 , 07:46   Re: Please tell me one basic thing
Reply With Quote #10

Quote:
Originally Posted by ezio_auditore View Post
when i type debug after the plugin name in plugins.ini, it says something is wrong with line 30 (divisions)
Do you have the exact error? Have you tried using the correct formula?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply


Thread Tools
Display Modes

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 23:22.


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