Raised This Month: $ Target: $400
 0% 

Score


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 07-28-2013 , 07:37   Score
Reply With Quote #1

I tried it with bots, but it only shows "Counter-Strike 0 0". How to get every player's id? I try to make custom Tabscore.

EDIT:
I've changed my code to be like this:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <acg>
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DavidJr"

new line[8][32]
static 
name[8][32]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /sb""score")
}
public 
client_PreThink(id)
{
    new 
frag get_user_frags(id)    
    new 
death get_user_deaths(id)
    
    
get_user_name(idname[0], 31)
    
get_user_name(idname[1], 31)
    
get_user_name(idname[2], 31)
    
get_user_name(idname[3], 31)
    
get_user_name(idname[4], 31)
    
get_user_name(idname[5], 31)
    
get_user_name(idname[6], 31)
    
get_user_name(idname[7], 31)
    
    
    
formatex(line[0], 31"%s %i %i"name[0], fragdeath)
    
formatex(line[1], 31"%s %i %i"name[1], fragdeath)
    
formatex(line[2], 31"%s %i %i"name[2], fragdeath)
    
formatex(line[3], 31"%s %i %i"name[3], fragdeath)
    
formatex(line[4], 31"%s %i %i"name[4], fragdeath)
    
formatex(line[5], 31"%s %i %i"name[5], fragdeath)
    
formatex(line[6], 31"%s %i %i"name[6], fragdeath)
    
formatex(line[7], 31"%s %i %i"name[7], fragdeath)
}  
public 
score(id)
{
    
    
acg_drawtext(id0.10.1line[0], 2552552552550.00.00.01TS_NONE001)
    
acg_drawtext(id0.10.2line[1], 2552552552550.00.00.01TS_NONE002)
    
acg_drawtext(id0.10.3line[2], 2552552552550.00.00.01TS_NONE003)
    
acg_drawtext(id0.10.4line[3], 2552552552550.00.00.01TS_NONE004)
    
acg_drawtext(id0.10.5line[4], 2552552552550.00.00.01TS_NONE005)
    
acg_drawtext(id0.10.6line[5], 2552552552550.00.00.01TS_NONE006)
    
acg_drawtext(id0.10.7line[6], 2552552552550.00.00.01TS_NONE007)
    
acg_drawtext(id0.10.8line[7], 2552552552550.00.00.01TS_NONE008)

It shows correctly, but all the hud names are same. Just like this:
RendyJr 10 0
RendyJr 10 0
RendyJr 10 0
RendyJr 10 0
RendyJr 10 0
RendyJr 10 0
RendyJr 10 0
RendyJr 10 0

if I typed /sb again, it shows different name kills and death but same like above

Last edited by Randomize; 07-28-2013 at 09:45.
Randomize is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-28-2013 , 08:11   Re: Score
Reply With Quote #2

first, second, third and so on is never set. So they are all 0.
__________________
Black Rose is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 07-28-2013 , 08:32   Re: Score
Reply With Quote #3

How to set it?
Randomize is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-28-2013 , 08:38   Re: Score
Reply With Quote #4

Well I don't even know what you're using them for. It's your plugin.
What is first? first what?
__________________
Black Rose is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 07-28-2013 , 08:48   Re: Score
Reply With Quote #5

I mean I just want to show the players who is on the top till the lowest in the tabscore to the hudmessage. I've looked at serverscore.sma but I don't get it because it uses vault
Randomize is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-28-2013 , 09:12   Re: Score
Reply With Quote #6

Ok, I understand.
How do you determine who is the best? Most kills? K/D ratio?
__________________

Last edited by Black Rose; 07-28-2013 at 09:12.
Black Rose is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 07-28-2013 , 09:21   Re: Score
Reply With Quote #7

Just Kill and Death like default scoreboard do.

EDIT: I've edited my code, check first post.

Last edited by Randomize; 07-28-2013 at 09:44.
Randomize is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-28-2013 , 10:01   Re: Score
Reply With Quote #8

It's because all the names you retrieve are from the same id:

Code:
    get_user_name(id, name[0], 31)     get_user_name(id, name[1], 31)     get_user_name(id, name[2], 31)     get_user_name(id, name[3], 31)     get_user_name(id, name[4], 31)     get_user_name(id, name[5], 31)     get_user_name(id, name[6], 31)     get_user_name(id, name[7], 31)

I'm not sure what "acg" is (please share), but here's my attempt at what you want:
Code:
#include <amxmodx> #include <cstrike> #include <acg> #define g_MaxPlayers 32 public plugin_init() {     register_plugin("Test Plugin 8", "", "");         register_clcmd("say /sb", "score") } public score(id) {         new iPlayers[32], iPlayersnum, text[64], name[32];         get_players(iPlayers, iPlayersnum, "c");     SortCustom1D(iPlayers, iPlayersnum, "SortFunc");         for ( new i = 0 ; i < iPlayersnum ; i++ ) {         get_user_name(iPlayers[i], name, 31);         formatex(text, 63, "%s %i %i", name, get_user_frags(iPlayers[i]), get_user_deaths(iPlayers[i]));         acg_drawtext(id, 0.1, 0.1, text, 255, 255, 255, 255, 0.0, 0.0, 0.0, 1, TS_NONE, 0, 0, 1);     } } public SortFunc(elem1, elem2) {     if ( get_user_frags(elem1) > get_user_frags(elem2) )         return -1;     else if ( get_user_frags(elem1) < get_user_frags(elem2) )         return 1;     else if ( get_user_deaths(elem1) < get_user_deaths(elem2) )         return -1;     else if ( get_user_deaths(elem1) > get_user_deaths(elem2) )         return 1;     return 0; }
__________________

Last edited by Black Rose; 07-28-2013 at 10:26.
Black Rose is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 07-28-2013 , 10:06   Re: Score
Reply With Quote #9

Okay I'll try it, I bet you won't be interested to ACG, even Arkshine said it uses poor way. xD But if you want to know more, here's the link: www.lolifun.net
Randomize is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 07-28-2013 , 10:10   Re: Score
Reply With Quote #10

Your code didn't work. I want to give you the SS but seem imageshack doesn't allow me, I just describe it.
Your code only shows "Counter-Strike 0 0" single line.

Last edited by Randomize; 07-28-2013 at 10:15.
Randomize 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 15:51.


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