Where I have to put this?

Hí! In my game I put a little guide wich how up when u write “/guide” but, I want it to show up when the player level is under 10 I know this is de code:

If GetPlayerLevel ( Index ) <= 10 then
frmGuide.Visible = True
else
End if

But I don´t know where I have to put it so it turn into visible when the player log in the game…. Can anyone help me? xD thanks! :3

look for modInput. there should be a sub there for all of the commands, go from there

look for modInput. there should be a sub there for all of the commands, go from there

Nope, Read again…. I already put the comand “/guide”, now I want the guide to show up when a player less than level 10 login…

HandleLoginOk i guess

HandleLoginOk i guess

Nope, it Start before than the game then… 😕 I want it to first show the frmMain and then the guide…

Go to sub GameLoop, below this line : If Options.Debug = 1 Then On Error GoTo errorhandler, put this:

If GetPlayerLevel ( Index ) <= 10 then
frmGuide.Visible = True
frmGuide.SetFocus
End if

:3!

Works! Thanks!!! - U´re my hero!

Go to sub GameLoop, below this line : If Options.Debug = 1 Then On Error GoTo errorhandler, put this:

If GetPlayerLevel ( Index ) <= 10 then
frmGuide.Visible = True
frmGuide.SetFocus
End if

:3!

Find the sub which handles the showing of frmMain. That’s where you put your code. Please note that this sub has to be after the player data is received, otherwise it will always appear.

Furthermore, you can optimize your code to something like this


if GetPlayerLevel(index) <= 10 then frmGuide.visible = true

or this.

if GetPlayerLevel(index) <= 10 then
frmguide.visible = true
end if 

You should only put there else if you actually put there a line for the program to run, otherwise it’s just a waste.

Log in to reply