Jump to content

current deaths for deathlimit


CoZ

Recommended Posts

Posted (edited)

i like the deathlimit from tommis script

but i always minded it wasnt easy to see the current total of deaths for a map so you could be prepared for it a bit

ive tried to make this

but i cant figure out if im doing something wrong or this is just impossible :D

ps .. i tried the alias with calling gus.mapdeath($1, $2) and without $2 as shown below but that didnt solve it

the creating of mapname in ini file works

but the adding to it doesnt work.

its probably a simple typo i cant find :D

on *:SIGNAL:mta.startrace: {
 ;Parameters:
 ;$1 = Server
 ;$2 = Race ID
 ;$3 = 0/1/2 (success,failed,no players)
 !writeini -n " $+ $scriptdir $+ currentdeaths.ini" MAPDEATHS $mta.race($1) 0
}

on *:SIGNAL:mta.death: {
;Parameters:
;$1 = Server
;$2 = ID
!writeini -n " $+ $scriptdir $+ currentdeaths.ini" MAPDEATHS $mta.race($1) $gus.add($gus.mapdeaths($1),1)
}

alias gus.mapdeaths {
 if ($readini($scriptdir $+ currentdeaths.ini,MAPDEATHS,$mta.race($1)) != $null) !return $readini($scriptdir $+ currentdeaths.ini,MAPDEATHS,$mta.race($1))
 else !return 0
}



on *:SIGNAL:mta.command: {
[snip / dont say its the elseif]

 elseif ($3 == !currentdeath || $3 == !currentdeaths ) {
   if ( $mta.race(1) == Unknown) {
   mta.text $1 Unknown map .. Deathlimit: 25 }
   else mta.text $1 $readini($scriptdir $+ currentdeath.ini,MAPDEATHS,$mta.race($1)) deaths on this map. Deathlimit: $gus.deathlimit($1,$2) 
 }

[snip]
}

if this is solved i would like to have a automessage

like

if ($readini($scriptdir $+ instructions.ini,DEATHLIMIT,$replace($mta.race($1),$chr(32),)) != $null && $readini($scriptdir $+ instructions.ini,DEATHLIMIT,$replace($mta.race($1),$chr(32),)) != default) {
 if ($readini($scriptdir $+ instructions.ini,DEATHLIMIT,$replace($mta.race($1),$chr(32),)) <= %deaths) {
   mta.text $1 Death Limit Reached Changing To A Random Map
   mta.startrace $1 $rand(0,$mta.races($1))
 }

but then something like

mta.text $1 Death limit : 5 deaths left

but ... :D

thanks for the help :)

Edited by Guest

coz_sig_oob.png

Server Blog | Server quickinfo

STFU and dont bug the mta team with ''when is DM comming''

or risk theyre spending more time explaining they're still working on DM than actually getting work done :shock:

Posted (edited)

im not good at MTA:SA scripting as i dont play it, but try this

on *:SIGNAL:mta.death: {
 ;Parameters:
 ;$1 = Server
 ;$2 = ID
 !writeini -n " $+ $scriptdir $+ currentdeaths.ini" MAPDEATHS $replace($mta.race($1),$chr(32),$chr(45)) $gus.add($gus.mapdeaths($1),1)
}
on *:SIGNAL:mta.startrace: {
 ;Parameters:
 ;$1 = Server
 ;$2 = Race ID
 ;$3 = 0/1/2 (success,failed,no players)
 !writeini -n " $+ $scriptdir $+ currentdeaths.ini" MAPDEATHS $replace($mta.race($1),$chr(32),$chr(45)) 0
}
on *:SIGNAL:mta.death: {
 ;Parameters:
 ;$1 = Server
 ;$2 = ID
 !writeini -n " $+ $scriptdir $+ currentdeaths.ini" MAPDEATHS $replace($mta.race($1),$chr(32),$chr(45)) $gus.add($gus.mapdeaths($1),1)
}
alias gus.mapdeaths !return $iif($readini($scriptdir $+ currentdeaths.ini,MAPDEATHS,$replace($mta.race($1),$chr(32),$chr(45))),$v1,0)

on *:SIGNAL:mta.command: {
 if (!currentdeath* iswm $3) {
   if ( $mta.race(1) == Unknown) mta.text $1 Unknown map .. Deathlimit: 25
   else mta.text $1 Deaths on the map: $gus.mapdeaths($1) $+ . Deathlimit: $gus.deathlimit($1) $+ . $calc($gus.deathlimit($1) - $gus.mapdeaths($1)) deaths left.
 }
}

Edited by Guest

Do not PM me, im not going to read it anyway.

Posted

tnx so far

but either the on mta death part doesnt work in your version either

or its just really stuborn :o

coz_sig_oob.png

Server Blog | Server quickinfo

STFU and dont bug the mta team with ''when is DM comming''

or risk theyre spending more time explaining they're still working on DM than actually getting work done :shock:

Posted

i've edited my prev post, try now. I think the prob was cause $mta.race($1) can have few words in it, you cant write an ini with few words in the first argument. thats why i did $replace($mta.race($1),$chr(32),$chr(45)) that will replace all the spaces with - sign

If that still doesnt work give me the alias of gus.add and gus.deathlimit

Do not PM me, im not going to read it anyway.

  • Recently Browsing   0 members

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