Jump to content

User Rank Script


Greg0rz

Recommended Posts

  • 1 month later...
I used lil Toady's script and made this one out of it:
on *:SIGNAL:mta.finish: {
 if ($mta.rank($1,$2) <= 5 && $mta.server($1).players >= 2) {
   var %score = $replace($mta.rank($1,$2),1,5,2,4,3,3,4,2,5,1)
   var %position = $replace($mta.rank($1,$2),1,first,2,second,3,third,4,fourth,5,fifth)
   mta.text $1 $mta.nick($1,$2) came %position $+ and earned %score points!
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.ip($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,$2)),$calc($v1 + %score),%score)
 }
 elseif ($mta.rank($1,$2) <= 5 && $mta.server($1).players == 1) {
   mta.text $1 Playing alone earned you 2 points!
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.ip($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,$2)),$calc($v1 + 2),2)
 }
}

for some reason on my server, 1st gets 1 pt, 2nd gets 2 pts, 3rd get 3 pts, so on... can you fix this ?

Link to comment
on *:SIGNAL:mta.finish: {
 if (($mta.rank($1,$2) <= 5) && ($mta.server($1).players >= 2)) {
   var %score = $replacex($mta.rank($1,$2),1,5,2,4,3,3,4,2,5,1) 
   var %position = $replace($mta.rank($1,$2),1,first,2,second,3,third,4,fourth,5,fifth)
   mta.text $1 $mta.nick($1,$2) came %position $+ and earned %score points!
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.ip($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,$2)),$calc($v1 + %score),%score)
 }
 elseif ($mta.server($1).players == 1) {
   mta.text $1 Playing alone earned you 2 points!
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.ip($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,$2)),$calc($v1 + 2),2)
 }
}

Link to comment

just search the topic! :evil:

Fixed points giving script! :arrow:

on *:SIGNAL:mta.finish: {
 if (($mta.rank($1,$2) <= 5) && ($mta.server($1).players >= 2)) {
   var %score = $replacex($mta.rank($1,$2),1,5,2,4,3,3,4,2,5,1) 
   var %position = $replace($mta.rank($1,$2),1,first,2,second,3,third,4,fourth,5,fifth)
   mta.text $1 $mta.nick($1,$2) came %position $+ and earned %score points!
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.ip($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,$2)),$calc($v1 + %score),%score)
 }
 elseif ($mta.server($1).players == 1) {
   mta.text $1 Playing alone earned you 2 points!
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.ip($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,$2)),$calc($v1 + 2),2)
 }
}

!points script :arrow:

on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2)
 if ($3 == !points) {
   if (%a == -1) mta.text $1 Error - Absent ID
   else mta.text $1 $mta.nick($1,%a) has $iif($readini($scriptdir $+ points.ini,POINTS,$mta.ip($1,%a)),$v1,no) points.
 }
}

Link to comment
on *:SIGNAL:mta.command:{ 
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2) 
 if ($3 == !rank) { 
 if ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 1000) mta.text $1 $mta.nick($1,$2) has the title of Ultimate User! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 20000) mta.text $1 $mta.nick($1,$2) has title of The best !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 18000) mta.text $1 $mta.nick($1,$2) has title of Space ship ! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 16000) mta.text $1 $mta.nick($1,$2) has title of Rocket !!!
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 14000) mta.text $1 $mta.nick($1,$2) has title of Champion !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 12000) mta.text $1 $mta.nick($1,$2) has title of Co2 feen !!!
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 10000) mta.text $1 $mta.nick($1,$2) has title of Speedking !!!
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 8000) mta.text $1 $mta.nick($1,$2) has title of F1 pilot !!!
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 6000) mta.text $1 $mta.nick($1,$2) has title of Server addict !
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 4000) mta.text $1 $mta.nick($1,$2) has title of Burnout king ! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 2000) mta.text $1 $mta.nick($1,$2) has title of Dedicated Driver
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 1400) mta.text $1 $mta.nick($1,$2) has title of Road king !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 900) mta.text $1 $mta.nick($1,$2) has title of Track addict !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 600) mta.text $1 $mta.nick($1,$2) has title of Pro driver !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 400) mta.text $1 $mta.nick($1,$2) has title of Exellent driver !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 250) mta.text $1 $mta.nick($1,$2) has title of Drift king !!!
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 150) mta.text $1 $mta.nick($1,$2) has title of Street racer !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 100) mta.text $1 $mta.nick($1,$2) has title of Road Kill !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 60) mta.text $1 $mta.nick($1,$2) has title of Sunday driver !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 25) mta.text $1 $mta.nick($1,$2) has title of Novice !!! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 1) mta.text $1 $mta.nick($1,$2) has title of Rookie !!! 
 else mta.text $1 $mta.nick($1,$2) has no rank! 
}

