Forum

> > CS2D > Scripts > Top player score script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Top player score script

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Top player score script

Joni And Friends
User Off Offline

Zitieren
Could anyone help me for make "The top player score" script for me? i want that script for my server..

> Description script
I want that script using server message for show the Top Player score every minute, The top player score is who have highest score than other playes in server, the score is not score in player data server but score in showing on TAB

Sorry for bad in english
1× editiert, zuletzt 05.07.15 06:55:07

alt Re: Top player score script

Rainoth
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
addhook("minute","a")
function a()
local highest = 0
local id = 0
	for k,v in pairs (player(0,"table")) do
		if player(v,"score")>highest then
			highest = player(id,"score")
			id = v
		end
	end
	msg("Player "..player(id,"name").." has the highest score of "..highest)
end

Hope I didn't screw up anything

alt Re: Top player score script

Joni And Friends
User Off Offline

Zitieren
Its not work user Rainoth,have error in this line
1
LUA ERROR: sys/lua/server.lua:11: attempt to concatenate a boolean value

Thanks for reply my topic and help me for making the script, i has fix it and now it work. This the code i fixing

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
s=0
h=0
addhook("minute","_s")
function _s()
for _,id in pairs (player(0,"table")) do
        if player(id,"score")>s and player(id,"score")>0 then
               s=player(id,"score")
               h=id
          end
   end
if h>0 and player(h,"exists") then
            msg("higest is "..player(h,"name").." with score "..player(h,"score"))
     return 1
         elseif not player(h,"exists") then
             h=0
             s=0
     end
end
6× editiert, zuletzt 06.11.14 04:49:31
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht