when I use this code i get an error when I play the game
runtime error: type mismatch
proc name: Spend (/mob/proc/Spend)
usr: Jus (/mob/Player)
src: Jus (/mob/Player)
call stack:
Jus (/mob/Player): Spend()
OK (/obj/hud/Borders/OK): Click(Grass2 (4,2,1) (/turf/Grass2))
for this code
mob
proc
Spend()
if(usr.canspend>=0)
switch(input("Please choose something to spend on. [usr.canspend] points to use")in list("HP","MP","Strength","Defense","Agility","Inteligence"))
if("HP")
usr.HP += 3
usr.canspend -= 1
if("MP")
usr.MP += 3
usr.canspend -= 1
if("Strength")
usr.Strength += 3
usr.canspend -= 1
if("Defense")
usr.Defense += 3
usr.canspend -= 1
if("Agility")
usr.Agility += 3
usr.canspend -= 1
if("Inteligence")
usr.Inteligence += 3
usr.canspend -= 1
HELP!!
ID:261989
Apr 20 2004, 1:49 am
|
|
In response to Lummox JR
|
|
i tried using src and not putting anythingy but I still get the type mismatch error :( Ungh,
|
In response to Dark_Prince101
|
|
Dark_Prince101 wrote:
i tried using src and not putting anythingy but I still get the type mismatch error :( Ungh, Look at what the error's telling you. Type mismatch, meaning you're pairing up two different types along the way, most likely comparing a number to a text string, or a mob to a list, mob to a number, mob to a text string, etc... |
In response to Goku72
|
|
Turning on debug mode would help, so you can see line numbers. (Build -> Preferences).
|
In response to Crispy
|
|
Ok. But I still dont have a solution for my problem do I use usr? src? what do I do?? I keep getting the same error!
|
In response to Dark_Prince101
|
|
You use src. And you need to post the error message, with the line number, and point out which line that is. Then we can go from there. =)
|
In response to Crispy
|
|
I get this error when I select HP,MP,Strength,etc any of those then this error pops up
runtime error: type mismatch proc name: Spend (/mob/proc/Spend) source file: Login.dm,213 usr: Justin (/mob/Player) src: Justin (/mob/Player) call stack: Justin (/mob/Player): Spend() OK (/obj/hud/Borders/OK): Click(Grass2 (4,2,1) (/turf/Grass2)) so its line 213 when i select hp the usr.HP += 1 or usr.MP += 1 gets the error.gtg to school post more later |
Lummox JR