CoZ Posted August 26, 2006 Share Posted August 26, 2006 k .. i have money script -bit edited from tommis rpg thing, thx tommis- and wanted to spice it up a bit more well im just testing it atm, and what im testing is paying to die (imho this could encourage people to try and race better and not suicide when they run off track.. also its the alternative to giving people cash for killing someone on a dm map - because that is impossible atm) anyway .. the code to pay cash on death aint that hard and so far people are somewhat okay with it on *:SIGNAL:mta.death: { [snip] if ($gus.cash($1,$2) >= 25) { !writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $gus.subtract($gus.cash($1,$2),10) mta.pm $1 $2 Payed $chr(36) 10 for hospital .. be carefull this time } elseif ($gus.cash($1,$2) <= 24) { !.timer 1 1 mta.pm $1 $2 Earn some cash and pay hospital bill later.. your lucky now } } but what i want to do is make a 10 sec exception for when you just spawned.. well my guess is (, based on the marginal scripting i learned so far , ) i need some sort of timer in on *:SIGNAL:mta.respawn: { } or $mta.respawn and have the death part check if timer is running also similar when map ends and gets unloaded .. people fall and tend to drown a lot so ill probably need a similar trick with on *:SIGNAL:mta.finish: { } or $mta.finish but my coding is still pretty much limited to adding mta.text and simple ifs can someone point me in the right direction ? Link to comment
lil Toady Posted August 26, 2006 Share Posted August 26, 2006 on *:SIGNAL:mta.startrace:{ unset %respawned.* unset %raceend } on *:SIGNAL:mta.finish:{ set %raceend 1 } on *:SIGNAL:mta.respawn:{ set %respawned. [ $+ $2 ] 1 .timer $+ $2 1 10 unset %respawned. [ $+ $2 ] } on *:SIGNAL:mta.death:{ if ((!%raceend) && (!%respawned. [ $+ $2 ])) { if ($gus.cash($1,$2) >= 25) { !writeini -n " $+ $scriptdir $+ RPG.ini" CASH $mta.nick($1,$2) $calc($gus.cash($1,$2)-10) mta.pm $1 $2 Paid $chr(36) 10$ for hospital .. be carefull next time } elseif ($gus.cash($1,$2) <= 24) !.timer 1 1 mta.pm $1 $2 Earn some cash and pay hospital bill later.. your lucky now } } Link to comment
CoZ Posted August 26, 2006 Author Share Posted August 26, 2006 * CoZ bows before lil Toady your code works, as ever, like a charm TNX ------- edit update .. script started to lag more and more and more the longer it ran today so it basically works, but making the script respond 2 or 3 seconds later than a event is probably not good Link to comment
Recommended Posts