mydas
09-24-2005, 21:06
taken from superheromod.sma
public addXP()
{
new szid[4]
new szvictim[4]
new szmult[10]
read_argv(1,szid,3)
read_argv(2,szvictim,3)
read_argv(3,szmult,9)
new id = str_to_num(szid)
new victim = str_to_num(szvictim)
new mult = str_to_num(szmult)
//stupid check - but checking prevents crashes
if ( id <= 0 || id > 32 || victim <= 0 || victim > 32 ) return
localAddXP(id, mult * gXPGiven[ gPlayerLevel[victim] ] )
displayPowers(id, false)
we have "new mult = str_to_num(szmult)" ... so the multiplier is an integer. i think it should be a float ... i've come to be disabled for the second time in hero scripting because it isn't. what if i let's say i wanna make a hero get 1.5 xp for kills ? is that doable as superheroes is now ?
public addXP()
{
new szid[4]
new szvictim[4]
new szmult[10]
read_argv(1,szid,3)
read_argv(2,szvictim,3)
read_argv(3,szmult,9)
new id = str_to_num(szid)
new victim = str_to_num(szvictim)
new mult = str_to_num(szmult)
//stupid check - but checking prevents crashes
if ( id <= 0 || id > 32 || victim <= 0 || victim > 32 ) return
localAddXP(id, mult * gXPGiven[ gPlayerLevel[victim] ] )
displayPowers(id, false)
we have "new mult = str_to_num(szmult)" ... so the multiplier is an integer. i think it should be a float ... i've come to be disabled for the second time in hero scripting because it isn't. what if i let's say i wanna make a hero get 1.5 xp for kills ? is that doable as superheroes is now ?