Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Getvar type mismatch every time-Solved


ThePrax
 Share

Recommended Posts

Hi,
at first, im german, so my english is maybe not the best.

My problem is, i just try to check for greater than with following values :

if GetPlayerLevel(index) >= getvar("Skills\" & Skillname & ".ini", "Skill","reqlevel") then …

i use the server debugging tool, you can turn on in the data.ini.

i get every time the same error : type mismtch, but nothing works,
i tryed every convertion, such as CInt(),CStr(),CDbl(),CLng(),...

if i print out the values, i get playerlevel = 33 and reqlevel=5 but it does not work, if i try to convert, i get an error "mismatch", and if i do nothing, i get 33 is smaler than 5.

Someone an idea?

thanks

ThePrax
Link to comment
Share on other sites

@ThePrax:

> Hi,
> at first, im german, so my english is maybe not the best.
>
> My problem is, i just try to check for greater than with following values :
>
> if GetPlayerLevel(index) >= getvar("Skills\" & Skillname & ".ini", "Skill","reqlevel") then …
>
> i use the server debugging tool, you can turn on in the data.ini.
>
> i get every time the same error : type mismtch, but nothing works,
> i tryed every convertion, such as CInt(),CStr(),CDbl(),CLng(),...
>
> if i print out the values, i get playerlevel = 33 and reqlevel=5 but it does not work, if i try to convert, i get an error "mismatch", and if i do nothing, i get 33 is smaler than 5.
>
> Someone an idea?
>
> thanks
>
> ThePrax

It sounds like you know what you are doing, and it looks like you've got things set up right, so I'm not seeing a problem. This is odd.

Adding this into my own main.txt works, so I have no idea what's up. What version are you using? I don't know if that will have anything to do with it, but it's good to know, just in case.
Link to comment
Share on other sites

Hi,  i got it, everytime i used the getVar() command inner if-then architecture it doesnt work, also i used an variable in the Filename like :

getvar("Scripts\Charextras\" & Playername & "_Skills.ini", CStr(trim(Skillname)), "kann")

it must be

getvar("Scripts\Charextras\" & CStr(trim(Playername)) & "_Skills.ini", CStr(trim(Skillname)), "kann")

at least.

man, so many hours for searching the bug,…
now it works, and i have hardcoded my own skillsystem in EE2.7

its harder than my minimap-system, or my questsystem, but now i can make as many skills as i want.

thanks allot for your help!

greetz ThePrax
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...