Preston4321 Posted October 16, 2005 Share Posted October 16, 2005 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
Harry Posted October 17, 2005 Share Posted October 17, 2005 } 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
Preston4321 Posted October 17, 2005 Author Share Posted October 17, 2005 no no no that part is fine but like idk way when i try to sell the car it sas the owner is Sunshine autos and in the ini it sas [sold] with nuttin under it. Link to comment
andeh Posted October 17, 2005 Share Posted October 17, 2005 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 } Link to comment
MrJax Posted October 17, 2005 Share Posted October 17, 2005 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
andeh Posted October 17, 2005 Share Posted October 17, 2005 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.... i did do it early in the morning quickly Link to comment
Recommended Posts