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

Events system : GetEventName


Mistlight
 Share

Recommended Posts

This is regarding the events system. I'm trying to make a custom code to get the event's name, how do i do that? Could anyone help me?

I tried doing it myself but it highlighted "Public Sub CustomScript(index As Long, caseID As Long)" and said "Compile error: ByRef argument type mismatch. What does that mean?

This is how my CustomScript looks like.
```
Public Sub CustomScript(index As Long, caseID As Long)
    Select Case caseID
        Case 0
            mapnum = GetPlayerMap(index)
            filename = App.Path & "\data\maps\map" & mapnum & "_eventdata.dat"
            GetVar filename, "Events", "EventCount", Val(Map(mapnum).EventCount)
            If Map(mapnum).EventCount > 0 Then
            For i = 1 To Map(mapnum).EventCount
            With Map(mapnum).Events(i)
            GetVar filename, "Event" & i, "Name", .Name

        Case Else
            PlayerMsg index, "You just activated custom script " & caseID & ". This script is not yet programmed.", BrightRed
    End Select
End Sub
```
Link to comment
Share on other sites

Why are you getting the information for the ini? It is already loaded into the memory…. I have no idea what you are trying to do but you can get the name of an event like this...
```
name = Map(GetPlayerMap(index)).Events(1).Name
```
That, for example would return the name of event 1 on the map the player is on.
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...