Jump to content

Problems with a read .ini script


Recommended Posts

Hi guys, I would like to have the following script working:

on *:SIGNAL:mta.command:{ 
 ;Parameters:
 ;$1 = Server
 ;$2 = Race ID
 ;$3 = 0/1/2 (success,failed,no players)
 var %a = $calc($readini($scriptdir $+ mta.stats.ini,n,$mta.races($1,$2),times) + 1),%b = $calc($readini($scriptdir $+ mta.stats.ini,n,ALL,times) + 1)
 if ($3 == !mod) {
   if ($mta.race($1) == Unknown) mta.pm $1 $2 Error - Unknown Race
   else {
     mta.text $1 Current Map: $mta.race($1)
     mta.text $1 /me Moderated by: $readini($scriptdir $+ instructions.ini,MOD,$replace($mta.races($1,$2),$chr(32),))
   }
 }
}

It has to read something in instructions.ini under [MOD] the names are stored in the right way but I can't get them in mta.text... Can someone help me? Tryed everything Thnx

Link to comment
Hi guys, I would like to have the following script working:

on *:SIGNAL:mta.command:{ 
 ;Parameters:
 ;$1 = Server
 ;$2 = Race ID
 ;$3 = 0/1/2 (success,failed,no players)
 var %a = $calc($readini($scriptdir $+ mta.stats.ini,n,$mta.races($1,$2),times) + 1),%b = $calc($readini($scriptdir $+ mta.stats.ini,n,ALL,times) + 1)
 if ($3 == !mod) {
   if ($mta.race($1) == Unknown) mta.pm $1 $2 Error - Unknown Race
   else {
     mta.text $1 Current Map: $mta.race($1)
     mta.text $1 /me Moderated by: $readini($scriptdir $+ instructions.ini,MOD,$replace($mta.races($1,$2),$chr(32),))
   }
 }
}

It has to read something in instructions.ini under [MOD] the names are stored in the right way but I can't get them in mta.text... Can someone help me? Tryed everything Thnx

on *:SIGNAL:mta.startrace:{ 
 ;Parameters:
 ;$1 = Server
 ;$2 = Race ID
 ;$3 = 0/1/2 (success,failed,no players)
 var %a = !writeini -n " $+ $scriptdir $+ mta.stats.ini" times $calc(times+1),%b = $readini($scriptdir $+ mta.stats.ini,ALL,$ini($scriptdir $+ mta.stats.ini,ALL,%b)))
   if ($mta.race($1) == Unknown) mta.pm $1 $2 Error - Unknown Race
   else {
     mta.text $1 Current Map: $mta.race($1)
     mta.text $1 /me Moderated by: $readini($scriptdir $+ instructions.ini,MOD,$replace($mta.races($1,$2),$chr(32),))
   }

Not tested, but should works fine.

Link to comment

u say the instructions are already in the file?

and ur sure this is the right location?

$readini($scriptdir $+ instructions.ini,MOD,$replace($mta.races($1,$2),$chr(32),))

(looks wrong to me but im just guessing)

if so, use this:

on *:SIGNAL:mta.startrace:{ 
 mta.text $1 $iif($readini($scriptdir $+ instructions.ini,MOD,$replace($mta.races($1,$2),$chr(32),)) == $null,No Details Stored,Current Map: $mta.race($1) - Moderated by: $v1)
}

Link to comment
woops yeh, maybe it is wrong... Ive got instructions.ini, in the map is the mapname stored like: High into the sky=Test

When they do ! they have to see the text behind the map, how do i do that? :S

if ($3 == !instructions) mta.text $1 $iif($readini($scriptdirinstructions.ini,mod,$replace($mta.race($1),$chr(32),)) == $null,No Details Stored,Current Map: $mta.race($1) - Details: $v1)

Link to comment
  • Recently Browsing   0 members

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