Jump to content

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


Squall

Recommended Posts

Posted

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

images2.jpg
Posted

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

MTA Server Hosting (pm me for details!)

VCES / SAES Clan Member - VCES.net

Posted

sorry to say still saying PM from Admin: You're not at Sunshine Autos!

when Theoden Area: Sunshine-Autos Viceport Vice-City-Mainland

images2.jpg
Posted

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.

Do not PM me, im not going to read it anyway.

Posted

ty also can u make a heli kill kicker i tried hehe

  on *:SIGNAL:mta.kill:{
mta.say $1 $mta.name($1,$2) killed $mta.name($1,%a) with $mta.weapon($1,$4)
 if (($4 isnum) && ($4 <= 40))mta.kick($1,$2)
}

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

Do not PM me, im not going to read it anyway.

Posted

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!

Posted
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

Do not PM me, im not going to read it anyway.

Posted
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

images2.jpg
Posted
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
 }
}

Do not PM me, im not going to read it anyway.

  • 4 weeks later...
Posted

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

Posted

Moontis, i already fixed that check by the 'isin' operator, instead of '==', i don't think that sunshine area is saved like you wrote btw

Do not PM me, im not going to read it anyway.

Posted

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.

Posted
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

"Never argue with an idiot. They bring you down to their level and beat you with experience."

"Arguing on the internet is like the Special Olympics. Even if you win, you're still retarded."

signature.gif

  • Recently Browsing   0 members

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