Raised This Month: $ Target: $400
 0% 

Scoring system and database


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Whitez
Member
Join Date: Apr 2016
Location: London, UK
Old 06-06-2016 , 14:38   Scoring system and database
Reply With Quote #1

I am planning to create a custom score system with ranking and top for a zombie plague server

Now the deal is that i want to not use the general score of counter strike, but instead to use my own

First, i want to disable deaths, and set the custom score i want on the score board

I know how to, but i do not know when the score board is usually updated with the frags / deaths in order to remove the frags and add my own score there

So first i need to know when the score board's Frags / Deaths are updated, i think they are updated when the Death Message and HLTV are called but i am not sure if it is not called and on other events

Secondly, i would like to know what data base would be recommended to store the score and create ranking ( based mainly on score ), top ( based mainly on score ) and stats with kills, deaths, score, damage

Last edited by Whitez; 06-06-2016 at 15:20.
Whitez is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-06-2016 , 14:48   Re: When is Scoreboard updated?
Reply With Quote #2

Probably at ScoreInfo.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Whitez
Member
Join Date: Apr 2016
Location: London, UK
Old 06-06-2016 , 14:56   Re: When is Scoreboard updated?
Reply With Quote #3

I mean the Kills / Deaths on it

//Main post updated

Last edited by Whitez; 06-06-2016 at 15:21.
Whitez is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-06-2016 , 16:09   Re: Scoring system and database
Reply With Quote #4

That's exactly what I'm talking about. Simply register the event:

PHP Code:
register_event("ScoreInfo""update_scoreboard""a"
... and change the frags/deaths every time the event is called. You may want to add a little delay (0.1), I believe I was having problems without one.

PHP Code:
public update_scoreboard()
{
    static 
id
    id 
read_data(1)
    
    
set_task(0.1"set_scoreboard"id)
}

public 
set_scoreboard(id)
{
    if(
is_user_connected(id))
    {
        
set_user_frags(idpoints[id])
        
cs_set_user_deaths(idlevel[id])
    }

OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 16:55.


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