paddy1180 Posted July 6, 2006 Share Posted July 6, 2006 on *:SIGNAL:mta.command:{ elseif $3 == !job if $rpg.area($1,$2) == Malibu-Club { mta.msg $1 $2 Job Completed. You got 987 ! !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash 987 } else mta.msg $1 $2 Go to the Malibu-Club In Whasington Beach ! } This Script has got alot of bugs. when you start with 0 cash and you do the job you get 987, when you try to do it again it says you got 987 but you didnt, your cash stays the same. also after doing the job once, when you type any other commands like !cash it comes up with Job Completed ..... 987 but i havent even typed !job can anyone help me Link to comment
lil Toady Posted July 6, 2006 Share Posted July 6, 2006 hmm, maybe like that: on *:SIGNAL:mta.command:{ if ($3 == !job) { if (Malibu-Club isin $rpg.area($1,$2)) { if ($readini($scriptdir $+ Job.ini,$mta.name($1,$2),MalibuMission1Done) == 0) { mta.msg $1 $2 Job Completed. You Got 987 ! !writeini -n " $+ $rpg.dir $+ Job.ini" $mta.name($1,$2) MalibuMission1Done 1 !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($readini($rpg.dir $+ rpg.ini,$mta.name($1,$2),cash) + 987) } else mta.msg $1 $2 Job Allready Done! } else mta.msg $1 $2 Go to the Malibu-Club In Whasington Beach ! } } Link to comment
paddy1180 Posted July 6, 2006 Author Share Posted July 6, 2006 i test that script and when i type !job it comes up Job Already Done. the first time i type !job ty anyway Link to comment
lil Toady Posted July 6, 2006 Share Posted July 6, 2006 try that then on *:SIGNAL:mta.command:{ if ($3 == !job) { if (Malibu-Club isin $rpg.area($1,$2)) { if ($readini($scriptdir $+ Job.ini,$mta.name($1,$2),MalibuMission1Done) != 1) { mta.msg $1 $2 Job Completed. You Got 987 ! !writeini -n " $+ $rpg.dir $+ Job.ini" $mta.name($1,$2) MalibuMission1Done 1 !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($readini($rpg.dir $+ rpg.ini,$mta.name($1,$2),cash) + 987) } else mta.msg $1 $2 Job Allready Done! } else mta.msg $1 $2 Go to the Malibu-Club In Whasington Beach ! } } Link to comment
paddy1180 Posted July 6, 2006 Author Share Posted July 6, 2006 Yeah it worked can you tell me how i add a timer to it like so after you typed !job it takes a min till you finish the job and get the money Link to comment
lil Toady Posted July 6, 2006 Share Posted July 6, 2006 man, if i was you i'd have it done like this: on *:SIGNAL:mta.command:{ if ($3 == !job) { if (!$readini($rpg.dir $+ Job.ini,$mta.name($1,$2),job)) { if ($readini($scriptdir $+ Job.ini,$mta.name($1,$2),MalibuMission1Done) != 1) { mta.msg $1 $2 You need reach the Malibu-Club in Washington Beach for 1 minute !writeini " $+ $rpg.dir $+ Job.ini" $mta.name($1,$2) job $ctime .timer 1 60 job.fail $1 $2 } else mta.msg $1 $2 Job Allready Done! } else mta.msg $1 $2 You already have a job! You have $duration($calc(60 - $calc($ctime - $readini($rpg.dir $+ Job.ini,$mta.name($1,$2),job)))) left. } elseif ($3 == !here) { if ($readini($rpg.dir $+ Job.ini,$mta.name($1,$2),job)) { if (Malibu-Club isin $rpg.area($1,$2)) { mta.msg $1 $2 Job Completed. You Got 987 ! !writeini -n " $+ $rpg.dir $+ Job.ini" $mta.name($1,$2) MalibuMission1Done 1 !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($readini($rpg.dir $+ rpg.ini,$mta.name($1,$2),cash) + 987) } else mta.msg $1 $2 Go to the Malibu-Club In Washington Beach ! } else mta.msg $1 $2 You dont have a job. Type !job to get one. } } alias job.fail { !remini " $+ $rpg.dir $+ Job.ini" $mta.name($1,$2) job mta.msg $1 $2 Job Failed! Out of time } Link to comment
paddy1180 Posted July 6, 2006 Author Share Posted July 6, 2006 Thank you very much,,, One more question, where did you learn to script MTA:0.5 Xendot | RPG Server http://www.freewebs.com/xendot Link to comment
lil Toady Posted July 6, 2006 Share Posted July 6, 2006 umm.. i read script made by others, cut out and pasted things, learnt how they were done, thats the best way to learn scripting imo.. btw Oli's GRS helped much Link to comment
paddy1180 Posted July 6, 2006 Author Share Posted July 6, 2006 i know iv been asking alot but im trying to learn how to script and i wrote this script myself but when i type !cars nothing happens but whe i type any command starting with ! it comes up with you own cars. on *:SIGNAL:mta.command:{ if ($3 == !cars){ if ($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars)!= $null){ mta.msg $1 $2 You have no cars ! } else mta.msg You own car/s } } thanks Link to comment
Recommended Posts