Couldn't find? that was on the prev page ^.. a little bit wrong but just changing this:

  if ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 1000) mta.text $1 $mta.nick($1,$2) has the title of Ultimate User! 
 elseif ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 20000) mta.text $1 $mta.nick($1,$2) has title of The best !!! 

to

if ($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)) >= 20000) mta.text $1 $mta.nick($1,$2) has title of The best !!!

and putting one more } bracket in the end will fix the prob!

Don't be a lazy f*cker.. im not gonna help with stuff like that any more, just search or learn at least some simple scripting :evil: I never asked for help here when i was starting

Link to comment
  • 1 month later...

Hey,

I just started using this !rank script along with the !points script further up.

I have a problem where anytime i type !rank i get you have no rank!

Does this read the points from the points.ini file for the !points script because if it is its not doing it.

Ive tried everything i know to sort it to no avail.

Any ideas?

cheers in advance :)

Link to comment

hmm.. i really like this script that wallnutty scripted i really want it on my server but i want a little change so i don't want to have it like it reads points but i want that it reads stats.ini WINS so i'm going to edit it but when i place it in the script it does not work maybe i scripted it wrong or i'm just very stupid to place it at the wrong place :n00b:

this is what i edited of the scripted:

on *:SIGNAL:mta.command:{ 
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2) 
 if ($3 == !rank) { 
 if ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 20000) mta.text $1 $mta.nick($1,$2) has title of The best !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 18000) mta.text $1 $mta.nick($1,$2) has title of Space ship ! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 16000) mta.text $1 $mta.nick($1,$2) has title of Rocket !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 14000) mta.text $1 $mta.nick($1,$2) has title of Champion !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 12000) mta.text $1 $mta.nick($1,$2) has title of Co2 feen !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 10000) mta.text $1 $mta.nick($1,$2) has title of Speedking !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 8000) mta.text $1 $mta.nick($1,$2) has title of F1 pilot !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 6000) mta.text $1 $mta.nick($1,$2) has title of Server addict ! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 4000) mta.text $1 $mta.nick($1,$2) has title of Burnout king ! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 2000) mta.text $1 $mta.nick($1,$2) has title of Dedicated Driver 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 1400) mta.text $1 $mta.nick($1,$2) has title of Road king !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 900) mta.text $1 $mta.nick($1,$2) has title of Track addict !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 600) mta.text $1 $mta.nick($1,$2) has title of Pro driver !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 400) mta.text $1 $mta.nick($1,$2) has title of Exellent driver !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 250) mta.text $1 $mta.nick($1,$2) has title of Drift king !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 150) mta.text $1 $mta.nick($1,$2) has title of Street racer !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 100) mta.text $1 $mta.nick($1,$2) has title of Road Kill !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 60) mta.text $1 $mta.nick($1,$2) has title of Sunday driver !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 25) mta.text $1 $mta.nick($1,$2) has title of Novice !!! 
 elseif ($readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,$2)) >= 1) mta.text $1 $mta.nick($1,$2) has title of Rookie !!! 
 else mta.text $1 $mta.nick($1,$2) has no rank! 
}
}

i hope some one could tell me what i did wrong.

thanks Robert4392

Link to comment

on *:SIGNAL:mta.command:{

var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2)

if ($3 == !rank) {

var %rank = $readini($scriptdir $+ stats.ini,WINS,$mta.nick($1,%a)),%b

if (%rank >= 20000) %b = The best

elseif (%rank >= 18000) %b = Space ship

elseif (%rank >= 16000) %b = Rocket

elseif (%rank >= 14000) %b = Champion

elseif (%rank >= 12000) %b = Co2 feen

elseif (%rank >= 10000) %b = Speedking

elseif (%rank >= 8000) %b = F1 pilot

elseif (%rank >= 6000) %b = Server addict

elseif (%rank >= 4000) %b = Burnout king

elseif (%rank >= 2000) %b = Dedicated Driver

elseif (%rank >= 1400) %b = Road king

elseif (%rank >= 900) %b = Track addict

elseif (%rank >= 600) %b = Pro driver

elseif (%rank >= 400) %b = Exellent driver

elseif (%rank >= 250) %b = Drift king

elseif (%rank >= 150) %b = Street racer

elseif (%rank >= 100) %b = Road Kill

elseif (%rank >= 60) %b = Sunday driver

elseif (%rank >= 25) %b = Novice

elseif (%rank >= 1) %b = Rookie

else %b = Un-Ranked

mta.text $1 $mta.nick($1,%a) Has The Rank Of: %b

}

}

not sure what the exact problem was robert, but try this.

