Jump to content

For jax n oli RPGrs


ChiefNuclear

How is it?  

10 members have voted

  1. 1. How is it?

    • Awsome!
      3
    • Ok
      3
    • Sucky
      4


Recommended Posts

This script should be used under Jax n Oli's rpg cuz has same aliases etc.

on *:SIGNAL:mta.command:{

if ($3 == !marketon) {

if $mta.ip($1,$2) == IP HERE {

mta.say $1 Market Activated!

!.timermarket 999 $4 rpg.pricechange $mta.active

}

}

elseif ($3 == !cp) {

if $mta.ip($1,$2) == IP HERE {

mta.say $1 Prices Changed!

!.timer 1 0 rpg.pricechange $mta.active

}

}

elseif ($3 == !marketoff) {

if $mta.ip($1,$2) == IP HERE {

mta.say $1 Market De-Activated!

/timermarket off

}

}

elseif ($3 == !buywhores) {

if ($rpg.area($1,$2) == Vercetti-Estate) {

if (($4 isnum) && ($4 > 0)) {

var %cash = $rpg.cash($1,$2),%whores = $rpg.whores($1,$2)

if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice))) {

if $4 <= 12 {

if $rpg.whores($1,$2) != 12 {

mta.msg $1 $2 You have bought $4 $iif($4 = 1,Whore,Whores)

!writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)))

!writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Whores $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores)+ $4)

}

else mta.msg $1 $2 You can only have 12 Whores!

}

else mta.msg $1 $2 You can only have 12 Whores!

}

else mta.msg $1 $2 You do not have enough cash to buy $4 Whores!

}

}

else mta.msg $1 $2 You must be at Vercett-Mansion to Buy Whores!

}

elseif ($3 == !sellwhores) {

if ($rpg.area($1,$2) == Escobar-International) {

if (($4 isnum) && ($4 > 0)) {

var %cash = $rpg.cash($1,$2),%whores = $rpg.whores($1,$2)

if $rpg.whores($1,$2) >= 1 {

mta.msg $1 $2 You have sold $4 $iif($4 = 1,Whore,Whores)

!writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)))

!writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Whores $calc(%whores - $4)

}

else mta.msg $1 $2 You dont have any Whores!

}

}

else mta.msg $1 $2 You must be at Escobar-International to Sell Whores!

}

elseif ($3 == !prices) {

mta.msg $1 $2 Whores: $ $+ $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)) (Lowest: $ $+ 20000 Highest: 26999)

mta.msg $1 $2 Vodka: $ $+ $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)) (Lowest: $ $+ 12000 Highest: 19999)

mta.msg $1 $2 Cigs: $ $+ $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)) (Lowest: $ $+ 27000 Highest: 32999)

}

elseif ($3 == !mymrkt) {

mta.msg $1 $2 Bank: $ $+ $rpg.bank($1,$2)

mta.msg $1 $2 Market Items: Whores: $rpg.whores($1,$2) Vodka: $rpg.vodka($1,$2) Cigs: $rpg.cig($1,$2)

}

elseif ($3 == !mrkt) {

if $4 != $null {

mta.msg $1 $2 $mta.name($1,$mta.findid($1,$4)) $+ : Bank: $ $+ $rpg.bank($1,$mta.findid($1,$4))

mta.msg $1 $2 Market Items: Whores: $rpg.whores($1,$mta.findid($1,$4)) Vodka: $rpg.vodka($1,$mta.findid($1,$4)) Cigs: $rpg.cig($1,$mta.findid($1,$4))

}

else mta.msg $1 $2 Bank: $ $+ $rpg.bank($1,$2) Market Items: Whores: $rpg.whores($1,$2) Vodka: $rpg.vodka($1,$2) Cigs: $rpg.cig($1,$2)

}

elseif ($3 == !buycigs) {

if ($rpg.area($1,$2) == Cherry-Poppers) {

if (($4 isnum) && ($4 > 0)) {

var %cash = $rpg.cash($1,$2),%cigs = $rpg.cig($1,$2)

if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice))) {

if $4 <= 12 {

if $rpg.cig($1,$2) != 12 {

mta.msg $1 $2 You have bought $4 $iif($4 = 1,Cig,Cigs)

!writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)))

!writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Cigs $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs)+ $4)

}

else mta.msg $1 $2 You can only have 12 Cigs!

}

else mta.msg $1 $2 You can only have 12 Cigs!

}

else mta.msg $1 $2 You do not have enough cash to buy $4 Cigs!

}

}

else mta.msg $1 $2 You must be at Cherry-Poppers to buy Cigs!

}

elseif ($3 == !sellcigs) {

if ($rpg.area($1,$2) == Sunshine-Autos) {

if (($4 isnum) && ($4 > 0)) {

var %cash = $rpg.cash($1,$2),%cigs = $rpg.cig($1,$2)

if $rpg.cig($1,$2) >= 1 {

mta.msg $1 $2 You have sold $4 $iif($4 = 1,Cig,Cigs)

!writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)))

!writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Cigs $calc(%Cigs - $4)

}

else mta.msg $1 $2 You do not have any Cigs!

}

}

else mta.msg $1 $2 You must be at Sunshine-Autos to sell Cigs!

}

elseif ($3 == !buyvodka) {

if ($rpg.area($1,$2) == Malibu-Club) {

if (($4 isnum) && ($4 > 0)) {

var %cash = $rpg.cash($1,$2),%vodka = $rpg.vodka($1,$2)

if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice))) {

if $4 <= 12 {

if $rpg.vodka($1,$2) != 12 {

mta.msg $1 $2 You have bought $4 $iif($4 = 1,Vodka,Vodkas)

!writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)))

!writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Vodka $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka)+ $4)

}

else mta.msg $1 $2 You can only have 12 Vodkas!

}

else mta.msg $1 $2 You can only have 12 Vodkas!

}

else mta.msg $1 $2 You do not have enough cash to buy $4 Vodkas!

}

}

else mta.msg $1 $2 You must be at Malibu-Club to buy Vodkas!

}

elseif ($3 == !sellvodka) {

if ($rpg.area($1,$2) == North-Point-Mall-(Vice-Point)) {

if (($4 isnum) && ($4 > 0)) {

var %cash = $rpg.cash($1,$2),%vodka = $rpg.vodka($1,$2)

if $rpg.vodka($1,$2) >= 1 {

mta.msg $1 $2 You have sold $4 $iif($4 = 1,Vodka,Vodkas)

!writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)))

!writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Vodka $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka)- $4)

}

else mta.msg $1 $2 You do not have any Vodka!

}

}

else mta.msg $1 $2 You must be at North-Point-Mall-(Vice-Point) to sell Vodkas!

}

alias rpg.wprices !return $iif($readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice),$readini($rpg.dir $+ Prices.ini,WhorePrice,WPrice),0)

alias rpg.vprices !return $iif($readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice),$readini($rpg.dir $+ Prices.ini,VodkaPrice,VPrice),0)

alias rpg.cprices !return $iif($readini($rpg.dir $+ Prices.ini,CigPrice,Cprice),$readini($rpg.dir $+ Prices.ini,CigPrice,CPrice),0)

alias rpg.whores !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores),0)

alias rpg.vodka !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka),0)

alias rpg.cig !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs),0)

alias rpg.pricechange {

!writeini -n " $+ $rpg.dir $+ Prices.ini" WhorePrice Wprice $rand(20000,26999)

!writeini -n " $+ $rpg.dir $+ Prices.ini" VodkaPrice Vprice $rand(12000,19999)

!writeini -n " $+ $rpg.dir $+ Prices.ini" CigPrice Cprice $rand(27000,32999)

mta.say $1 Market Prices Have Changed. Go Shop!

}

Link to comment

you need to learn hash tables my friend.. you can use them to store ips/usernames instead of just checking against 1 hard-coded ip all the time (though some might argue text files do the same job.. but hash tables are still worth learning :P) *grins*

i suppose you could have spaced out the lines a bit to make it more readable.. but meh

- Bungle

Link to comment

this is a bit of fixed version

