adamsharp Posted September 9, 2009 Author Share Posted September 9, 2009 okay so if the sub wrong or the case and please correct it for me```Sub Brmi(Index)Dim RR = Rand(1,5) If CanTake(Index, 200, 1) Then Call PlayerMsg(Index,"Attempting to mine...", 0) If R = 1 Then Call PlayerMsg(Index,"Mine successful. Found A Bronze Ore.", 0) Call GiveItem(Index, 201, 1)End If If CanTake(Index, 200, 1) Then Call PlayerMsg(Index,"Attempting to mine...", 0)If R = 2 Then Call PlayerMsg(Index,"Mine successful. Found A Bronze Ore.", 0) Call GiveItem(Index, 201, 1)End If If CanTake(Index, 200, 1) Then Call PlayerMsg(Index,"Attempting to mine...", 0)If R = 3 Then Call PlayerMsg(Index,"Mine successful. Found 2 Bronze Ores!", 0) Call GiveItem(Index, 201, 2)End IfIf CanTake(Index, 200, 1) Then Call PlayerMsg(Index,"Attempting to mine...", 0)If R = 4 ThenCall PlayerMsg(Index,"Failed To Mine Pickaxe Damaged.", 0)End IfIf CanTake(Index, 200, 1) Then Call PlayerMsg(Index,"Attempting to mine...", 0)If R = 5 ThenCall PlayerMsg(Index,"Failed To Mine Pickaxe Damaged.", 0)End If Else Call PlayerMsg(Index,"You don't have a pickaxe", 0)End IfEnd Sub```and the case```Case 3Call Brmi(Index)Exit Sub``` Link to comment Share on other sites More sharing options...
Akselj Posted September 9, 2009 Share Posted September 9, 2009 What is the problem though? Link to comment Share on other sites More sharing options...
adamsharp Posted September 9, 2009 Author Share Posted September 9, 2009 it just doesnt do anything. Link to comment Share on other sites More sharing options...
Akselj Posted September 9, 2009 Share Posted September 9, 2009 What excactly are you doing? What items have you got? I need details! Link to comment Share on other sites More sharing options...
adamsharp Posted September 9, 2009 Author Share Posted September 9, 2009 @AkselJ:> What excactly are you doing? What items have you got? I need details!i dont have a pickaxe and its NOT TELLING ME THAT!The Case Is You Stand On The Tile! Link to comment Share on other sites More sharing options...
Akselj Posted September 9, 2009 Share Posted September 9, 2009 Of course not. Here:```Sub Brmi(Index)Dim RR = Rand(1,5) If CanTake(Index, 200, 1) Then Call PlayerMsg(Index,"Attempting to mine...", 0) If R = 1 Then Call PlayerMsg(Index,"Mine successful! Found a bronze ore.", 0) Call GiveItem(Index, 201, 1) ElseIf R = 2 Then Call PlayerMsg(Index,"Mine successful! Found a bronze ore.", 0) Call GiveItem(Index, 201, 1) ElseIf R = 3 Then Call PlayerMsg(Index,"Mine successful! Found 2 bronze ores!", 0) Call GiveItem(Index, 201, 2) ElseIf R = 4 Then Call PlayerMsg(Index,"Failed to mine, pickaxe damaged!", 0) ElseIf R = 5 Then Call PlayerMsg(Index,"Failed to mine, pickaxe damaged!", 0) End If Else Call PlayerMsg(Index,"You don't have a pickaxe!", 0)End IfEnd Sub```I fixed your player messages aswell ;) Link to comment Share on other sites More sharing options...
adamsharp Posted September 10, 2009 Author Share Posted September 10, 2009 can someone please tell me how to add a skill to this?```Sub Brmi(Index)Dim RR = Rand(1,5) If CanTake(Index, 200, 1) Then Call PlayerMsg(Index,"Attempting to mine...", 0) If R = 1 Then Call PlayerMsg(Index,"Mine successful! Found a bronze ore.", 0) Call GiveItem(Index, 201, 1) ElseIf R = 2 Then Call PlayerMsg(Index,"Mine successful! Found a bronze ore.", 0) Call GiveItem(Index, 201, 1) ElseIf R = 3 Then Call PlayerMsg(Index,"Mine successful! Found 2 bronze ores!", 0) Call GiveItem(Index, 201, 2) ElseIf R = 4 Then Call PlayerMsg(Index,"Failed to mine, pickaxe damaged!", 0) ElseIf R = 5 Then Call PlayerMsg(Index,"Failed to mine, pickaxe damaged!", 0) End If Else Call PlayerMsg(Index,"You don't have a pickaxe!", 0)End IfEnd Sub```so like you cant mine it at mining skill level of 1? Link to comment Share on other sites More sharing options...
kris_hole Posted September 10, 2009 Share Posted September 10, 2009 havnt tested so back up your main before you do ityou would need to have variableslike```Sub Brmi(Index)Dim RR = Rand(1,5) If CanTake(Index, 200, 1) Then If GetVar("skills.ini", "MINING", GetPlayerName(index)) => 1 then Call PlayerMsg(Index,"Attempting to mine...", 0) If R = 1 Then Call PlayerMsg(Index,"Mine successful! Found a bronze ore.", 0) Call GiveItem(Index, 201, 1) ElseIf R = 2 Then Call PlayerMsg(Index,"Mine successful! Found a bronze ore.", 0) Call GiveItem(Index, 201, 1) ElseIf R = 3 Then Call PlayerMsg(Index,"Mine successful! Found 2 bronze ores!", 0) Call GiveItem(Index, 201, 2) ElseIf R = 4 Then Call PlayerMsg(Index,"Failed to mine, pickaxe damaged!", 0) ElseIf R = 5 Then Call PlayerMsg(Index,"Failed to mine, pickaxe damaged!", 0) End If Else Call Playermsg(index, "You must have a mining skill of level 1 to mine here.", RED) End If Else Call PlayerMsg(Index,"You don't have a pickaxe!", 0)End IfEnd Sub```At the bottom of the main.txt then add…```Sub MiningExp(index, EXP)Dim oldexpoldexp = getvar("skills.ini", "MINING", GetPlayerName(Index))Call PutVar("skills.ini", "MININGEXP", GetPlayerName(index), OldExp + Exp)If GetVar("skills.ini", "MININGEXP", GetPlayerName(index)) => 100 ThenCall PutVar("skills.ini", "MININGEXP", GetPlayerName(index), 0)Call PutVar("skills.ini", "MINING", GetPlayerName(index), GetVar("skills.ini", "MINING", GetPlayerName(index)) + 1)End IfEnd Sub```and in OnNewChar(index) add```Call PutVar("skills.ini", "MININGEXP", GetPlayerName(index), 0)Call PutVar("skills.ini", "MINING", GetPlayerName(index), 0)```havnt tested so back up your main before you do it Link to comment Share on other sites More sharing options...
kris_hole Posted September 10, 2009 Share Posted September 10, 2009 hte ini would look something like[MININGEXP]Playername=0[MINING]Playername=0save it as "skills.ini" and put it straight in your server folder Link to comment Share on other sites More sharing options...
adamsharp Posted September 10, 2009 Author Share Posted September 10, 2009 Debugg This For Me Please!```Sub Brmi(Index)Dim RR = Rand(1,5)If GetVar("skills.ini", "MINING", GetPlayerName(index)) => 1 then If CanTake(Index, 200, 1) Then Call PlayerMsg(Index,"Attempting to mine...", 10) If R = 1 Then Call PlayerMsg(Index,"Mine successful! Found a bronze ore.", 10) Call GiveItem(Index, 201, 1)End If If R = 2 Then Call PlayerMsg(Index,"Mine successful! Found a bronze ore.", 10) Call GiveItem(Index, 201, 1)End If If R = 3 Then Call PlayerMsg(Index,"Mine successful! Found 2 bronze ores!", 10) Call GiveItem(Index, 201, 2)End If If R = 4 Then Call PlayerMsg(Index,"Failed to mine, pickaxe damaged!", 12)End If If R = 5 Then Call PlayerMsg(Index,"Failed to mine, pickaxe damaged!", 12) End If Else Call PlayerMsg(Index,"You don't have a pickaxe!", 12)End IfEnd SubSubMiningExp(index, EXP) Dim oldexp oldexp = getvar("skills.ini", "MINING", GetPlayerName(Index)) Call PutVar("skills.ini", "MININGEXP", GetPlayerName(index), OldExp + Exp) If GetVar("skills.ini", "MININGEXP", GetPlayerName(index)) => 100 Then Call PutVar("skills.ini", "MININGEXP", GetPlayerName(index), 0) Call PutVar("skills.ini", "MINING", GetPlayerName(index), GetVar("skills.ini", "MINING", GetPlayerName(index)) + 1) End If End Sub ``` Link to comment Share on other sites More sharing options...
JayT Posted September 11, 2009 Share Posted September 11, 2009 just ran it through sadscript checker and all seems fine. though if you dont have the .ini already created on char create you may need to check that its there first and if not create it with PutVar Link to comment Share on other sites More sharing options...
Owen F Posted September 11, 2009 Share Posted September 11, 2009 Yah, but he just thinks Kris's script is better.Dude, go with the working script, both of them ARE THE SAME Link to comment Share on other sites More sharing options...
adamsharp Posted September 11, 2009 Author Share Posted September 11, 2009 I WANT TO MAKE IT SO YOU NEED HIGER THAN LEVEL ONE TO MINE THIS ROCK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Link to comment Share on other sites More sharing options...
JayT Posted September 11, 2009 Share Posted September 11, 2009 then instead of => 1 use > 0 Link to comment Share on other sites More sharing options...
Akselj Posted September 11, 2009 Share Posted September 11, 2009 No, you'd use > 1\. Besides it's >= not => Link to comment Share on other sites More sharing options...
JayT Posted September 11, 2009 Share Posted September 11, 2009 ah, sorry read it wrong and i think i was playing Kryce while i was reading it xD Link to comment Share on other sites More sharing options...
kris_hole Posted September 11, 2009 Share Posted September 11, 2009 => or >= they'd do the same job :Pand mine worked fine but you've changed it. you need to put the End If back for If Getvar(blah blah) and it should work.also make sure the .ini exists and that you have set it up right. Link to comment Share on other sites More sharing options...
Akselj Posted September 11, 2009 Share Posted September 11, 2009 But >= is correct! Syntax is important. Link to comment Share on other sites More sharing options...
kris_hole Posted September 11, 2009 Share Posted September 11, 2009 it would still work :P 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