AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Score (https://forums.alliedmods.net/showthread.php?t=221942)

Randomize 07-28-2013 07:37

Score
 
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 :D

Black Rose 07-28-2013 08:11

Re: Score
 
first, second, third and so on is never set. So they are all 0.

Randomize 07-28-2013 08:32

Re: Score
 
How to set it?

Black Rose 07-28-2013 08:38

Re: Score
 
Well I don't even know what you're using them for. It's your plugin.
What is first? first what?

Randomize 07-28-2013 08:48

Re: Score
 
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

Black Rose 07-28-2013 09:12

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

Randomize 07-28-2013 09:21

Re: Score
 
Just Kill and Death like default scoreboard do.

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

Black Rose 07-28-2013 10:01

Re: Score
 
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; }

Randomize 07-28-2013 10:06

Re: Score
 
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 07-28-2013 10:10

Re: Score
 
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.


All times are GMT -4. The time now is 15:51.

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