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

[EO 2.0/3.0] Guilds


Scott
 Share

Recommended Posts

  • Replies 328
  • Created
  • Last Reply

Top Posters In This Topic

Can i add a system on it that players just create guild if they has 10000 Golds on inventory?
Like this system i created and think it works, but where i add this code for players just create if they have money?

–----------------------------------------------
If HasItem(index, 1) Then
Call TakeInvItem(index, 1, 1)
Else
SendPlayerMsG(MyIndex) = "You dont have money to create guild"
Link to comment
Share on other sites

@Meteor:

> My client crashes, appcrash, after I made a guild. And now everytime i login with that account the client crashes.

Need more information than that, what engine where you using?  You need to delete accounts that where made before you installed the Guild system.
Link to comment
Share on other sites

First it crashed when starting the client. Then after I deleted the accounts and maps, I could run it.

But when I typed /guild make name

The exact moment I pressed enter the client crashed, and now I can't login with that account or any other account. It crashes when I do so.

It worked again though after I deleted the guild file.

I have Windows 7 64 bit.
Link to comment
Share on other sites

@wyvern640:

> Can i add a system on it that players just create guild if they has 10000 Golds on inventory?
> Like this system i created and think it works, but where i add this code for players just create if they have money?
>
> –----------------------------------------------
> If HasItem(index, 1) Then
> Call TakeInvItem(index, 1, 1)
> Else
> SendPlayerMsG(MyIndex) = "You dont have money to create guild"

yea that also neeed me xD
Link to comment
Share on other sites

@Meteor Rain Try to re-install it, if that does not work zip the server/client and send it to me I'm curious to get to the bottom of the problem.

@Cost for guild
In **Sub MakeGuild** after:
```
    If Name = "" Then
        PlayerMsg Founder_Index, "Your guild needs a name!", BrightRed
        Exit Sub
    End If
```   
Add:
```
    'Change 1 to item number
    itemamount = HasItem(Founder_Index, 1)

    'Change 5000 to amount
    If itemamount = 0 Or itemamount < 5000 Then
        PlayerMsg Founder_Index, "Not enough Gold.", BrightRed
        Exit Sub
    End If

    'Change 1 to item number 5000 to amount
    TakeInvItem Founder_Index, 1, 5000
```
–--------------------------------------------------

Under:
```
    Dim tmpGuild As GuildRec
    Dim GuildSlot As Long
    Dim GuildFileId As Long
    Dim i As Integer
    Dim b As Integer
```
Add:
```
    Dim itemamount As Long
```
Ripped almost straight from **Sub HandleBuyItem**, tested works fine.
Link to comment
Share on other sites

here is a picture
[![](http://www.freeimagehosting.net/t/poxns.jpg)](http://www.freeimagehosting.net/poxns)
i found problem
'Change 1 to item number
    itemamount = HasItem(Founder_Index, 1)

    'Change 5000 to amount
    If itemamount = 0 Or itemamount < 5000 Then
        PlayerMsg Founder_Index, "Not enough Gold.", BrightRed
        Exit Sub
    End If

    'Change 1 to item number 5000 to amount
    TakeInvItem Founder_Index, 1, 5000

this code block that when iremove it it work….what is wrong whit this code??
Link to comment
Share on other sites

**This is now in the main tutorial, do not follow these steps unless you are told to by me!**

Edit:Found what caused the error, my apologies give me a few mins to fix it.

**This fix is a major bug and will cause issues for everyone who has this, I highly recommend you fix this. Unless your guildfileid and guildslot number match up you will not be able to join a guild. Since this is not likely to happen most guilds will be unable to invite new users.**

**All Server Sided**

In **Public Type TempPlayerRec** Under:

```
tmpGuildSlot As Long

tmpGuildInviteSlot As Long

tmpGuildInviteTimer As Long
```

Add:

```
tmpGuildInviteId As Long
```

–----------------------------------------------------------

In **Public Sub Request_Guild_Invite** Under:

```
TempPlayer(index).tmpGuildInviteSlot = GuildSlot

'2 minute

TempPlayer(index).tmpGuildInviteTimer = GetTickCount + 120000
```

Add:

```
TempPlayer(index).tmpGuildInviteId = Player(Inviter_Index).GuildFileId
```

–----------------------------------------------------------

In **Public Sub HandleGuildCommands** _**Replace**_:

```
Case 6

'accept

If TempPlayer(index).tmpGuildInviteSlot > 0 Then

If GuildData(TempPlayer(index).tmpGuildInviteSlot).In_Use = True And GuildData(TempPlayer(index).tmpGuildInviteSlot).Guild_Fileid = TempPlayer(index).tmpGuildInviteSlot Then

Call Join_Guild(index, TempPlayer(index).tmpGuildInviteSlot)

TempPlayer(index).tmpGuildInviteSlot = 0

TempPlayer(index).tmpGuildInviteTimer = 0

Else

PlayerMsg index, "No one from this guild is online any more, please ask for a new invite.", BrightRed

End If

Else

PlayerMsg index, "You must get a guild invite to use this command.", BrightRed

End If

Case 7

'decline

If TempPlayer(index).tmpGuildInviteSlot > 0 Then

TempPlayer(index).tmpGuildInviteSlot = 0

TempPlayer(index).tmpGuildInviteTimer = 0

PlayerMsg index, "You declined the guild invite.", BrightRed

Else

PlayerMsg index, "You must get a guild invite to use this command.", BrightRed

End If
```

With:

```
Case 6

'accept

If TempPlayer(index).tmpGuildInviteSlot > 0 Then

If GuildData(TempPlayer(index).tmpGuildInviteSlot).In_Use = True And GuildData(TempPlayer(index).tmpGuildInviteSlot).Guild_Fileid = TempPlayer(index).tmpGuildInviteId Then

Call Join_Guild(index, TempPlayer(index).tmpGuildInviteSlot)

TempPlayer(index).tmpGuildInviteSlot = 0

TempPlayer(index).tmpGuildInviteTimer = 0

TempPlayer(index).tmpGuildInviteId = 0

Else

PlayerMsg index, "No one from this guild is online any more, please ask for a new invite.", BrightRed

End If

Else

PlayerMsg index, "You must get a guild invite to use this command.", BrightRed

End If

Case 7

'decline

If TempPlayer(index).tmpGuildInviteSlot > 0 Then

TempPlayer(index).tmpGuildInviteSlot = 0

TempPlayer(index).tmpGuildInviteTimer = 0

TempPlayer(index).tmpGuildInviteId = 0

PlayerMsg index, "You declined the guild invite.", BrightRed

Else

PlayerMsg index, "You must get a guild invite to use this command.", BrightRed

End If
```

Let me know if this fixes your problem, the problem was caused by some changed I made to how some variables where used and my terrible memory.
Link to comment
Share on other sites

I've been very busy I mostly reply from my iPad, but I do plan on fixing those issues soon within the next week I hope but don't hold me to it.  If any major bugs come up I will make time for it like the last, the color is not a major bug so it can wait till I have more time to just do all the changes/minor bugs I want.
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...