adr990 Posted December 29, 2009 Author Share Posted December 29, 2009 Hey all,I've copied and pasted a few scripts into the right places of my Main.txt.(Some of them needed GodLords Inventory Script. Which I did add. And extra maps with .ini files etc in it.)But I got just small amount of the scripts to work.May you guys could help me out of problems again. :)I post my added/edited stuff in code tabs:```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1 If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest1") = "Have" Then Call playermsg(index, "Empty", 14) Exit Sub End if Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest1", "Have") Call giveplayeritem(index, 1, 1000, 0) Call playermsg(index, "You found 1000gold!", 14) Exit Sub Case 2 If CanTake(Index, 27, 1) Then Call TakeItem(Index, 27, 1) Call PlayerMsg(Index, "You have arrived in Gingerbread kingdom", WHITE) Call Flash(Index,"Boat.swf") Call PlayerWarp(Index, 41, 15, 15) Else Call PlayerMsg(Index, "You need a ticket to go in a boat!!", YELLOW) End If Exit SubCase 3If getplayerlevel(indes) <80 Then Call blockPlayer(index)End if Exit Sub Case 4 Dim Str Dim Def Dim Speed Dim Magi Dim TotalPoints Dim CurrentPoints Str = GetPlayerStr(Index) Def = GetPlayerDef(Index) Speed = GetPlayerSpeed(Index) Magi = GetPlayerMagi(Index) TotalPoints = Str + Def + Speed + Magi CurrentPoints = GetPlayerPoints(Index) Call PlayerLevelUp(Index) Call SetPlayerStr(Index, 0) Call SetPlayerDef(Index, 0) Call SetPlayerSpd(Index, 0) Call SetPlayerMag(Index, 0) Call SetPlayerPoints(Index, CurrentPoints + TotalPoints) Call SendStats(Index) Call PlayerMsg(Index, "Your stat points have been reset. You now have " & GetPlayerPoints(Index) & " points to spend.", WHITE) Exit Sub Case 5 Dim Str Dim Def Dim Spd Dim Mag Dim TotalPoints Dim CurrentPoints Str = GetPlayerSTR(Index) Def = GetPlayerDEF(Index) Spd = GetPlayerSPEED(Index) Mag = GetPlayerMAGI(Index) TotalPoints = Str + Def + Spd + Mag CurrentPoints = GetPlayerPOINTS(Index) Call PlayerLevelUp(Index) Call SetPlayerSTR(Index, 0) Call SetPlayerDEF(Index, 0) Call SetPlayerSPEED(Index, 0) Call SetPlayerMAGI(Index, 0) Call SetPlayerPOINTS(Index, CurrentPoints + TotalPoints) Call SendStats(Index) Call PlayerMsg(Index, "Your stat points have been reset. You now have " & GetPlayerPOINTS(Index) & " points to spend.", 10) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```===================```Sub SetPlayerRealName(Index, name)Call PutVar("accounts" & GetPlayerLogin(Index) & ".ini", "CHAR" & GetPlayerCharNum(Index), "RealName", name)End SubSub OnAttack(index)Dim CheckedChecked = CheckIt(index)If Checked = 1 ThenCall MiningMsg(index, Mine)End IfEnd SubSub GiveItem(index, item, value)SLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = 0 ThenCall SetPlayerInvItemNum(index, SLOT, item)Call SetPlayerInvItemValue(index, SLOT, value)Call SendInventoryUpdate(index, SLOT)SLOT = 24End IfSLOT = SLOT+1LoopEnd SubSub CheckIt(index)Dim MiningSpotXDim MiningSpotYDim iDim memXDim MiningSpotMi = 1Do While i <= GetVar("Skills\Mining.ini", i ,"items")MiningSpotX = GetVar("Skills\Mining.ini", i ,"X")MiningSpotY = GetVar("Skills\Mining.ini", i ,"Y")MiningSpotM = GetVar("Skills\Mining.ini", i ,"MAP")memX = iif GetPlayerMap(index) = MiningSpotM thenif MiningSpotY = Int(GetPlayerY(index) + 1) and MiningSpotX = Int(GetPlayerX(index) + 1) thenCheckIt = 1i = 21elseif MiningSpotY = Int(GetPlayerY(index) - 1) and MiningSpotX = Int(GetPlayerX(index) - 1) thenCheckIt = 1i = 21elseif MiningSpotY = Int(GetPlayerY(index) + 1) and MiningSpotX = Int(GetPlayerX(index) - 1) thenCheckIt = 1i = 21elseif MiningSpotY = Int(GetPlayerY(index) - 1) and MiningSpotX = Int(GetPlayerX(index) + 1) thenCheckIt = 1i = 21elseCheckIt = 0i = Int(memX + 1)end ifend ifloopEnd SubSub MiningMsg(index, stone)Dim iDim MlvDim changeDim itemDim valIf stone = 1 ThenIf GetPlayerWeapon = GetVar("Skills\Mining.ini", i ,"weapon") ThenCall PlayerMsg(index, "You started with mining some ores", 12)i = Rand(1, 10000)Mlv = GetVar("Skills\DB.ini","GetPlayerName(index), "Mining")change = GetVar("Skills\Change.ini", "Mining", Mlv & "-" & i)change = mid(change, 1, 3) & "00"max = GetVar("Skills\max.ini", "Mining", "MMAX")item = GetVar("Skills\Mining.ini", i ,"item")val = GetVar("Skills\Mining.ini", i ,"val")If i >= change ThenCall PlayerMsg(index, "You mining some ores", 12)Call GiveItem(index, item, val)Call SetMiningExperience(index, GetVar("Skills\Mining.ini", i ,"exp"))ElseCall PlayerMsg(index, "You failed with cutting some wood", 12)End IfEnd IfEnd IfEnd SubSub SetMiningExperience(index, exp)Dim MlvDim pexpDim maxDim MmaxMlv = GetVar("Skills\DB.ini","GetPlayerName(index), "Mining")Mmax = GetVar("Skills\max.ini", "Mining", "maxlv")pexp = GetVar("Skills\DB.ini","GetPlayerName(index), "MiningExp")max = GetVar("Skills\max.ini", "Mining", "maxexp" & Mlv)if Int(pexp + exp) > max thenif Mlv < maxlv thenCall PutVar("Skills\DB.ini","GetPlayerName(index), "MiningExp", Int(exp - Int(max - pexp)))Call PutVar("Skills\DB.ini","GetPlayerName(index), "Mining", Int(Mlv + 1))Call PlayerMsg(index, "You gained a Mining level", 12)elseif Mlv = maxlv thenCall PutVar("Skills\DB.ini","GetPlayerName(index), "MiningExp", 0)Call PutVar("Skills\DB.ini","GetPlayerName(index), "Mining", maxlv)end ifelseif Int(pexp + exp) <= max thenCall PutVar("Skills\DB.ini","GetPlayerName(index), "MiningExp", Int(pexp + exp))end ifEnd Sub Function GetFreeSlots(Index) Dim Slot Dim Slots Slot = 1 Slots = 0 Index = Int(Index) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Slots = Slots + 1 End If Slot = Slot + 1 Loop GetFreeSlots = Slots End Function Sub GiveItem(Index, Number, Durability) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Durability = Int(Durability) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemDur(Index, Slot, Durability) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop End Sub Sub GiveCurrency(Index, Number, Amount) Dim Slot Dim CurrentAmount Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemValue(Index, Slot, Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop End Sub Function CanTake(Index, Number, Amount) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CanTake = True Exit Function End If End If Slot = Slot + 1 Loop CanTake = False End Function Sub TakeItem(Index, Number, Amount) Dim Slot Dim CurrentAmount Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) If CurrentAmount <= Amount Then Call SetPlayerInvItemNum(Index, Slot, 0) Call SetPlayerInvItemValue(Index, Slot, 0) Call SetPlayerInvItemDur(Index, Slot, 0) Call SendInventoryUpdate(Index, Slot) Else Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount) Call SendInventoryUpdate(Index, Slot) End If Exit Sub End If End If Slot = Slot + 1 Loop End Sub Function GetFreeSlots(Index) Dim Slot Dim Slots Slot = 1 Slots = 0 Index = Int(Index) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Slots = Slots + 1 End If Slot = Slot + 1 Loop GetFreeSlots = Slots End Function Sub GiveItem(Index, Number, Durability) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Durability = Int(Durability) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemDur(Index, Slot, Durability) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop End Sub Sub GiveCurrency(Index, Number, Amount) Dim Slot Dim CurrentAmount Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemValue(Index, Slot, Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop End Sub Function CanTake(Index, Number, Amount) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CanTake = True Exit Function End If End If Slot = Slot + 1 Loop CanTake = False End Function Sub TakeItem(Index, Number, Amount) Dim Slot Dim CurrentAmount Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) If CurrentAmount <= Amount Then Call SetPlayerInvItemNum(Index, Slot, 0) Call SetPlayerInvItemValue(Index, Slot, 0) Call SetPlayerInvItemDur(Index, Slot, 0) Call SendInventoryUpdate(Index, Slot) Else Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount) Call SendInventoryUpdate(Index, Slot) End If Exit Sub End If End If Slot = Slot + 1 Loop End Sub' Block Player ScriptSub blockPlayer(index) playerdir = GetPlayerDir(index) Select Case playerdir Case 0 Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)+1) Case 1 Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1) Case 2 Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index)+1, GetPlayerY(index)) Case 3 Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index)-1, GetPlayerY(index)) End SelectEnd Sub```^Bottom of Main.txt stuff. (Added Sub stuff)===============```' Executes when a player logs into the game.Sub JoinGame(Index)a If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE) If LenB(MOTD) <> 0 Then Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN) End If Call SendWhosOnline(Index)If GetVar("Skills\DB.ini","GetPlayerName(index), "Mining") = 0 ThenCall PutVar("Skills\DB.ini","GetPlayerName(index), "MiningExp", 0)Call PutVar("Skills\DB.ini","GetPlayerName(index), "Mining", 1)End IfEnd Sub' Executes when a player logs out of the game.Sub LeftGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", YELLOW) End IfEnd Sub```==================I thought that was everything…If you need my full Main.txt I will post it. :)I can get the Chest Script, if stand of Scripted Title (Case 1) working fine. :) Others not.And all other added scripts not at all. :PThanks a lot in advance,Adr990Edit:The Mining script is the Second Mining in this topic:http://www.touchofdeathforums.com/smf/index.php/topic,10888.0.htmlFrom Godlord, directly after the Woodcutting. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted December 29, 2009 Share Posted December 29, 2009 New Scripted Tile:```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1 If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest1") = "Have" Then Call PlayerMsg(index, "Empty", 14) Exit Sub End If Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest1", "Have") Call GivePlayerItem(index, 1, 1000, 0) Call PlayerMsg(index, "You found 1000gold!", 14) Exit Sub Case 2 If CanTake(Index, 27, 1) Then Call TakeItem(Index, 27, 1) Call PlayerMsg(Index, "You have arrived in Gingerbread kingdom", WHITE) Call Flash(Index,"Boat.swf") Call PlayerWarp(Index, 41, 15, 15) Else Call PlayerMsg(Index, "You need a ticket to go in a boat!!", YELLOW) End If Exit Sub Case 3 If GetPlayerLevel(index) < 80 Then Call BlockPlayer(index) End If Exit Sub Case 4 Dim Str Dim Def Dim Spd Dim Mag Dim TotalPoints Dim CurrentPoints Str = GetPlayerSTR(Index) Def = GetPlayerDEF(Index) Spd = GetPlayerSPEED(Index) Mag = GetPlayerMAGI(Index) TotalPoints = Str + Def + Spd + Mag CurrentPoints = GetPlayerPOINTS(Index) Call PlayerLevelUp(Index) Call SetPlayerSTR(Index, 0) Call SetPlayerDEF(Index, 0) Call SetPlayerSPEED(Index, 0) Call SetPlayerMAGI(Index, 0) Call SetPlayerPOINTS(Index, CurrentPoints + TotalPoints) Call SendStats(Index) Call PlayerMsg(Index, "Your stat points have been reset. You now have " & GetPlayerPOINTS(Index) & " points to spend.", 10) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```New bottom of the main.txt thing stuff:```Sub SetPlayerRealName(Index, name)Call PutVar("accounts" & GetPlayerLogin(Index) & ".ini", "CHAR" & GetPlayerCharNum(Index), "RealName", name)End SubSub OnAttack(index)Dim CheckedChecked = CheckIt(index)If Checked = 1 ThenCall MiningMsg(index, Mine)End IfEnd SubSub GiveItem(index, item, value)SLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = 0 ThenCall SetPlayerInvItemNum(index, SLOT, item)Call SetPlayerInvItemValue(index, SLOT, value)Call SendInventoryUpdate(index, SLOT)SLOT = 24End IfSLOT = SLOT+1LoopEnd SubSub CheckIt(index)Dim MiningSpotXDim MiningSpotYDim iDim memXDim MiningSpotMi = 1Do While i <= GetVar("Skills\Mining.ini", i ,"items")MiningSpotX = GetVar("Skills\Mining.ini", i ,"X")MiningSpotY = GetVar("Skills\Mining.ini", i ,"Y")MiningSpotM = GetVar("Skills\Mining.ini", i ,"MAP")memX = iIf GetPlayerMap(index) = MiningSpotM ThenIf MiningSpotY = Int(GetPlayerY(index) + 1) And MiningSpotX = Int(GetPlayerX(index) + 1) ThenCheckIt = 1i = 21ElseIf MiningSpotY = Int(GetPlayerY(index) - 1) And MiningSpotX = Int(GetPlayerX(index) - 1) ThenCheckIt = 1i = 21ElseIf MiningSpotY = Int(GetPlayerY(index) + 1) And MiningSpotX = Int(GetPlayerX(index) - 1) ThenCheckIt = 1i = 21ElseIf MiningSpotY = Int(GetPlayerY(index) - 1) And MiningSpotX = Int(GetPlayerX(index) + 1) ThenCheckIt = 1i = 21ElseCheckIt = 0i = Int(memX + 1)End IfEnd IfLoopEnd SubSub MiningMsg(index, stone)Dim iDim MlvDim changeDim itemDim valIf stone = 1 ThenIf GetPlayerWeapon = GetVar("Skills\Mining.ini", i ,"weapon") ThenCall PlayerMsg(index, "You started with mining some ores", 12)i = Rand(1, 10000)Mlv = GetVar("Skills\DB.ini", GetPlayerName(index), "Mining")change = GetVar("Skills\Change.ini", "Mining", Mlv & "-" & i)change = mid(change, 1, 3) & "00"max = GetVar("Skills\max.ini", "Mining", "MMAX")item = GetVar("Skills\Mining.ini", i ,"item")val = GetVar("Skills\Mining.ini", i ,"val")If i >= change ThenCall PlayerMsg(index, "You mining some ores", 12)Call GiveItem(index, item, val)Call SetMiningExperience(index, GetVar("Skills\Mining.ini", i ,"exp"))ElseCall PlayerMsg(index, "You failed with cutting some wood", 12)End IfEnd IfEnd IfEnd SubSub SetMiningExperience(index, exp)Dim MlvDim pexpDim maxDim MmaxMlv = GetVar("Skills\DB.ini",GetPlayerName(index), "Mining")Mmax = GetVar("Skills\max.ini", "Mining", "maxlv")pexp = GetVar("Skills\DB.ini",GetPlayerName(index), "MiningExp")max = GetVar("Skills\max.ini", "Mining", "maxexp" & Mlv)If Int(pexp + exp) > max ThenIf Mlv < maxlv ThenCall PutVar("Skills\DB.ini",GetPlayerName(index), "MiningExp", Int(exp - Int(max - pexp)))Call PutVar("Skills\DB.ini",GetPlayerName(index), "Mining", Int(Mlv + 1))Call PlayerMsg(index, "You gained a Mining level", 12)ElseIf Mlv = maxlv ThenCall PutVar("Skills\DB.ini",GetPlayerName(index), "MiningExp", 0)Call PutVar("Skills\DB.ini",GetPlayerName(index), "Mining", maxlv)End IfElseIf Int(pexp + exp) <= max ThenCall PutVar("Skills\DB.ini",GetPlayerName(index), "MiningExp", Int(pexp + exp))End IfEnd Sub Function GetFreeSlots(Index) Dim Slot Dim Slots Slot = 1 Slots = 0 Index = Int(Index) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Slots = Slots + 1 End If Slot = Slot + 1 Loop GetFreeSlots = Slots End Function Sub GiveItem(Index, Number, Durability) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Durability = Int(Durability) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemDur(Index, Slot, Durability) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop End Sub Sub GiveCurrency(Index, Number, Amount) Dim Slot Dim CurrentAmount Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemValue(Index, Slot, Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop End Sub Function CanTake(Index, Number, Amount) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CanTake = True Exit Function End If End If Slot = Slot + 1 Loop CanTake = False End Function Sub TakeItem(Index, Number, Amount) Dim Slot Dim CurrentAmount Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) If CurrentAmount <= Amount Then Call SetPlayerInvItemNum(Index, Slot, 0) Call SetPlayerInvItemValue(Index, Slot, 0) Call SetPlayerInvItemDur(Index, Slot, 0) Call SendInventoryUpdate(Index, Slot) Else Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount) Call SendInventoryUpdate(Index, Slot) End If Exit Sub End If End If Slot = Slot + 1 Loop End Sub' Block Player ScriptSub BlockPlayer(index) playerdir = GetPlayerDir(index) Select Case playerdir Case 0 Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)+1) Case 1 Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1) Case 2 Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index)+1, GetPlayerY(index)) Case 3 Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index)-1, GetPlayerY(index)) End SelectEnd Sub```New JoinGame/LeftGame:```' Executes when a player logs into the game.Sub JoinGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE) If LenB(MOTD) <> 0 Then Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN) End If Call SendWhosOnline(Index)If GetVar("Skills\DB.ini",GetPlayerName(index), "Mining") = 0 ThenCall PutVar("Skills\DB.ini",GetPlayerName(index), "MiningExp", 0)Call PutVar("Skills\DB.ini",GetPlayerName(index), "Mining", 1)End IfEnd Sub' Executes when a player logs out of the game.Sub LeftGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", YELLOW) End IfEnd Sub```Enjoy. Link to comment Share on other sites More sharing options...
adr990 Posted December 29, 2009 Author Share Posted December 29, 2009 Woah, that's just great!Thanks a lot man.It's surprising me how this forum is so super help fully if you need help all the time.I can't thank you enough. :)Adr990–-They work, thanks! :)I'm still having problem with the mining stuff though, but I will just read stuff all over again.And check if I did do something wrong in the INI files etc.Great stuff, Soul. Thanks. 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