on *:SIGNAL:mta.command:{
 if ($3 == !marketon) {
   if $mta.ip($1,$2) == IP HERE {
     if ($4 != $null) { 
       mta.say $1 Market Activated!
       !.timermarket 0 $4 rpg.pricechange $mta.active
     }
     else mta.say $1 prices will change every 5 mins
     !.timermarket 0 300 rpg.pricechange $mta.active
   }
 }
 elseif ($3 == !cp) {
   if $mta.ip($1,$2) == IP HERE {
     if ($4 != $null) { 
       mta.say $1 Prices Changed!
       !.timer 1 0 rpg.pricechange $mta.active
     }
     else mta.say $1 Error !cp 
   }
 }
 elseif ($3 == !marketoff) {
   if $mta.ip($1,$2) == IP HERE {
     mta.say $1 Market De-Activated!
     !.timermarket off
   }
 }
 elseif (!buywhore isin $3) {
   if ($rpg.area($1,$2) == Vercetti-Estate) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%whores = $rpg.whores($1,$2)
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice))) {
         if $4 <= 12 {
           if $rpg.whores($1,$2) != 12 {
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Whore,Whores)
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)))
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Whores $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores)+ $4)
           }
           else mta.msg $1 $2 You can only have 12 Whores!
         }
         else mta.msg $1 $2 You can only have 12 Whores!
       }
       else mta.msg $1 $2 You do not have enough cash to buy $4 Whores!
     }
   }
   else mta.msg $1 $2 You must be at Vercett-Mansion to Buy Whores!
 }
 elseif (!sellwhore isin $3) {
   if ($rpg.area($1,$2) == Escobar-International) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%whores = $rpg.whores($1,$2)
       if $rpg.whores($1,$2) >= 1 {
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Whore,Whores)
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)))
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Whores $calc(%whores - $4)
       }
       else mta.msg $1 $2 You dont have any Whores!
     }
   }
   else mta.msg $1 $2 You must be at Escobar-International to Sell Whores!
 }
 elseif (!price isin $3) {
   mta.msg $1 $2 Whores: $ $+ $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)) (Lowest: $ $+ 20000 Highest: 26999)
   mta.msg $1 $2 Vodka: $ $+ $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)) (Lowest: $ $+ 12000 Highest: 19999)
   mta.msg $1 $2 Cigs: $ $+ $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)) (Lowest: $ $+ 27000 Highest: 32999)
 }
 elseif ($3 == !mymrkt) {
   mta.msg $1 $2 Bank: $ $+ $rpg.bank($1,$2)
   mta.msg $1 $2 Market Items: Whores: $rpg.whores($1,$2) Vodka: $rpg.vodka($1,$2) Cigs: $rpg.cig($1,$2)
 }
 elseif ($3 == !mrkt) {
   if $4 != $null {
     mta.msg $1 $2 $mta.name($1,$mta.findid($1,$4)) $+ : Bank: $ $+ $rpg.bank($1,$mta.findid($1,$4))
     mta.msg $1 $2 Market Items: Whores: $rpg.whores($1,$mta.findid($1,$4)) Vodka: $rpg.vodka($1,$mta.findid($1,$4)) Cigs: $rpg.cig($1,$mta.findid($1,$4))
   }
   else mta.msg $1 $2 Bank: $ $+ $rpg.bank($1,$2) Market Items: Whores: $rpg.whores($1,$2) Vodka: $rpg.vodka($1,$2) Cigs: $rpg.cig($1,$2)
 }
 elseif (!buysig isin $3) {
   if ($rpg.area($1,$2) == Cherry-Poppers) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%cigs = $rpg.cig($1,$2)
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice))) {
         if $4 <= 12 {
           if $rpg.cig($1,$2) != 12 {
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Cig,Cigs)
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)))
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Cigs $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs)+ $4)
           }
           else mta.msg $1 $2 You can only have 12 Cigs!
         }
         else mta.msg $1 $2 You can only have 12 Cigs!
       }
       else mta.msg $1 $2 You do not have enough cash to buy $4 Cigs!
     }
   }
   else mta.msg $1 $2 You must be at Cherry-Poppers to buy Cigs!
 }
 elseif (!sellsig isin $3) {
   if ($rpg.area($1,$2) == Sunshine-Autos) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%cigs = $rpg.cig($1,$2)
       if $rpg.cig($1,$2) >= 1 {
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Cig,Cigs)
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)))
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Cigs $calc(%Cigs - $4)
       }
       else mta.msg $1 $2 You do not have any Cigs!
     }
   }
   else mta.msg $1 $2 You must be at Sunshine-Autos to sell Cigs!
 }
 elseif (!buyvodka isin $3) {
   if ($rpg.area($1,$2) == Malibu-Club) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%vodka = $rpg.vodka($1,$2)
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice))) {
         if $4 <= 12 {
           if $rpg.vodka($1,$2) != 12 {
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Vodka,Vodkas)
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)))
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Vodka $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka)+ $4)
           }
           else mta.msg $1 $2 You can only have 12 Vodkas!
         }
         else mta.msg $1 $2 You can only have 12 Vodkas!
       }
       else mta.msg $1 $2 You do not have enough cash to buy $4 Vodkas!
     }
   }
   else mta.msg $1 $2 You must be at Malibu-Club to buy Vodkas!
 }
 elseif (!sellvodka isin $3) {
   if ($rpg.area($1,$2) == North-Point-Mall-(Vice-Point)) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%vodka = $rpg.vodka($1,$2)
       if $rpg.vodka($1,$2) >= 1 {
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Vodka,Vodkas)
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)))
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Vodka $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka)- $4)
       }
       else mta.msg $1 $2 You do not have any Vodka!
     }
   }
   else mta.msg $1 $2 You must be at North-Point-Mall-(Vice-Point) to sell Vodkas!
 }
}
alias rpg.wprices !return $iif($readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice),$readini($rpg.dir $+ Prices.ini,WhorePrice,WPrice),0)
alias rpg.vprices !return $iif($readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice),$readini($rpg.dir $+ Prices.ini,VodkaPrice,VPrice),0)
alias rpg.cprices !return $iif($readini($rpg.dir $+ Prices.ini,CigPrice,Cprice),$readini($rpg.dir $+ Prices.ini,CigPrice,CPrice),0)
alias rpg.whores !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores),0)
alias rpg.vodka !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka),0)
alias rpg.cig !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs),0)
alias rpg.pricechange {
 !writeini -n " $+ $rpg.dir $+ Prices.ini" WhorePrice Wprice $rand(20000,26999)
 !writeini -n " $+ $rpg.dir $+ Prices.ini" VodkaPrice Vprice $rand(12000,19999)
 !writeini -n " $+ $rpg.dir $+ Prices.ini" CigPrice Cprice $rand(27000,32999)
 mta.say $1 Market Prices Have Changed. Go Shop!
}

