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

Calling a sub


Warconn
 Share

Recommended Posts

hey i have a sub with a "str" case that i need to run

i am using```
Call Warconn_PlayerDevSystem(index,"str")

```  in my onattack sub

when i attack it is suppost to say "this is working" at the very beginning, but nothing comes up.

do i have the right commands, or what should i put

the name of the sub is Warconn_PlayerDevSystem

thanks
Link to comment
Share on other sites

```

'||||||||||||||||||||||||||||||||
Sub Warconn_PlayerDevSystem(index,"str")
'||||||||||||||||||||||||||||||||

Dim counter1
Dim x
Dim points

counter1=GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "PlayerDevSystem", "str")
counter1= counter1+1
Call PlayerMsg(index, "this should be working", 13)
Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "PlayerDevSystem", "str", Int(counter1) )

Select Case script
  Case "str"
    If counter1 < 20 Then
      Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "PlayerDevSystem", "str", Int(counter1) )
    Else
      Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 1)
      Call BattleMsg(index, "Your strength has increased due to frequent practice.", 12, 1)

    End If
  End Select
End Sub

```
thanks
Link to comment
Share on other sites

```
'||||||||||||||||||||||||||||||||
Sub Warconn_PlayerDevSystem(index, PType)
'||||||||||||||||||||||||||||||||

Dim counter1
Dim x
Dim points

Call PlayerMsg(index, "this should be working", 13)

Select Case PType
  Case "str"
    counter1= int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "PlayerDevSystem", "str")) + 1
    If counter1 < 20 Then
      Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "PlayerDevSystem", "str", Int(counter1) )
    Else
      Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 1)
      Call BattleMsg(index, "Your strength has increased due to frequent practice.", 12, 1)
      Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "PlayerDevSystem", "str", 0)
    End If
  End Select
End Sub

```
There I fixed it up for you, Very nice attempt though. Its nice to see someone try before they ask question :)

Edit: I just moved some more stuff around so that it does what I think your going for
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...