CoZ Posted August 4, 2006 Share Posted August 4, 2006 (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 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 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 ... thanks for the help Edited August 4, 2006 by Guest Link to comment
lil Toady Posted August 4, 2006 Share Posted August 4, 2006 (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 August 4, 2006 by Guest Link to comment
CoZ Posted August 4, 2006 Author Share Posted August 4, 2006 tnx so far but either the on mta death part doesnt work in your version either or its just really stuborn Link to comment
lil Toady Posted August 4, 2006 Share Posted August 4, 2006 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 Link to comment
Recommended Posts