Jump to content

!cars


paddy1180

Recommended Posts

i know i have been posting loads of topics latly but i am trying to learn how to script and i made this basic code

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
}
}

i dont know whats wrong with this but it dosnt work

i want it to tell people how many cars they own

Link to comment

on *:SIGNAL:lil_Toady'sHelp:{

if you have the number of cars in the ini, so

on *:SIGNAL:mta.command:{
 if ($3 == !cars) {
   if ($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars)) You own $readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars) cars
   else mta.msg $1 $2 You have no cars !
 }
}

elseif you have a list of cars separated with coma, then {

on *:SIGNAL:mta.command:{
 if ($3 == !cars) {
   if ($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars)) You own $numtok($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars),1,44) cars
   else mta.msg $1 $2 You have no cars !
 }
} 

}

elseif a list of cars separated with space, then {

on *:SIGNAL:mta.command:{
 if ($3 == !cars) {
   if ($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars)) You own $numtok($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars),1,32) cars
   else mta.msg $1 $2 You have no cars !
 }
} 

}

else ask again and tell me more info

}

Link to comment

oh.. i made a 2 mistakes in all of em, change $script.dir to $rpg.dir (i think you used that) or whatever you use in your script and i forgot mta.msg

just take this:

on *:SIGNAL:mta.command:{
 if ($3 == !cars) {
   if ($readini($rpg.dir $+ RPG.ini,$mta.name($1,$2),cars) >= 1) mta.msg $1 $2 You own $readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars) cars
   else mta.msg $1 $2 You have no cars !
 }
}

Link to comment
  • Recently Browsing   0 members

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