Jump to content

help wid $mta.area($1,$2)


Squall

Recommended Posts

when i go to Sunshine Autos it still say Pm from Admin You Are Not At Sunshine Autos but every ting else works

on *:SIGNAL:mta.command:{
 if ($3 == !sellcar) {
   elseif ($mta.area($1,$2) == Sunshine-Autos) 
   elseif ($mta.vehicle($1,$2).name != foot && $mta.vehicle($1,$2).name != Unknown) 
   else {
     mta.say $1 $mta.name($1,$2) Sold $mta.vehicle($1,$2).name for $rpg.worth($1,$2)
     !writeini -n " $+ $scriptdir $+ Bank.ini" Bank $mta.name($1,$2) $calc($mta.bank($1,$2) + $rpg.worth($1,$2)) 
     !writeini -n " $+ $scriptdir $+ BuySell.ini" Sell $mta.name($1,$2) $mta.vehicle($1,$2)) 
   }
else mta.msg $1 $2 You Are Not At Sunshine Autos
}
else mta.msg $1 $2 You Cant Sell Your Feet
}

dont mind $rpg.worth($1,$2) its a alias

Link to comment

on *:SIGNAL:mta.command:{
 if ($3 == !sellcar) {
   if ($mta.area($1,$2) == Sunshine-Autos) {
     if ($mta.vehicle($1,$2).name != foot && $mta.vehicle($1,$2).name != Unknown) {
       mta.say $1 $mta.name($1,$2) Sold $mta.vehicle($1,$2).name for $rpg.worth($1,$2) 
       !writeini -n " $+ $scriptdir $+ Bank.ini" Bank $mta.name($1,$2) $calc($mta.bank($1,$2) + $rpg.worth($1,$2))
       !writeini -n " $+ $scriptdir $+ BuySell.ini" Sell $mta.name($1,$2) $mta.vehicle($1,$2))
     }
    else mta.msg $1 $2 You need to be in a car
   }
   else mta.msg $1 $2 You're not at Sunshine Autos!
 }
}

try that, havn't scripted in awhile but should do what you want - you had the if's and else's messed up in your script

Link to comment

on *:SIGNAL:mta.command:{
 if ($3 == !sellcar) {
   if (Sunshine-Autos isin $mta.area($1,$2)) {
     if (($mta.vehicle($1,$2).name != foot) && ($mta.vehicle($1,$2).name != Unknown)) {
       !writeini -n " $+ $scriptdir $+ Bank.ini" Bank $mta.name($1,$2) $calc($mta.bank($1,$2) + $rpg.worth($1,$2))
       !writeini -n " $+ $scriptdir $+ BuySell.ini" Sell $mta.name($1,$2) $mta.vehicle($1,$2))
       mta.say $1 $mta.name($1,$2) Sold $mta.vehicle($1,$2).name for $rpg.worth($1,$2)
     }
     else mta.msg $1 $2 You need to be in a car
   }
   else mta.msg $1 $2 You're not at Sunshine Autos!
 }
}

wasn't working coz mta.area retunrs not only sunshine-autos, it returns more text.

Link to comment

on *:SIGNAL:mta.command:{ 
var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2) 
if ($3 == !gay) { 
if (%a == -1) mta.msg $1 $2 Error - Absent ID. 
else mta.say $1 $mta.name($1,%a) is Gay ! 

xD!

Link to comment
on *:SIGNAL:mta.command:{ 
var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2) 
if ($3 == !gay) { 
if (%a == -1) mta.msg $1 $2 Error - Absent ID. 
else mta.say $1 $mta.name($1,%a) is Gay ! 

xD!

yes, you're gay, and your code is with mistakes

Link to comment
on *:SIGNAL:mta.command:{
 if ($4 == 40) {
   mta.say $1 Kicking $mta.name($1,$3) for heli killing!
   mta.kick $1 $3
 }
}

wouldent it be mta.kill not mta.command or something eh im lost

oh, yeah, didnt notice, thnx.

on *:SIGNAL:mta.kill:{
 if ($4 == 40) {
   mta.say $1 Kicking $mta.name($1,$3) for heli killing!
   mta.kick $1 $3
 }
}

Link to comment
  • 4 weeks later...

on *:SIGNAL:mta.command:{ 
 if ($3 == !sellcar) { 
   if (Sunshine-Autos isin $mta.area($1,$2)) { 
     if (($mta.vehicle($1,$2).name != foot) && ($mta.vehicle($1,$2).name != Unknown)) { 
       !writeini -n " $+ $scriptdir $+ Bank.ini" Bank $mta.name($1,$2) $calc($mta.bank($1,$2) + $rpg.worth($1,$2)) 
       !writeini -n " $+ $scriptdir $+ BuySell.ini" Sell $mta.name($1,$2) $mta.vehicle($1,$2)) 
       mta.say $1 $mta.name($1,$2) Sold $mta.vehicle($1,$2).name for $rpg.worth($1,$2) 
     } 
     else mta.msg $1 $2 You need to be in a car 
   } 
   else mta.msg $1 $2 You're not at Sunshine Autos! 
 } 
}

Like lil Toady said, its checking for the person at "Sunshine-Autos", it would have to be the whole name listeded in the ini (I think, been ages since I scripted)

Try changing the name in the ini to "Sunshine-Autos-Viceport-Vice-City-Mainland"

Then change the code to:

on *:SIGNAL:mta.command:{ 
 if ($3 == !sellcar) { 
   if ($mta.area($1,$2) == Sunshine-Autos-Viceport-Vice-City-Mainland) { 
     if ($mta.vehicle($1,$2).name != foot && $mta.vehicle($1,$2).name != Unknown) { 
       mta.say $1 $mta.name($1,$2) Sold $mta.vehicle($1,$2).name for $rpg.worth($1,$2) 
       !writeini -n " $+ $scriptdir $+ Bank.ini" Bank $mta.name($1,$2) $calc($mta.bank($1,$2) + $rpg.worth($1,$2)) 
       !writeini -n " $+ $scriptdir $+ BuySell.ini" Sell $mta.name($1,$2) $mta.vehicle($1,$2)) 
     } 
    else mta.msg $1 $2 You need to be in a car 
   } 
   else mta.msg $1 $2 You're not at Sunshine Autos! 
 } 
} 

Link to comment

Ah my mistake, I never noticed the == and isin.

Nice One for spotting it lil Toady, also, I mentioned changing the area name in the ini. Bah, nevermind, It seems he's solve the problem.

Link to comment
Ah my mistake, I never noticed the == and isin.

Nice One for spotting it lil Toady, also, I mentioned changing the area name in the ini. Bah, nevermind, It seems he's solve the problem.

Don't edit existing entries in mta.data.ini

Link to comment
  • Recently Browsing   0 members

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