teh jimpie Posted January 4, 2010 Author Share Posted January 4, 2010 Hello,I need some help with placing this script, i fail at timers -.-In sub tmrtest```Sub tmrTest(Index, script)'====================================Dim GuildnameDim CharnumDim LoginDim MaxOn Error Resume NextSelect Case ScriptCase 0If Getvar("scripts\Charextras\" & GetPlayerName(index) & ".ini", "Status", "Freeze") = "1" thenCall LockPlayer(index, 0)call playermsg(index, "Now you can move again!", 10)Call RemoveTimer("tmrtest " & index & "," & 3)End IfEnd SelectEnd Sub```in scripted spells:```target = GetplayerTarget(index)If target > 0 ThenCall Putvar("scripts\Charextras\" & GetPlayerName(target) & ".ini", "Status", "Freeze", "1")Call SetTimer("tmrtest " & target & "," & 3, 20000)Call LockPlayer(target, 1)Call LockSpells(target, 1)Call LockItems(target, 1)Call LockAttack(target, 1)Call playermsg(target, "You have been frozen!", 4)ElseExit SubEnd If```It actually gives error, something with the "close" too, (end if, exit sub i think)please help me. Link to comment Share on other sites More sharing options...
cloudwolf00 Posted January 4, 2010 Share Posted January 4, 2010 HelloReplace the tmrtest with this:```Sub tmrTest(Index, script)'====================================Dim GuildnameDim CharnumDim LoginDim MaxOn Error Resume NextSelect Case ScriptCase 0 If Getvar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "Status", "Freeze") = "1" Then Call LockPlayer(Index, 0) call playermsg(Index, "Now you can move again!", 10) Call RemoveTimer("tmrtest " & Index & "," & 3) End If Exit SubEnd SelectEnd Sub```Your didn't put a capital letter for "Then", nor an "Exit Sub" terminator after the "Case" statement.Nowe replace the scripted spell with:```Dim targettarget = GetplayerTarget(index)If target > 0 Then Call Putvar("Scripts\Charextras\" & GetPlayerName(target) & ".ini", "Status", "Freeze", "1") 'NOT SURE WHY YOU ARE CALLING SCRIPT 3 HERE WHEN YOU DON'T HAVE A SCRIPT 3 CASE IN YOUR TIMER SUB THAT YOU POSTED 'CHECK THAT YOU MEAN SCRIPT 3 OTHERWISE THIS MAY CAUSE AN ERROR Call SetTimer("tmrtest " & target & "," & 3, 20000) Call LockPlayer(target, 1) Call LockSpells(target, 1) Call LockItems(target, 1) Call LockAttack(target, 1) Call playermsg(target, "You have been frozen!", 4)Else Exit SubEnd If```Let me know if this fixes that error!Yours sincerelycloudwolf00 Link to comment Share on other sites More sharing options...
teh jimpie Posted January 4, 2010 Author Share Posted January 4, 2010 Ye, not sure about case 3 -.-my questions was actually about the "cases" =.= see title of this topic.again; i edit the scripts abit too.```Case 29If CanTake(Index, 103, 6) And CanTake(Index, 106, 4) And CanTake(Index, 107, 2) = True Thentarget = GetplayerTarget(index)If target > 0 Then Call Putvar("Scripts\Charextras\" & GetPlayerName(target) & ".ini", "Status", "Freeze", "1") Call SetTimer("tmrtest " & target & "," & 3, 20000) Call LockPlayer(target, 1) Call playermsg(target, "You have been frozen!", 4) Call TakeItem(Index, 103, 6) Call TakeItem(Index, 106, 4) Call TakeItem(Index, 107, 2)End IfEnd IfExit Sub```And; do i have to make for sub tmrtest a new .ess file and put it in that, or just in my main.ess. I prefer in a new .ess file if thats possible (not if you got to do alot other things)```Sub tmrTest(Index, script)'====================================Dim GuildnameDim CharnumDim LoginDim MaxOn Error Resume NextSelect Case ScriptCase 0 If Getvar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "Status", "Freeze") = "1" Then Call LockPlayer(Index, 0) call playermsg(Index, "Now you can move again!", 10) Call RemoveTimer("tmrtest " & Index & "," & 3) End If Exit SubEnd SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now