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

Where I have to put this?


NiceLoki
 Share

Recommended Posts

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
Link to comment
Share on other sites

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!
Link to comment
Share on other sites

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.
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...