Jump to content

alias rpg.sell help


Preston4321

Recommended Posts

Ok so everything is cleaerd on the ini part but heres new probeblem:

I dont have any vehicle in the sold section of the ini but when i go to sunshine autos it sas i dont own it so heres the normal code:

alias rpg.sell {
 if $rpg.area($1,$2) == Sunshine-Autos {
   if $mta.vehicle($1,$2).name != foot && $mta.vehicle($1,$2).name != Unknown {
     if $rpg.sold($1,$2) != $true {
       if $rpg.carowner($1,$2) == $mta.name($1,$2) {
         var %a = $calc($calc($mta.health($1,$2).vehicle * $rpg.cargrade($1,$2)) * 3),%b = $iif($rpg.cargrade($1,$2) == 3,A,$iif   		    ($rpg.cargrade($1,$2) == 2,B,C))
         !remini -n " $+ $rpg.dir $+ rpg.data.ini" carowner $mta.vehicle($1,$2)
         !writeini -n " $+ $rpg.dir $+ rpg.data.ini" sold $mta.vehicle($1,$2) 1
         !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + %a)
         mta.say $1 $mta.name($1,$2) sold: $mta.vehicle($1,$2).name - Class: %b - For: $chr(36) $+ %a
       }
       else mta.msg $1 $2 You do not own this vehicle
     }
     else mta.msg $1 $2 Vehicle: $mta.vehicle($1,$2).name belongs to Sunshine-Autos
   }
   else mta.msg $1 $2 No one wants to buy your feet
 }
 else mta.msg $1 $2 Sunshine-Autos want your vehicle - go there
}

and heres the one i did just to pass by but its not gonna be able to stay if sobody could fix it for me then post it back i'd preciate it thx

alias rpg.sell {
 if $rpg.area($1,$2) == Sunshine-Autos {
   if $mta.vehicle($1,$2).name != foot && $mta.vehicle($1,$2).name != Unknown {
     if $rpg.sold($1,$2) != $true {
       if $rpg.carowner($1,$2) == $mta.name($1,$2) {
         var %a = $calc($calc($mta.health($1,$2).vehicle * $rpg.cargrade($1,$2)) * 3),%b = $iif($rpg.cargrade($1,$2) == 3,A,$iif($rpg.cargrade($1,$2) == 2,B,C))
         !remini -n " $+ $rpg.dir $+ rpg.data.ini" carowner $mta.vehicle($1,$2)
         !writeini -n " $+ $rpg.dir $+ rpg.data.ini" sold $mta.vehicle($1,$2) 1
         !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + %a)
         mta.say $1 $mta.name($1,$2) sold: $mta.vehicle($1,$2).name - Class: %b - For: $chr(36) $+ %a
       }
         var %a = $calc($calc($mta.health($1,$2).vehicle * $rpg.cargrade($1,$2)) * 3),%b = $iif($rpg.cargrade($1,$2) == 3,A,$iif($rpg.cargrade($1,$2) == 2,B,C))
         !remini -n " $+ $rpg.dir $+ rpg.data.ini" carowner $mta.vehicle($1,$2)
         !writeini -n " $+ $rpg.dir $+ rpg.data.ini" sold $mta.vehicle($1,$2) 1
         !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + %a)
         mta.say $1 $mta.name($1,$2) sold: $mta.vehicle($1,$2).name - Class: %b - For: $chr(36) $+ %a
         mta.say $1 $mta.name($1,$2) You can sell this vehicle agin in 10min!
     }
   mta.say $1 $mta.name($1,$2) You can sell this vehicle agin in 10min!
   }
   else mta.msg $1 $2 No one wants to buy your feet
 }
 else mta.msg $1 $2 Sunshine-Autos want your vehicle - go there
}

Link to comment
}

var %a = $calc($calc($mta.health($1,$2).vehicle * $rpg.cargrade($1,$2)) * 3),%b = $iif($rpg.cargrade($1,$2) == 3,A,$iif($rpg.cargrade($1,$2) == 2,B,C)) [/code]

There's your error... code directly after the }

Waht was it supposed to do?

Link to comment

alias rpg.sell {
 if $rpg.area($1,$2) == Sunshine-Autos {
   if $mta.vehicle($1,$2).name != foot && $mta.vehicle($1,$2).name != Unknown {
       if $rpg.carowner($1,$2) == $mta.name($1,$2) {
         var %a = $calc($calc($mta.health($1,$2).vehicle * $rpg.cargrade($1,$2)) * 3),%b = $iif($rpg.cargrade($1,$2) == 3,A,$iif             ($rpg.cargrade($1,$2) == 2,B,C))
         !remini -n " $+ $rpg.dir $+ rpg.data.ini" carowner $mta.vehicle($1,$2)
         !writeini -n " $+ $rpg.dir $+ rpg.data.ini" sold $mta.vehicle($1,$2) 1
         !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + %a)
         mta.say $1 $mta.name($1,$2) sold: $mta.vehicle($1,$2).name - Class: %b - For: $chr(36) $+ %a
     }
     else mta.msg $1 $2 Vehicle: $mta.vehicle($1,$2).name belongs to Sunshine-Autos
   }
   else mta.msg $1 $2 No one wants to buy your feet
 }
 else mta.msg $1 $2 Sunshine-Autos want your vehicle - go there
}

:wink:

Link to comment
alias rpg.sell { 
 if ($rpg.area($1,$2) == Sunshine-Autos) { 
   if ($mta.vehicle($1,$2).name != foot && $mta.vehicle($1,$2).name != Unknown) { 
     var %a = $calc($calc($mta.health($1,$2).vehicle * $rpg.cargrade($1,$2)) * 3),%b = $iif($rpg.cargrade($1,$2) == 3,A,$iif($rpg.cargrade($1,$2) == 2,B,C)) 
     !writeini -n " $+ $rpg.dir $+ rpg.data.ini" sold $mta.vehicle($1,$2) 1 
     !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + %a) 
     mta.say $1 $mta.name($1,$2) sold: $mta.vehicle($1,$2).name - Class: %b - For: $chr(36) $+ %a 

   } 
   else mta.msg $1 $2 No one wants to buy your feet 
 } 
 else mta.msg $1 $2 Sunshine-Autos want your vehicle - go there 
}

Link to comment
alias rpg.sell { 
 if ($rpg.area($1,$2) == Sunshine-Autos) { 
   if ($mta.vehicle($1,$2).name != foot && $mta.vehicle($1,$2).name != Unknown) { 
     var %a = $calc($calc($mta.health($1,$2).vehicle * $rpg.cargrade($1,$2)) * 3),%b = $iif($rpg.cargrade($1,$2) == 3,A,$iif($rpg.cargrade($1,$2) == 2,B,C)) 
     !writeini -n " $+ $rpg.dir $+ rpg.data.ini" sold $mta.vehicle($1,$2) 1 
     !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) + %a) 
     mta.say $1 $mta.name($1,$2) sold: $mta.vehicle($1,$2).name - Class: %b - For: $chr(36) $+ %a 

   } 
   else mta.msg $1 $2 No one wants to buy your feet 
 } 
 else mta.msg $1 $2 Sunshine-Autos want your vehicle - go there 
}

lol i forgot to remove that else that went wid the if.... :roll: i did do it early in the morning quickly :P

Link to comment
  • Recently Browsing   0 members

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