A slot machine
Posted: Wed Jan 09, 2008 2:15 am
Here is a piece of my slot machine for 420. If anyone has suggestions to make it shorter or only use one item let me know.
Event( "UseItem", "100s chips" )
{
if ( playerinventory("prize 2") > 0 )
{
canceltransaction()
*command=msg %player% you must use your last prize in order to bet again
}
else if ( playerinventory("100s chips") > 6 )
{
$i = rand(30)
*command=setplayervar %player% 4 $i
*command=msg %player% use prize 2 item to see if you win.
*command=grantitem %player% 1 prize 2
}
else
{
canceltransaction()
*command=msg %player% You must have more than 6 100s chips to place a bet.i
}
}
Event( "UseItem", "prize 2" )
{
if ( $playervar4 = 1 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 2 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 3 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 4 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 5 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 6 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 7 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 8 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 9 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 10 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 11 )
{
*command=grantcash %player% 170000
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 12 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 13 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 14 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 15 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 16 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 17 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 18 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 19 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 20 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 21 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 22 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 23 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 24 )
{
*command=grantcash %player% 170000
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 25 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 26 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 27 )
{
*command=msg %player% you lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 28 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 29 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 30 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( playerinventory("100s chips") < 6 )
{
canceltransaction()
*command=msg %player% you must keep at least 6 100s chips in your inventory before collecting prize.
}
else
{
canceltransaction()
*command=msg %player% either you should not have this or you're moving too fast! %player%
}
}
Event( "UseItem", "100s chips" )
{
if ( playerinventory("prize 2") > 0 )
{
canceltransaction()
*command=msg %player% you must use your last prize in order to bet again
}
else if ( playerinventory("100s chips") > 6 )
{
$i = rand(30)
*command=setplayervar %player% 4 $i
*command=msg %player% use prize 2 item to see if you win.
*command=grantitem %player% 1 prize 2
}
else
{
canceltransaction()
*command=msg %player% You must have more than 6 100s chips to place a bet.i
}
}
Event( "UseItem", "prize 2" )
{
if ( $playervar4 = 1 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 2 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 3 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 4 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 5 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 6 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 7 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 8 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 9 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 10 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 11 )
{
*command=grantcash %player% 170000
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 12 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 13 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 14 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 15 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 16 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 17 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 18 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 19 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 20 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 21 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 22 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 23 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 24 )
{
*command=grantcash %player% 170000
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 25 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 26 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 27 )
{
*command=msg %player% you lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 28 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 29 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 30 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( playerinventory("100s chips") < 6 )
{
canceltransaction()
*command=msg %player% you must keep at least 6 100s chips in your inventory before collecting prize.
}
else
{
canceltransaction()
*command=msg %player% either you should not have this or you're moving too fast! %player%
}
}