Link to comment

Why dont you write a small admin system with the ip's...like couple lines and itll be way better :P

on *:SIGNAL:mta.command:{ 
 if ($3 == !set) {
   if ($readini($scriptdir $+ admin.ini,SET,SET) == $null) {
     !writeini -n " $+ $scriptdir $+ admin.ini" SET SET 1
     !writeini -n " $+ $scriptdir $+ admin.ini" ADMIN $mta.name($1,$2) 1
     !writeini -n " $+ $scriptdir $+ admin.ini" IP $mta.name($1,$2) $gettok($mta.ip($1,$2),1-2,46)
     mta.msg $1 $2 You have been added with Admin
   }
   else mta.msg $1 $2 Error - This command has already been used
 }
 elseif ($3 == !marketon) { 
   if ($readini($scriptdir $+ admin.ini,ADMIN,$mta.name($1,$2)) >= 1 && $readini($scriptdir $+ admin.ini,IP,$mta.name($1,$2)) isin $mta.ip($1,$2)) {
     if ($4 != $null) { 
       mta.say $1 Market Activated! 
       !.timermarket 0 $4 rpg.pricechange $mta.active 
     } 
     else mta.say $1 Prices will change every 5 mins 
     !.timermarket 0 300 rpg.pricechange $mta.active 
   } 
 } 
 elseif ($3 == !addadmin) {
   if ($readini($scriptdir $+ admin.ini,ADMIN,$mta.name($1,$2)) >= 1 && $readini($scriptdir $+ admin.ini,IP,$mta.name($1,$2)) isin $mta.ip($1,$2)) {
     !writeini -n " $+ $scriptdir $+ admin.ini" ADMIN $mta.name($1,$mta.getid($1,$4)) 1
     !writeini -n " $+ $scriptdir $+ admin.ini" IP $mta.name($1,$mta.getid($1,$4)) $gettok($mta.ip($1,$mta.getid($1,$4)),1-2,46)
     mta.say $mta.name($1,$mta.getid($1,$4) Added with Admin
   }
 }
 elseif ($3 == !cp) { 
   if ($readini($scriptdir $+ admin.ini,ADMIN,$mta.name($1,$2)) >= 1 && $readini($scriptdir $+ admin.ini,IP,$mta.name($1,$2)) isin $mta.ip($1,$2)) {
     if ($4 != $null) { 
       mta.say $1 Prices Changed! 
       !.timer 1 0 rpg.pricechange $mta.active 
     } 
     else mta.say $1 Error !cp 
   } 
 } 
 elseif ($3 == !marketoff) { 
   if ($readini($scriptdir $+ admin.ini,ADMIN,$mta.name($1,$2)) >= 1 && $readini($scriptdir $+ admin.ini,IP,$mta.name($1,$2)) isin $mta.ip($1,$2)) {
     mta.say $1 Market De-Activated! 
     !.timermarket off 
   } 
 } 
 elseif (!buywhore isin $3) { 
   if ($rpg.area($1,$2) == Vercetti-Estate) { 
     if (($4 isnum) && ($4 > 0)) { 
       var %cash = $rpg.cash($1,$2),%whores = $rpg.whores($1,$2) 
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice))) { 
         if $4 <= 12 { 
           if $rpg.whores($1,$2) != 12 { 
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Whore,Whores) 
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice))) 
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Whores $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores)+ $4) 
           } 
           else mta.msg $1 $2 You can only have 12 Whores! 
         } 
         else mta.msg $1 $2 You can only have 12 Whores! 
       } 
       else mta.msg $1 $2 You do not have enough cash to buy $4 Whores! 
     } 
   } 
   else mta.msg $1 $2 You must be at Vercett-Mansion to Buy Whores! 
 } 
 elseif (!sellwhore isin $3) { 
   if ($rpg.area($1,$2) == Escobar-International) { 
     if (($4 isnum) && ($4 > 0)) { 
       var %cash = $rpg.cash($1,$2),%whores = $rpg.whores($1,$2) 
       if $rpg.whores($1,$2) >= 1 { 
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Whore,Whores) 
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice))) 
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Whores $calc(%whores - $4) 
       } 
       else mta.msg $1 $2 You dont have any Whores! 
     } 
   } 
   else mta.msg $1 $2 You must be at Escobar-International to Sell Whores! 
 } 
 elseif (!price isin $3) { 
   mta.msg $1 $2 Whores: $ $+ $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)) (Lowest: $ $+ 20000 Highest: 26999) 
   mta.msg $1 $2 Vodka: $ $+ $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)) (Lowest: $ $+ 12000 Highest: 19999) 
   mta.msg $1 $2 Cigs: $ $+ $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)) (Lowest: $ $+ 27000 Highest: 32999) 
 } 
 elseif ($3 == !mymrkt) { 
   mta.msg $1 $2 Bank: $ $+ $rpg.bank($1,$2) 
   mta.msg $1 $2 Market Items: Whores: $rpg.whores($1,$2) Vodka: $rpg.vodka($1,$2) Cigs: $rpg.cig($1,$2) 
 } 
 elseif ($3 == !mrkt) { 
   if $4 != $null { 
     mta.msg $1 $2 $mta.name($1,$mta.findid($1,$4)) $+ : Bank: $ $+ $rpg.bank($1,$mta.findid($1,$4)) 
     mta.msg $1 $2 Market Items: Whores: $rpg.whores($1,$mta.findid($1,$4)) Vodka: $rpg.vodka($1,$mta.findid($1,$4)) Cigs: $rpg.cig($1,$mta.findid($1,$4)) 
   } 
   else mta.msg $1 $2 Bank: $ $+ $rpg.bank($1,$2) Market Items: Whores: $rpg.whores($1,$2) Vodka: $rpg.vodka($1,$2) Cigs: $rpg.cig($1,$2) 
 } 
 elseif (!buysig isin $3) { 
   if ($rpg.area($1,$2) == Cherry-Poppers) { 
     if (($4 isnum) && ($4 > 0)) { 
       var %cash = $rpg.cash($1,$2),%cigs = $rpg.cig($1,$2) 
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice))) { 
         if $4 <= 12 { 
           if $rpg.cig($1,$2) != 12 { 
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Cig,Cigs) 
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice))) 
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Cigs $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs)+ $4) 
           } 
           else mta.msg $1 $2 You can only have 12 Cigs! 
         } 
         else mta.msg $1 $2 You can only have 12 Cigs! 
       } 
       else mta.msg $1 $2 You do not have enough cash to buy $4 Cigs! 
     } 
   } 
   else mta.msg $1 $2 You must be at Cherry-Poppers to buy Cigs! 
 } 
 elseif (!sellsig isin $3) { 
   if ($rpg.area($1,$2) == Sunshine-Autos) { 
     if (($4 isnum) && ($4 > 0)) { 
       var %cash = $rpg.cash($1,$2),%cigs = $rpg.cig($1,$2) 
       if $rpg.cig($1,$2) >= 1 { 
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Cig,Cigs) 
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice))) 
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Cigs $calc(%Cigs - $4) 
       } 
       else mta.msg $1 $2 You do not have any Cigs! 
     } 
   } 
   else mta.msg $1 $2 You must be at Sunshine-Autos to sell Cigs! 
 } 
 elseif (!buyvodka isin $3) { 
   if ($rpg.area($1,$2) == Malibu-Club) { 
     if (($4 isnum) && ($4 > 0)) { 
       var %cash = $rpg.cash($1,$2),%vodka = $rpg.vodka($1,$2) 
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice))) { 
         if $4 <= 12 { 
           if $rpg.vodka($1,$2) != 12 { 
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Vodka,Vodkas) 
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice))) 
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Vodka $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka)+ $4) 
           } 
           else mta.msg $1 $2 You can only have 12 Vodkas! 
         } 
         else mta.msg $1 $2 You can only have 12 Vodkas! 
       } 
       else mta.msg $1 $2 You do not have enough cash to buy $4 Vodkas! 
     } 
   } 
   else mta.msg $1 $2 You must be at Malibu-Club to buy Vodkas! 
 } 
 elseif (!sellvodka isin $3) { 
   if ($rpg.area($1,$2) == North-Point-Mall-(Vice-Point)) { 
     if (($4 isnum) && ($4 > 0)) { 
       var %cash = $rpg.cash($1,$2),%vodka = $rpg.vodka($1,$2) 
       if $rpg.vodka($1,$2) >= 1 { 
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Vodka,Vodkas) 
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice))) 
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Vodka $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka)- $4) 
       } 
       else mta.msg $1 $2 You do not have any Vodka! 
     } 
   } 
   else mta.msg $1 $2 You must be at North-Point-Mall-(Vice-Point) to sell Vodkas! 
 } 
} 
alias rpg.wprices !return $iif($readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice),$readini($rpg.dir $+ Prices.ini,WhorePrice,WPrice),0) 
alias rpg.vprices !return $iif($readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice),$readini($rpg.dir $+ Prices.ini,VodkaPrice,VPrice),0) 
alias rpg.cprices !return $iif($readini($rpg.dir $+ Prices.ini,CigPrice,Cprice),$readini($rpg.dir $+ Prices.ini,CigPrice,CPrice),0) 
alias rpg.whores !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores),0) 
alias rpg.vodka !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka),0) 
alias rpg.cig !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs),0) 
alias rpg.pricechange { 
 !writeini -n " $+ $rpg.dir $+ Prices.ini" WhorePrice Wprice $rand(20000,26999) 
 !writeini -n " $+ $rpg.dir $+ Prices.ini" VodkaPrice Vprice $rand(12000,19999) 
 !writeini -n " $+ $rpg.dir $+ Prices.ini" CigPrice Cprice $rand(27000,32999) 
 mta.say $1 Market Prices Have Changed. Go Shop! 
} 

Link to comment

if you use GRS this would be the best way

on *:SIGNAL:mta.command:{
 if ($3 == !marketon && $mta.level($1,$2) = 5) {
     if ($4 != $null) {
       mta.say $1 Market Activated!
       !.timermarket 0 $4 rpg.pricechange $mta.active
     }
     else mta.say $1 prices will change every 5 mins
     !.timermarket 0 300 rpg.pricechange $mta.active
   }
 }
 elseif ($3 == !cp && $mta.level($1,$2) = 5) { 
     if ($4 != $null) {
       mta.say $1 Prices Changed!
       !.timer 1 0 rpg.pricechange $mta.active
     }
     else mta.say $1 Error !cp 
   }
 }
 elseif ($3 == !marketoff && $mta.level($1,$2) = 5) { 
   if $mta.ip($1,$2) == IP HERE {
     mta.say $1 Market De-Activated!
     !.timermarket off
   }
 }
 elseif (!buywhore isin $3) {
   if ($rpg.area($1,$2) == Vercetti-Estate) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%whores = $rpg.whores($1,$2)
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice))) {
         if $4 <= 12 {
           if $rpg.whores($1,$2) != 12 {
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Whore,Whores)
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)))
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Whores $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores)+ $4)
           }
           else mta.msg $1 $2 You can only have 12 Whores!
         }
         else mta.msg $1 $2 You can only have 12 Whores!
       }
       else mta.msg $1 $2 You do not have enough cash to buy $4 Whores!
     }
   }
   else mta.msg $1 $2 You must be at Vercett-Mansion to Buy Whores!
 }
 elseif (!sellwhore isin $3) {
   if ($rpg.area($1,$2) == Escobar-International) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%whores = $rpg.whores($1,$2)
       if $rpg.whores($1,$2) >= 1 {
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Whore,Whores)
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)))
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Whores $calc(%whores - $4)
       }
       else mta.msg $1 $2 You dont have any Whores!
     }
   }
   else mta.msg $1 $2 You must be at Escobar-International to Sell Whores!
 }
 elseif (!price isin $3) {
   mta.msg $1 $2 Whores: $ $+ $readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice)) (Lowest: $ $+ 20000 Highest: 26999)
   mta.msg $1 $2 Vodka: $ $+ $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)) (Lowest: $ $+ 12000 Highest: 19999)
   mta.msg $1 $2 Cigs: $ $+ $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)) (Lowest: $ $+ 27000 Highest: 32999)
 }
 elseif ($3 == !mymrkt) {
   mta.msg $1 $2 Bank: $ $+ $rpg.bank($1,$2)
   mta.msg $1 $2 Market Items: Whores: $rpg.whores($1,$2) Vodka: $rpg.vodka($1,$2) Cigs: $rpg.cig($1,$2)
 }
 elseif ($3 == !mrkt) {
   if $4 != $null {
     mta.msg $1 $2 $mta.name($1,$mta.findid($1,$4)) $+ : Bank: $ $+ $rpg.bank($1,$mta.findid($1,$4))
     mta.msg $1 $2 Market Items: Whores: $rpg.whores($1,$mta.findid($1,$4)) Vodka: $rpg.vodka($1,$mta.findid($1,$4)) Cigs: $rpg.cig($1,$mta.findid($1,$4))
   }
   else mta.msg $1 $2 Bank: $ $+ $rpg.bank($1,$2) Market Items: Whores: $rpg.whores($1,$2) Vodka: $rpg.vodka($1,$2) Cigs: $rpg.cig($1,$2)
 }
 elseif (!buysig isin $3) {
   if ($rpg.area($1,$2) == Cherry-Poppers) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%cigs = $rpg.cig($1,$2)
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice))) {
         if $4 <= 12 {
           if $rpg.cig($1,$2) != 12 {
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Cig,Cigs)
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)))
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Cigs $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs)+ $4)
           }
           else mta.msg $1 $2 You can only have 12 Cigs!
         }
         else mta.msg $1 $2 You can only have 12 Cigs!
       }
       else mta.msg $1 $2 You do not have enough cash to buy $4 Cigs!
     }
   }
   else mta.msg $1 $2 You must be at Cherry-Poppers to buy Cigs!
 }
 elseif (!sellsig isin $3) {
   if ($rpg.area($1,$2) == Sunshine-Autos) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%cigs = $rpg.cig($1,$2)
       if $rpg.cig($1,$2) >= 1 {
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Cig,Cigs)
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,CigPrice,Cprice)))
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Cigs $calc(%Cigs - $4)
       }
       else mta.msg $1 $2 You do not have any Cigs!
     }
   }
   else mta.msg $1 $2 You must be at Sunshine-Autos to sell Cigs!
 }
 elseif (!buyvodka isin $3) {
   if ($rpg.area($1,$2) == Malibu-Club) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%vodka = $rpg.vodka($1,$2)
       if (%cash >= $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice))) {
         if $4 <= 12 {
           if $rpg.vodka($1,$2) != 12 {
             mta.msg $1 $2 You have bought $4 $iif($4 = 1,Vodka,Vodkas)
             !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash - $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)))
             !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Vodka $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka)+ $4)
           }
           else mta.msg $1 $2 You can only have 12 Vodkas!
         }
         else mta.msg $1 $2 You can only have 12 Vodkas!
       }
       else mta.msg $1 $2 You do not have enough cash to buy $4 Vodkas!
     }
   }
   else mta.msg $1 $2 You must be at Malibu-Club to buy Vodkas!
 }
 elseif (!sellvodka isin $3) {
   if ($rpg.area($1,$2) == North-Point-Mall-(Vice-Point)) {
     if (($4 isnum) && ($4 > 0)) {
       var %cash = $rpg.cash($1,$2),%vodka = $rpg.vodka($1,$2)
       if $rpg.vodka($1,$2) >= 1 {
         mta.msg $1 $2 You have sold $4 $iif($4 = 1,Vodka,Vodkas)
         !writeini " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc(%cash + $calc($4 * $readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice)))
         !writeini " $+ $rpg.dir $+ Market.ini" $mta.name($1,$2) Vodka $calc($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka)- $4)
       }
       else mta.msg $1 $2 You do not have any Vodka!
     }
   }
   else mta.msg $1 $2 You must be at North-Point-Mall-(Vice-Point) to sell Vodkas!
 }
}
alias rpg.wprices !return $iif($readini($rpg.dir $+ Prices.ini,WhorePrice,Wprice),$readini($rpg.dir $+ Prices.ini,WhorePrice,WPrice),0)
alias rpg.vprices !return $iif($readini($rpg.dir $+ Prices.ini,VodkaPrice,Vprice),$readini($rpg.dir $+ Prices.ini,VodkaPrice,VPrice),0)
alias rpg.cprices !return $iif($readini($rpg.dir $+ Prices.ini,CigPrice,Cprice),$readini($rpg.dir $+ Prices.ini,CigPrice,CPrice),0)
alias rpg.whores !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Whores),0)
alias rpg.vodka !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Vodka),0)
alias rpg.cig !return $iif($readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs),$readini($rpg.dir $+ Market.ini,$mta.name($1,$2),Cigs),0)
alias rpg.pricechange {
 !writeini -n " $+ $rpg.dir $+ Prices.ini" WhorePrice Wprice $rand(20000,26999)
 !writeini -n " $+ $rpg.dir $+ Prices.ini" VodkaPrice Vprice $rand(12000,19999)
 !writeini -n " $+ $rpg.dir $+ Prices.ini" CigPrice Cprice $rand(27000,32999)
 mta.say $1 Market Prices Have Changed. Go Shop!
}

Link to comment

You know you don't have to check their admin level in every command right?

..and that you can add that big ugly line into an alias.

alias mta.adminlevel !return $readini($scriptdir $+ admin.ini,ADMIN,$mta.name($1,$2))

on *:SIGNAL:mta.command:{
 if ($mta.adminlevel($1,$2) >= 1) {
   if ($3 == !command) { }
   elseif ($3 == !command2) { }
   elseif ($mta.adminlevel($1,$2) >= 2) {
     if ($3 == !command3) { }
   }
 }
}

...etc

Link to comment
  • Recently Browsing   0 members

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