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

A little help at vb6


Warden
 Share

Recommended Posts

Hello,well i wanted to learn some scripting so umh i added the lines so if you get leveled up it will make a animation for sec so everybody could see,but when i compile it,it says Variable not defined,so how can i define?

> …...........
>
>     If level_count > 0 Then
>         If level_count = 1 Then
>             'singular
> ERROR HERE            x = GetPlayerX(index)
> ERROR HERE          y = GetPlayerY(index)
>             GlobalMsg GetPlayerName(index) & " has gained " & level_count & " level!", Brown
>             Call SendAnimation(GetPlayerMap(index), 62, x, y)
>            
>         Else
>             'plural
>             GlobalMsg GetPlayerName(index) & " has gained " & level_count & " levels!", Brown
>             Call SendAnimation(GetPlayerMap(index), 62, x, y)
>         End If
>         SendEXP index
>         SendPlayerData index
>     End If
> End Sub
Link to comment
Share on other sites

@Smore:

> Its not scripting, its coding. Scripting is in a notepad :P

@GKO:

> soo up at the top of the sub add this
>
> GetPlayerX as string
> GetPlayerY as string
>
> Or it might be this not sure
>
> PlayerX as string
> PlayerY as string

No.

```
Sub foobar ()
Dim x as Integer
Dim y as Integer
' code here
End Sub
```
Link to comment
Share on other sites

yes thats it, i thought that looked funny. ive been working with php for the past couple weeks soo im getting a little mixed up

Edit:
and FYI you might wanna lock this topic or we might get some flaming on our hands.
Link to comment
Share on other sites

> If level_count > 0 Then
>         If level_count = 1 Then
>             'singular
>             Dim x As Long
>             Dim y As Long
>             x = GetPlayerX(index)
>             y = GetPlayerY(index)
>        
>             GlobalMsg GetPlayerName(index) & " has gained " & level_count & " level!", Brown
>             Call SendAnimation(GetPlayerMap(index), 62, x, y)
>            
>         Else
>             'plural
>             GlobalMsg GetPlayerName(index) & " has gained " & level_count & " levels!", Brown
>             Call SendAnimation(GetPlayerMap(index), 62, x, y)
>         End If
>         SendEXP index
>         SendPlayerData index
>     End If
> End Sub

like that?if thats right it aint working
Link to comment
Share on other sites

@Warden:

> like that?if thats right it aint working

Jesus, please be more informative.
'It aint working' isn't going to tell us nothing. What is it doing? Is there an error?

Also;

```
Dim x As Long
Dim y As Long

    ' Set the coordinates
    x = GetPlayerX(index)
    y = GetPlayerY(index)

    If level_count > 0 Then
        If level_count = 1 Then
            'singular
            GlobalMsg GetPlayerName(index) & " has gained " & level_count & " level!", Brown
            Call SendAnimation(GetPlayerMap(index), 62, x, y)

        Else
            'plural
            GlobalMsg GetPlayerName(index) & " has gained " & level_count & " levels!", Brown
            Call SendAnimation(GetPlayerMap(index), 62, x, y)
        End If
        SendEXP index
        SendPlayerData index
    End If
End Sub

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