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

New player problems


Recommended Posts

Ok if its  a first login then they get an intro and then they get enough xp to level up well for soem reason my char says 25/5 xp heres my join sub

If GetPlayerLevel(index) = 1 Then
  If GetPlayerEXP(index) = 0 Then
Call CustomMenuShow(index, "new player index", "\GUI\CUSTOM\Intro.bmp", 1)
  Call SetPlayerEXP(index, 1)
Call SendPlayerData(Index)
End if
End if

If GetPlayerLevel(index) = 1 Then
Call SetPlayerExp(Index, GetPlayerExp(Index) + 5)
Call SendPlayerData(Index)
End If

End Sub
Link to comment
Share on other sites

Is all you want to do, is show that custom menu when the player logs in for the first time?  Because there's an easier way, using inis, e.g.

```
If GetVar("FirstTime.ini", GetPlayerLogin(Index) & "", GetPlayerName(Index) & "") = "" Then
  Call CustomMenuShow(index, "new player index", "\GUI\CUSTOM\Intro.bmp", 1)
  Call PutVar("FirstTime.ini", GetPlayerLogin(Index) & "", GetPlayerName(Index) & "", "1")
End If
```
Or, you can use the onNewChar sub or w/e it's called, but then the custom menu will display as soon as you create a new character.

@[Kingdom's:

> Tipsta link=topic=47372.msg484262#msg484262 date=1246423787]
> no else cases ?

Hey, I was asleep!
Link to comment
Share on other sites

If you want them to level up once they have enough experience, you need to add Call LevelUp(Index) after you set their experience.  It'll only level the player up if they have enough experience, so you could put it anywhere a player gains experience for any reason and not have to worry.
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...