Forum

> > CS2D > Scripts > "1st,2nd,3rd,...." script
Forums overviewCS2D overview Scripts overviewLog in to reply

English "1st,2nd,3rd,...." script

4 replies
To the start Previous 1 Next To the start

old "1st,2nd,3rd,...." script

loldlold123
User Off Offline

Quote
EXEMPLE:

player 1 has 10 xcounter

player2 has 5 xcounter

player3 has 1 xcounter


if xcounter[id]>(other player's xcounter) then
parse('hudtxt2 '..id..' 1 "1st is Name:XXX " 0 50')

if xcounter[id]>(other player's xcounter) and xcounter[id]<1st player then
parse('hudtxt2 '..id..' 2 "2nd is Name:XX " 0 100')

if xcounter[id]<(other player's xcounter) then
parse('hudtxt2 '..id..' 3 "3rd is Name:XX " 0 150')

This is exemple,its not limited by 3 player...

i need this system can you help me?

old Re: "1st,2nd,3rd,...." script

archmage
User Off Offline

Quote
You could create a table that contains tables with the players info (id and xcounte

Untested.
More >


The function should return a table that contains tables. The first element is the players ID and the second element is that players xcounter.

The first index of the returned table contains the player with the lowest xcounter and the last contains the highest.

old Re: "1st,2nd,3rd,...." script

Apache uwu
User Off Offline

Quote
Ah find the largest or smallest value in an array.

It really gets you pissed when you find out Lua has very few variety of functions. A few string manipulations, system file system and try/catch/exception.

Best way is to write it out completely raw, then optimize it.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview