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

[Soccerjam] Ball Jump Stats [1.0.1] UPDATE


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose        Approver:   Brad (55)
shine771
Senior Member
Join Date: Jun 2007
Old 04-30-2009 , 16:36   [Soccerjam] Ball Jump Stats [1.0.1] UPDATE
Reply With Quote #1

Ball Jump Stats
[1.0.1]


- Description -

This is a plugin for Soccerjam mod. It detects ball jumps and writes your stats in MySql database. You can view your personal stats or see the top. You can switch methods how your stats are displayed - CZ Style tutor, chat or hud.

- Cvars -

Quote:
sj_bjs_min_dist < ###.# > < Min distance you must jump for a text message to be displayed to everyone in chat > < Def: 425.0 >
sj_bjs_min_height < ###.# > < Min distance you must jump from ground for a text message to be displayed to everyone in chat > < Def: 150.0 >
sj_bjs_min_bj < ## > < Min BallJump's needed for a text message to be displayed to everyone in chat > < Def: 5 >

sj_bjs_msg_type < 0 / 1 > < If player didn't have files for Tutor before he connected or sj_bjs_use_tutor is off, display stats in: 0 - chat, 1 - hud > < Def: 0 >
sj_bjs_use_tutor < 1 / 0 > < If possible use Tutors > < Def: 1 >
sj_bjs_tutor_style < 1 - 4 > < Tutor style > < Def: 3 >
sj_bjs_tutor_good_style < 1 - 4 > < Tutor style in which your jump details are showed if you make a good jump > < Def: 1 >

sj_bjs_beam < 1 / 0 > < Beam On/Off> < Def: 1 >
sj_bjs_beam_time < ## > < How long until the beam disappears? > < Def: 5 >
sj_bjs_beam_color < "### ### ###" > < Beam color in RGB format. If you want a random beam color, use "r". > < Def: "r" >

//MySQL
bj_host < "host" > < MySQL Host > < Def: "localhost" >
bj_user < "user" > < MySQL User > < Def: "root" >
bj_password < "password" > < MySQL Password. You must put this in amxx.cfg, because there is no value set. Or you can write it in the .sma and recompile it > < Def: "" >
bj_database < "database" > < MySQL Database you've made. > < Def: "soccerjam">

- Client Commands -

Quote:
say '/bjstats' or 'bjstats' - Displays your best stats.
say '/bjtop' or 'bjtop' - Displays the Top menu.
say '/bjtopc' or 'bjtopc' - Displays the Balljump Top.
say '/bjtoph' or 'bjtoph' - Displays the Balljump Height Top.
say '/bjtopd' or 'bjtopd' - Displays the Balljump Distance Top.
- MySQL -

For this plugin to work you must create a database named "soccerjam" or whatever name you changed bj_database to. If you don't know how to create a database, i suggest you search google. Use "127.0.0.1" instead of localhost if you use linux. Don't forget to set your MySQL password in amxx.cfg:

Quote:
bj_password "pass123" ; Put your password in ""(quotes).
Use "127.0.0.1" instead of localhost if you use linux.

- Installing -

Remember to put the contents of files.zip into your servers ctrike folder.

- Screen Shots -

Pay attention only to Ball Jump releated stuff. First 2 shows what BallJump is.

[IMG]http://img99.**************/img99/2849/scr1g.th.jpg[/IMG]
[IMG]http://img91.**************/img91/1968/scr2e.th.jpg[/IMG]

These 2 shows how Tutor stats look like.
[IMG]http://img111.**************/img111/8532/scr3s.th.jpg[/IMG]
[IMG]http://img259.**************/img259/5420/scr4o.th.jpg[/IMG]

Chat message stats.
[IMG]http://img232.**************/img232/7947/scr5.th.jpg[/IMG]

Hudmessage stats.
[IMG]http://img128.**************/img128/1754/scr6x.th.jpg[/IMG]

Beams:
[IMG]http://img148.**************/img148/5766/scr7h.th.jpg[/IMG]

Top:
[IMG]http://img218.**************/img218/5598/scr8.th.jpg[/IMG]

- Change Log -


Code:
0.7.0
* Initial Release

0.7.1
* Optimised code

0.7.2
* Optimised code
* Fixed some minor bugs
* Added a cvar to change the tutors style if player made a good jump
* Now it'll show if you've jumped over a player with a balljump
* Now it counts and shows BallJumps and Air Time in top and stats
* Changed some messages
* Fixed the bug when FAILED Bj's are still writen into stats
* Fixed the bug when you could BJ on someones head.. run on it, then jump off and get amazing distances

0.7.3
* Fixed the bug when sometimes you make 1+ BJ's but it still shows 1bj.
* Edited some messages
* Now after your jump it shows a beam where you jumped(like kz jumpstats).
* Fixed the distance bug, if you BJ forward and then back your distance wont be correct.
* Fixed the bug when the round restarts while you're in BJ and you get amazing distances.
* Added Cvars for beam.

1.0.0
* Recoded the plugin. I didn't edit it, i recoded the whole plugin from nothing.
* Made a new balljump detection method, hasn't failed me yet.
* Changed SQL cvar names.
* Changed messages.
* Changed the style/design of top15 and stats. I really don't want to make screens
for everything again, just download and see for yourself.
* That's all, just the old method didn't work well, sometimes it didn't catch double balljumps
and stuff, so i had to recode it, that was an awful method i used before, this one is less
resource eating.

1.0.1
* Fixed the bug when you jump on net or any player and get impossible distances and bj counts.
Attached Files
File Type: zip files.zip (8.0 KB, 3062 views)
File Type: sma Get Plugin or Get Source (sjbjs.sma - 5201 views - 30.5 KB)

Last edited by shine771; 07-31-2009 at 08:50.
shine771 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-30-2009 , 17:04   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #2

NJ.

i need db
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
shine771
Senior Member
Join Date: Jun 2007
Old 04-30-2009 , 17:05   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #3

Link
shine771 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-30-2009 , 17:06   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #4

Quote:
Originally Posted by shine771 View Post
lol i know how to install db. i need a root now
__________________

Last edited by One; 04-30-2009 at 17:12.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-30-2009 , 17:07   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #5

nodb version?
__________________
xPaw is offline
shine771
Senior Member
Join Date: Jun 2007
Old 04-30-2009 , 17:07   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #6

Installing MySQL you can choose your primary user. By default it's root.

@ pwn - I could make a nVault one...
shine771 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-30-2009 , 17:09   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #7

Quote:
Originally Posted by shine771 View Post
Installing MySQL you can choose your primary user. By default it's root.

@ pwn - I could make a nVault one...
lol? i meant root server. i dont have any problems with username/pass or what ever else.

i meant just the same what xpaw said
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-30-2009 , 17:36   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #8

No need for vault, just make your MySQL stuff SQLite compatible.


Other stuff:

- Use formatex where applicable
- No SteamId support?
PHP Code:
for(id 0id MAXPLAYERSid++) 
->
PHP Code:
for(id 1id MAXPLAYERSid++) 
(also you should store get_maxplayers() for this)
- There are multiple cases where you should store the output of functions instead of calling them multiple times in a row.
- Use a global buffer for query formatting.
- Why do you pass id's as a string when using ThreadQuery?
PHP Code:
Message[3048
Not only is this completely unnecessary (you never get even close to this length) but it is also impossible due to engine limitations. The max for MOTD is fixed around 1500-1600 I believe.
__________________
In Flames we trust!

Last edited by Nextra; 04-30-2009 at 17:49.
Nextra is offline
shine771
Senior Member
Join Date: Jun 2007
Old 04-30-2009 , 18:16   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #9

If you haven't noticed, i don't think with my head while coding plugins.

First 20minutes i was thinking where i'm putting format and where formatex.. after that i was putting only format.
No SteamID support yet.

I wont change anything about maxplayers. It's fine as it is.

Quote:
- There are multiple cases where you should store the output of functions instead of calling them multiple times in a row.
Give me 3 examples.

Quote:
- Why do you pass id's as a string when using ThreadQuery?
As i told you, i wasn't thinking with my head when i wrote it. Fixed...
Quote:
Message[3048]
Haha. It was 1024 or 4096, i cant remember. 1024 was enough in my case.

Updated. Thanks .
shine771 is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-30-2009 , 18:38   Re: [Soccerjam] Ball Jump Stats
Reply With Quote #10

Quote:
Originally Posted by shine771 View Post
No SteamID support yet.
Imho Steam comes first, but thats your choice.

Quote:
Originally Posted by shine771 View Post
I wont change anything about maxplayers. It's fine as it is.
Your choice to not do that, but it's a small change and may be worth it due to it being used in frequently called functions. Your should also store is_user_connected on putinserver, just seeing that.


Quote:
Originally Posted by shine771 View Post
Give me 3 examples.
- Everything that has to do with get_gametime in PlayerCmdStart.
- PlayerCmdStart could possibly be optimized to not create 2 traces not do all that origin stuff twice (is possible in worst case as I see it).
- In Handler_Think you get pev_origin twice, no reason to do that.


Quote:
Originally Posted by shine771 View Post
As i told you, i wasn't thinking with my head when i wrote it.
You should probably do that ;) But thats what we are here for.
Another thing I just spotted:
PHP Code:
    new Name[33]
    
    
SQL_ReadResult(Query,1,Name,32
You don't use the name so leave that out (maybe also change the query according to that).
Quote:
Originally Posted by shine771 View Post
Updated. Thanks .
No problem.
__________________
In Flames we trust!
Nextra 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 09:45.


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