MB|Lagzilla Posted October 19, 2007 Share Posted October 19, 2007 On map start I want to write every player in the servers nick to a ini is this possible? Link to comment
[UVA]Bart Posted October 19, 2007 Share Posted October 19, 2007 ye better to do it in hash but ye why you want to do that anyway ? Link to comment
MB|Lagzilla Posted October 19, 2007 Author Share Posted October 19, 2007 Crazy scheme Give an example of how to do it to an ini please? Link to comment
[UVA]Bart Posted October 19, 2007 Share Posted October 19, 2007 (edited) think that will work not tested it lol just wrote it in here on *:SIGNAL:mta.startrace: { if ($mta.server($1).players > 0) slr.addplayers $1- } alias slr.addplayers { var %a = 0 while (%a < $mta.server($1).cmax) { if ($mta.nick($1,%a) > $null) { !writeini -n slrplayers.ini players $mta.nick($1,%a) $mta.nick($1,%a) } !inc %a } } Edited October 19, 2007 by Guest Link to comment
MB|Lagzilla Posted October 19, 2007 Author Share Posted October 19, 2007 Hmm /writeini: insufficient parameters (line 8, Name Get All.mrc) Link to comment
MB|Lagzilla Posted October 19, 2007 Author Share Posted October 19, 2007 Would I be correct in saying it would need to be a loop? Link to comment
[UVA]Bart Posted October 19, 2007 Share Posted October 19, 2007 can you say what you need it for ? when you write a ini it stores the values like say todd=1 so to write that to ini you would do !writeini -n slrplayer.ini players todd 1 so i am writinig now with mine = but its storing all the players nicks on the start of a race, which i dont understand because it will get preaty full and you wont be able to store any more by the way i fixed the other one lol wrote it like i write hash but half ini and half hash Link to comment
lil Toady Posted October 19, 2007 Share Posted October 19, 2007 (edited) on *:SIGNAL:mta.startrace: { var %a = 0 !remove " $+ $scriptdir $+ players.ini" while (%a <= $mta.server($1).cmax) { if ($mta.nick($1,%a)) { !writeini " $+ $scriptdir $+ players.ini" players %a $mta.nick($1,%a) } !inc %a } } Edited October 19, 2007 by Guest Link to comment
MB|Lagzilla Posted October 19, 2007 Author Share Posted October 19, 2007 I'm having a crazy idea attempt at a more reliable wins script for gus... Link to comment
[UVA]Bart Posted October 19, 2007 Share Posted October 19, 2007 better speak to toady lol i no expert with gus but i had a go at it lol so it might be wrong on *:SIGNAL:mta.finish: { if (4 > $mta.rank($1,$2)) { mta.text $1 $mta.nick($1,$2) Position: $replace($mta.rank($1,$2),1,1st,2,2nd,3,3rd) - Time: $mta.time($1,$2).text if ($mta.rank($1,$2) == 1) { !writeini " $+ $scriptdir $+ playerswins.ini" players $mta.nick($1,$2) $+ 1 $calc($slr.pos($1,$2) + 1) } if ($mta.rank($1,$2) == 2) { !writeini " $+ $scriptdir $+ playerswins.ini" players $mta.nick($1,$2) $+ 2 $calc($slr.pos($1,$2) + 1) } if ($mta.rank($1,$2) == 3) { !writeini " $+ $scriptdir $+ playerswins.ini" players $mta.nick($1,$2) $+ 3 $calc($slr.pos($1,$2) + 1) } } } alias slr.pos !return $iif($readini($scriptdir $+ playerswins.ini,players,$mta.nick($1,$2) $+ $mta.rank($1,$2)) == $null,0,$v1) that will write the players name + there rank then count there wins like todd1=2 todd2=1 todd3=5 Link to comment
MB|Lagzilla Posted October 19, 2007 Author Share Posted October 19, 2007 Thanks but I'm not so sure about it... When all the players spawn there nick = 1 is added into the ini as they die it's change to there nick = 0 so as the 2nd to last player die's I want it to find the one that = 1 and display it.. not a clue how to do this bit.. Link to comment
[UVA]Bart Posted October 19, 2007 Share Posted October 19, 2007 basically you want to find the last one alive ? Link to comment
MB|Lagzilla Posted October 19, 2007 Author Share Posted October 19, 2007 Yes and the last one alive will be nick = 1.... var %a = 0,%b,%c,%d while (%a <= $ini(gus.commands.ini,COMMANDS,0)) { if ($gus.level($1,$2) >= $gus.cmdlevel($ini(gus.commands.ini,COMMANDS,%a))) { if (!%b) %b = $ini(gus.commands.ini,COMMANDS,%a) elseif ($len(%b) <= 200) %b = %b $+ , $ini(gus.commands.ini,COMMANDS,%a) elseif (!%c) %c = $ini(gus.commands.ini,COMMANDS,%a) elseif ($len(%c) <= 200) %c = %c $+ , $ini(gus.commands.ini,COMMANDS,%a) elseif (!%d) %d = $ini(gus.commands.ini,COMMANDS,%a) elseif ($len(%d) <= 200) %d = %d $+ , $ini(gus.commands.ini,COMMANDS,%a) } !inc %a } if (%b) { gus.pm $1 $2 Current Level $gus.level($1,$2) Commands gus.pm $1 $2 %b if (%c) .timer 1 2 gus.pm $1 $2 %c if (%d) .timer 1 4 gus.pm $1 $2 %d } I think it would be possible to edit that to do the job? Link to comment
[UVA]Bart Posted October 20, 2007 Share Posted October 20, 2007 give this a bash on *:SIGNAL:mta.startrace: { if ($mta.nick($1,$2) != $null) { !writeini -n ad.ini tot total $mta.server($1).players slr.starting $1- } } on *:SIGNAL:mta.part: { if ($readini(ad.ini,ad,$mta.nick($1,$2)) == Alive) { !writeini -n ad.ini tot total $calc($slr.tot($1) - 1) !writeini -n ad.ini ad $mta.nick($1,$2) DEAD if ($slr.tot($1) == 1) mta.end $1- } } on *:SIGNAL:mta.death: { !writeini -n ad.ini tot total $calc($slr.tot($1) - 1) !writeini -n ad.ini ad $mta.nick($1,$2) DEAD if ($slr.tot($1) == 1) mta.end $1- } alias slr.tot !return $readini(ad.ini,tot,total) alias slr.starting { var %a = 0 while (%a <= $mta.server($1).cmax) { !writeini ad.ini ad $mta.nick($1,%a) Alive } !inc %a } alias mta.end { var %a = 0 while (%a <= $mta.server($1).cmax) { if ($readini(ad.ini,ad,$mta.nick($1,%a) == Alive)) { if ($mta.nick($1,%a) != $null) { mta.text $1 $mta.race($1) $+ : The Last Man Standing Is $mta.nick($1,%a) $+ ! !remini ad.ini tot !remini ad.ini ad !writeini -n stats.ini WINS $mta.nick($1,%a) $calc($readini(stats.ini,WINS,$mta.nick($1,%a)) + 1) !halt } !inc %a } } } Link to comment
MB|Lagzilla Posted October 20, 2007 Author Share Posted October 20, 2007 At the start of a new race MTA:Ma Crashes ... Thanks though this is most probably a problem with something I have, seems it's exactly what I want Link to comment
[UVA]Bart Posted October 22, 2007 Share Posted October 22, 2007 on *:SIGNAL:mta.startrace: { if ($mta.nick($1,$2) != $null) { !writeini -n ad.ini tot total $mta.server($1).players slr.starting $1- } } on *:SIGNAL:mta.part: { if ($readini(ad.ini,ad,$mta.nick($1,$2)) == Alive) { !writeini -n ad.ini tot total $calc($slr.tot($1) - 1) !writeini -n ad.ini ad $mta.nick($1,$2) DEAD if ($slr.tot($1) == 1) mta.end $1- } } on *:SIGNAL:mta.death: { !writeini -n ad.ini tot total $calc($slr.tot($1) - 1) !writeini -n ad.ini ad $mta.nick($1,$2) DEAD if ($slr.tot($1) == 1) mta.end $1- } alias slr.tot !return $readini(ad.ini,tot,total) alias slr.starting { var %a = 0 while (%a <= $mta.server($1).cmax) { !writeini ad.ini ad $mta.nick($1,%a) Alive !inc %a } } alias mta.end { var %a = 0 while (%a <= $mta.server($1).cmax) { if ($readini(ad.ini,ad,$mta.nick($1,%a) == Alive)) { if ($mta.nick($1,%a) != $null) { mta.text $1 $mta.race($1) $+ : The Last Man Standing Is $mta.nick($1,%a) $+ ! !remini ad.ini tot !remini ad.ini ad !writeini -n stats.ini WINS $mta.nick($1,%a) $calc($readini(stats.ini,WINS,$mta.nick($1,%a)) + 1) !halt } } !inc %a } } shouldnt crash it now Link to comment
MB|Lagzilla Posted October 22, 2007 Author Share Posted October 22, 2007 I worked that out after a bit. Thanks for your help. Link to comment
Recommended Posts