Link to comment
thanks scooby i will try this i hope it will work if it does not work it looks like i put it at the wrong place :lol:

EDIT:

yeah! :D it works now thanks very much :)

Well nice to hear u got it working. Any other questions/problems, feel free to ask away :)

Link to comment
  • 1 month later...

I edited this script for personal requirements and something is wrong sometimes and I don't know what - can you help me?

I wonted that this script write to file also number of race - and then I calc the avarge points per race, I do this that:

on *:SIGNAL:mta.finish: { 
 if (($mta.rank($1,$2) <8>= 2)) {
   var %waga = $readini($scriptdir $+ mappoints.ini,POINTS,$mta.race($1))
   var %points = $replacex($mta.rank($1,$2),1,10,2,8,3,6,4,5,5,4,6,3,7,2,8,1)
   var %score = %waga * %points 
   var %position = $replace($mta.rank($1,$2),1,first,2,second,3,third,4,fourth,5,fifth,6,sixth,7,seventh,8,eight) 
   mta.text $1 $mta.nick($1,$2) came %position $+  and earned %score points! 
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.nick($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),$calc($v1 + %score),%score)
   !writeini " $+ $scriptdir $+ points.ini" RACE $mta.nick($1,$2) $iif($readini($scriptdir $+ points.ini,RACE,$mta.nick($1,$2)),$calc($v1 + 1),1)  
 } 
 elseif ($mta.server($1).players == 1) {
   var %wagalonly = $readini($scriptdir $+ mappoints.ini,LONLY,$mta.race($1))
   var %score = %wagalonly * 2 
   mta.text $1 Playing alone earned you %score points! 
   !writeini " $+ $scriptdir $+ points.ini" POINTS $mta.nick($1,$2) $iif($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),$calc($v1 + %score),%score) 
   !writeini " $+ $scriptdir $+ points.ini" RACE $mta.nick($1,$2) $iif($readini($scriptdir $+ points.ini,RACE,$mta.nick($1,$2)),$calc($v1 + 1),1)
 } 
}

Sometime script do something wrong! For example:

in file points.ini

[POINTS]
Leito.PL=120
kornik_pl=24
~2RT~acp___(PL)=50
Maciek~pl~=8
Wojak~PL~=57
47=49
Gang$tah{NL055}=Noon * 8
[RACE]
Leito.PL=18
kornik_pl=3
~2RT~acp___(PL)=4
Maciek~pl~=1
Wojak~PL~=6
47=3
Gang$tah{NL055}=1

Gang$tah{NL055}=Noon * 8

sometime don't wont to write update points in file

To executed I use this commend:

on *:SIGNAL:mta.command:{ 
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2)
 var %b = $iif($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),$v1,0)
 var %c = $iif($readini($scriptdir $+ points.ini,RACE,$mta.nick($1,$2)),$v1,1)
 var %d = %b / %c
 if ($3 == !points) { 
   if (%a == -1) mta.text $1 Error - Absent ID 
   else mta.text $1 $mta.nick($1,%a) has $iif($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),$v1,no) points in $iif($readini($scriptdir $+ points.ini,RACE,$mta.nick($1,$2)),$v1,no) race.
   mta.text $1 Average $round(%d,2) points per race.
 } 
}

I use also file with the waga of the map: mappoints.ini

[POINTS]
Fast-Ways=1
sc.airkart=1
~TR~Nascar=1
Land_Sea_and_Air=2
Holy-Harley=1
PP=1
Blow-the-Dam=1
Taxi-Drver=1
~TR~FlatBed=2
Errand=1
DROPOUT2=1
~TR~LowrideRace=1
Bobcat-BLASTAround=1
Dock-Bikes=1
Boating-BLASTAround=1
A-Walk-in-the-Park=1
Rural-Run=1
SFsunrise300=1
[LONLY]
Fast-Ways=1
sc.airkart=1
~TR~Nascar=1
Land_Sea_and_Air=2
Holy-Harley=1
PP=1
Blow-the-Dam=1
Taxi-Drver=1
~TR~FlatBed=3
Errand=1
DROPOUT2=1
~TR~LowrideRace=2
Bobcat-BLASTAround=1
Dock-Bikes=1
Boating-BLASTAround=1
A-Walk-in-the-Park=1
Rural-Run=1
SFsunrise300=1

I save this to file points.mrc

I use also: mta.dialog and mtagus.mrc

PLEASE HELP ME

Link to comment

sorry im kinda busy to repost the lot, but basically at a quick glance looks like ur doing ur calculation lines wrong.

U need to use $calc(calculation)

eg: var %score = %waga * %points

would be: var %score = $calc(%waga * %points)

hope this helps.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...