Posted: Fri Sep 07, 2012 5:10 pm
ah sorry yes.. *send was the one i meant.
http://theuniversal.net/forumrestore/phpBB3/
http://theuniversal.net/forumrestore/phpBB3/viewtopic.php?t=9242
Code: Select all
$gPlayerVar[1] = 10
Code: Select all
*setplayervar Mit 1 10
Code: Select all
Event( "AccessBuilding", "1" )
{
$nextValidAccess = $gPlayerVar [1]
if ( $gPlayerNumDeaths >= $nextValidAccess )
{
osdcreate(OSDLIST, "FOR TESTING", "Blah" )
osdadditem(OSDBUTTON, "FT1", "blah blah" )
osdactivate()
}
else
{
osdcreate(OSDLIST, "BLAH", "IT WORKED" )
osdadditem(OSDEXITBUTTON, "EXIT", "OK" )
osdactivate()
}
}
EVENT(OSDSELECT, "FOR TESTING:FT1")
{
$gPlayerVar [1] = $gPlayerDeaths + 1
osdcreate(OSDLIST, "just a list", "TEST" )
osdadditem(OSDEXITBUTTON, "EXIT", "OK" )
osdactivate()
}
Code: Select all
Event("AccessBuilding", "4")
{
if (Playerinventory gold >= 3)
{
osdcreate(OSD......if u do have anuff gold add osd for it here
}
else
{
osdcreate(osd......other wis add the osd for not haveing anuff here
}
}
Code: Select all
Event("AccessBuilding", "5")
{
osdcreate(osdlist, "equipment", "Goods")
osdadditem(OSDMINHEIGHT, "",450)
osdadditem(OSDBIGTEXT, "", "click the item you want to buy.")
{
$silverCount = sysPlayerInventory("silver coins")
if ($silverCount >= 1)
{
osdaddat(OSDIMAGE, 5, 5, 50, 50, "buy sword", "image site here")
}
else
{
osdaddat(OSDFADDEDIMAGE, 5, 5, 50, 50, "", "image site here")
}
}
THEN
{
IF ($silverCount >= 3)
{
osdaddat(OSDIMAGE, 60, 60, 50, 50, "buy armer", "image site here")
}
else
{
osdaddat(OSDFADDEDIMAGE, 60, 60, 50, 50, "", "image site here")
}
}
osdactivate()
}
Code: Select all
Event("AccessBuilding", "5")
{
$silverCount = sysPlayerInventory("silver coins")
osdcreate(osdlist, "equipment", "Goods")
osdadditem(OSDMINHEIGHT, "",450)
osdadditem(OSDBIGTEXT, "", "click the item you want to buy.")
if ($silverCount > 0)
{
osdaddat(OSDIMAGE, 5, 5, 50, 50, "buy sword", "image site here")
}
if ($silverCount < 1)
{
osdaddat(OSDFADDEDIMAGE, 5, 5, 50, 50, "", "image site here")
}
if ($silverCount > 2)
{
osdaddat(OSDIMAGE, 60, 60, 50, 50, "buy armor", "image site here")
}
if ($silverCount < 3)
{
osdaddat(OSDFADDEDIMAGE, 60, 60, 50, 50, "", "image site here")
}
osdactivate()
}
Code: Select all
EVENT("accessbuilding", "5")
{
$gPlayerVar[20] = rand 5
$swordCount = sysPlayerInventory("sword")
if ($swordCount >= 1)
{
$gPlayerVar[20] + 15
}
$armorCount = sysPlayerInventory("armor")
if ($armorCount >= 1)
{
$gplayerver[20] + 5
}
if ($gplayerver[20] = 25 )
{
*msg %player% !!PERFICT HIT!!
}
if ($gplayerver[20] >= 20 )
{
*msg %player% !!20 and up!!
}
if ($gplayerver[20] >= 15 )
{
*msg %player% !!15 and up!!
}
if ($gplayerver[20] >= 10 )
{
*msg %player% !!10 and up!!
}
if ($gplayerver[20] >= 5 )
{
*msg %player% !!5 and up!!
}
if ($gplayerver[20] < 5 )
{
*msg %player% !!not evan 5!!
}
}
Code: Select all
EVENT("accessbuilding", "5")
{
$gPlayerVar[20] = rand 5
$swordCount = sysPlayerInventory("sword")
$armorCount = sysPlayerInventory("armor")
if ($swordCount >= 1)
{
$gPlayerVar[20] = $gPlayerVar[20] + 15
if ($armorCount >= 1)
{
$gPlayerVar[20] = $gPlayerVar[20] + 5
CustomEvent( "building5" )
}
else
{
CustomEvent( "building5" )
}
}
else
{
*msg %player% You need a sword!
}
}
Event("Custom","building5")
{
if ($gplayerver[20] = 25 )
{
*msg %player% !!PERFICT HIT!!
}
else if ($gplayerver[20] >= 20 )
{
*msg %player% !!20 and up!!
}
else if ($gplayerver[20] >= 15 )
{
*msg %player% !!15 and up!!
}
else if ($gplayerver[20] >= 10 )
{
*msg %player% !!10 and up!!
}
else if ($gplayerver[20] >= 5 )
{
*msg %player% !!5 and up!!
}
else
{
*msg %player% !!not evan 5!!
}
}
http://theuniversal.net/worldmanual/dok ... sic_syntax already has your answer:zaroba wrote:It might also be due to the playervar20+# lines. Mit would have to confirm whether or not that works by itself or if it actually has to be playervar20=playervar20+#
Besides, even in C you'd need to use += rather than just +Basic maths operators are supported in simple form. Compound operations are not yet supported so each line needs to be kept basic, e.g. :Code: Select all
$var = $var + 1 $newvar = $var * 100
Code: Select all
EVENT("accessbuilding", "5")
{
$gPlayerVar[20] = rand 5
$swordCount = sysPlayerInventory("sword")
$armorCount = sysPlayerInventory("armor")
if ($swordCount >= 1)
{
if ($armorCount >= 1)
{
CustomEvent( "battle4" )
}
else
{
CustomEvent( "battle2" )
}
}
else if ($armorCount >= 1)
{
if ($swordCount >= 1)
{
CustomEvent( "battle4" )
}
else
{
CustomEvent( "battle3" )
}
}
else
{
CustomEvent( "battle1" )
}
}
Event("Custom","battle1")
{
if ($gplayervar[20] >= 3 )
{
*msg %player% !!WIN!!
}
else
{
*msg %player% lose
}
}
Code: Select all
EVENT("playerlogin", "")
{
sleep(300)
CustomEvent( "Random1" )
}
-----------------------------------------------------
EVENT("Custom", "Random1")
{
$IT = sysrand(3)
if ($IT = 1)
{
OSD here
}
else if ($IT = 2)
{
OSD here
}
else
{
OSD here
}
}
---------------------------------------------------------------
Event("OSDSELECT", "Pyron Incounter:1")
{
CustomEvent("combat")
sleep(10)
CustomEvent( "Random1" )
}
-----------------------------------------------------------------
Event("OSDSELECT", "Pyron Incounter:2")
{
sleep(11)
CustomEvent( "Random1" )
}