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

Guild Script


mattt183
 Share

Recommended Posts

Alright, I've rewritten the script to add existing guild checking and a filter. You'll have to change some stuff. Just read through it as I've documented it well.

I used a command, as it's easier. Type in /createguild [guild] to make a guild.

Below is the code. Copy and paste it in Commands.ess (or Sub Commands for Eclipse Evolution) right before Case Else.

```
Case "/createguild"
  ' Are they level 20 or more?
  If NOT GetPlayerLevel(index) > 19 Then
      Call PlayerMsg(index, "You must be at least level 20 to create a guild!", BRIGHTRED)
      Exit Sub
  End If
  ' Next IF:
  ' Did they enter a guild?
  ' >Yes.
  '  Continue.
  ' >No.
  '  Send them a message on proper usage, and stop the creation.
  If UBound(TextSay) = 0 Then
      Call PlayerMsg(index, "No guild name entered, use: /createguild [guild].", BRIGHTRED)
      Exit Sub
  End If
  ' Next IF:
  ' Is their guild not allowed?
  ' >Yes.
  '    Exit guild creation.
  ' >No.
  '    Continue.
  ' Notes:
  ' All guild filters should be lowercase.
  ' LCase changes it to lowercase. So Gm or GM will all be viewed as gm.
  ' So GaMe MaSTeR will still be viewed as game master.
  ' To add more, add this right before the Then.
  ' OR LCase(TextSay(1)) = "filter in lowercase here"
  If LCase(TextSay(1)) = "gm" OR LCase(TextSay(1)) = "game master" Then
      Call PlayerMsg(index, "You can't create a guild called " & TextSay(1) & "!", BRIGHTRED)
      Exit Sub
  End If
  ' Define MAX_GUILDS.
  ' Create a For Loop, which searches every guild.
  ' Checks if it exists already, and stops if it does.
  MAX_GUILDS = CInt(GetVar("guilds.ini", "EXISTING", "MAX_GUILDS"))
  For I = 1 To MAX_GUILDS
      If GetVar("guilds.ini", "EXISTING", I) = LCase(TextSay(1)) Then
        Call PlayerMsg(index, "This guild already exists!", BRIGHTRED)
        Exit Sub
      End If
  Next
  ' Add the guild to the guild list, and add 1 to the MAX_GUILDS.
  Call PutVar("guilds.ini", "EXISTING", MAX_GUILDS + 1, LCase(TextSay(1))
  ' Set their guild to what they want, and make them the owners.
  Call PutVar("guilds.ini", "EXISTING", "MAX_GUILDS", MAX_GUILDS + 1)
  Call SetPlayerGuild(index, TextSay(1))
  Call SetPlayerGuildAccess(index, 4)

```
Link to comment
Share on other sites

  • 9 months later...

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