Jump to content

Multiplication


kheelo

Recommended Posts

on *:SIGNAL:mta.finish: {
 var %rank = $mta.rank($1,$2)
 if (%rank == 1) {
   mta.text $1 $mta.nick($1,$2) finished first, points earned: 1 * $mta.server($1).players
   !writeini -n " $+ $scriptdir $+ points.ini" POINTS $mta.nick($1,$2) $calc($iif($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),$readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),0) + 1 * $mta.server($1).players)
 }

How to make it work so it multiplies 1 * number of players?

edit:acutally it saves points correctly but if i win it tells : kheelo finished first, points earned: 1 * $mta.server($1).players

=/

Link to comment
on *:SIGNAL:mta.finish: {
 var %rank = $mta.rank($1,$2)
 if (%rank == 1) {
   mta.text $1 $mta.nick($1,$2) finished first, points earned: 1 * $mta.server($1).players
   !writeini -n " $+ $scriptdir $+ points.ini" POINTS $mta.nick($1,$2) $calc($iif($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),$readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),0) + 1 * $mta.server($1).players)
 }

How to make it work so it multiplies 1 * number of players?

edit:acutally it saves points correctly but if i win it tells : kheelo finished first, points earned: 1 * $mta.server($1).players

=/

try this

on *:SIGNAL:mta.finish: {
%players = $mta.server($1).players
 var %rank = $mta.rank($1,$2)
 if (%rank == 1) {
   mta.text $1 $mta.nick($1,$2) finished first, points earned: $calc(1 * %players)
   !writeini -n " $+ $scriptdir $+ points.ini" POINTS $mta.nick($1,$2) $calc($iif($readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),$readini($scriptdir $+ points.ini,POINTS,$mta.nick($1,$2)),0) + $calc(1 * %players))
 }

havent tested it tho :D

Link to comment
  • Recently Browsing   0 members

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