damian666 Posted June 11, 2011 Share Posted June 11, 2011 lol, i knew it, happened to me too xdyour very welcome mate , have fun :)Dami Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 Do you know whats wrong with this code :```Private Sub cmdDismiss_Click()Dim Buffer As clsBufferSet Buffer = New clsBufferDim DismissPlayer As StringBuffer.WriteLong CDismissFromGuildDismissPlayer = listUsers.textBuffer.WriteString DismissPlayerSendData Buffer.ToArray()Set Buffer = NothingDoEventsIf listUsers.text = PlayerName ThenMe.HideEnd IfDim ShowOffline As StringSet Buffer = New clsBufferBuffer.WriteLong CRequestGuildListShowOffline = "False"Buffer.WriteString ShowOfflineSendData Buffer.ToArray()Set Buffer = NothingDoEventsEnd Sub```Because it isn't working Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 dont see anything wrong with it, although you make me wonder why the fuck you have a DoEvents in there O.oDami Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 also, i dont see where ya declared playername```If listUsers.text = PlayerName Then``` Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> dont see anything wrong with it, although you make me wonder why the duck you have a DoEvents in there O.o> > DamiAnd what about this: (server side)```Sub HandleDismissFromGuild(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim DismissName As StringDim buffer As clsBufferSet buffer = New clsBufferbuffer.WriteBytes Data()DismissName = buffer.ReadStringSet buffer = NothingCall DismissFromGuild(index, DismissName)End Sub``````Public Sub DismissFromGuild(ByVal UserIndex As Integer, ByVal DismissName As String)Dim i As IntegerDim GuildIndex As IntegerDim tmpName As StringDim PlayerIndex As IntegerDim LoopC As IntegerDim LoopG As Integer'Make sure they're in a guildIf Player(UserIndex).GuildID > 0 ThenGuildIndex = Player(UserIndex).GuildID'Can't dismiss if we aren't the guild leader If GetPlayerName(UserIndex) <> Guilds(GuildIndex).Owner Then Call PlayerMsg(UserIndex, "You do not have permission to dismiss someone from the guild!", BrightRed) Exit SubEnd If'Get the index of the name we're dismissingIf DismissName = GetPlayerName(UserIndex) Then For i = 1 To Guilds(GuildIndex).NumMembers 'Eh if we dismissed ourselves, destroy the guild For PlayerIndex = 1 To MAX_PLAYERS If IsPlaying(PlayerIndex) = True Then If Guilds(GuildIndex).Members(i) = GetPlayerName(PlayerIndex) Then Call PlayerMsg(PlayerIndex, "The Guild has been dissolved!", BrightRed) Player(PlayerIndex).GuildID = 0 Call SendPlayerData(PlayerIndex) End If End If Next PlayerIndex 'We keep Guild Data in the Guild.data files however we flag them as 'Deleted' Guilds(GuildIndex).Members(i) = "" Guilds(GuildIndex).Name = "Deleted " & Guilds(GuildIndex).Name Guilds(GuildIndex).NumMembers = 0 Next i Guilds(GuildIndex).Founded = "Deleted on " & Date Exit SubEnd IfDim OldIndex As IntegerFor LoopG = 1 To Guilds(GuildIndex).NumMembers tmpName = Guilds(GuildIndex).Members(LoopG) If tmpName = DismissName Then For LoopC = 1 To MAX_PLAYERS If IsPlaying(LoopC) = True Then If GetPlayerName(LoopC) = DismissName Then Player(LoopC).GuildID = 0 Call PlayerMsg(LoopC, "You have been dismissed from the guild!", BrightRed) Call SendPlayerData(LoopC) End If End If Next LoopC OldIndex = LoopG End IfNext LoopGGuilds(GuildIndex).NumMembers = Guilds(GuildIndex).NumMembers - 1Guilds(GuildIndex).Members(OldIndex) = " "Call SaveGuildsEnd IfEnd Sub``` Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 lots of things actually xdfirst, your sending a long index to a integer index.secondly, you retrieve guilds owner name without trim$, think that maters, because it would give ya like"test " as name, not "test".rest of it seems ok though, on first glance, hard to debug when im not running it xdDami Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> lots of things actually xd> > first, your sending a long index to a integer index.> > secondly, you retrieve guilds owner name without trim$, think that maters, because it would give ya like> "test " as name, not "test".> > rest of it seems ok though, on first glance, hard to debug when im not running it xd> > DamiWhat code should I edit? :embarrassed: Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 ```Public Sub DismissFromGuild(ByVal UserIndex As Integer, ByVal DismissName As String)toPublic Sub DismissFromGuild(ByVal UserIndex As long, ByVal DismissName As String)```^please note im nor sure this matters, but better safe then fucked xd```'Can't dismiss if we aren't the guild leader If GetPlayerName(UserIndex) <> Guilds(GuildIndex).Owner Thento'Can't dismiss if we aren't the guild leader If GetPlayerName(UserIndex) <> Trim$(Guilds(GuildIndex).Owner) Then```dami Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 @Damian666:> ```> Public Sub DismissFromGuild(ByVal UserIndex As Integer, ByVal DismissName As String)> > to> > Public Sub DismissFromGuild(ByVal UserIndex As long, ByVal DismissName As String)> > ```^> please note im nor sure this matters, but better safe then ducked xd> > ```> > 'Can't dismiss if we aren't the guild leader If GetPlayerName(UserIndex) <> Guilds(GuildIndex).Owner Then> > to> > 'Can't dismiss if we aren't the guild leader If GetPlayerName(UserIndex) <> Trim$(Guilds(GuildIndex).Owner) Then> > ```> damiChanged it but still nothing..EDIT: After watching in the guild files, I see this :Members : -2 Link to comment Share on other sites More sharing options...
damian666 Posted June 11, 2011 Share Posted June 11, 2011 he, that cant be good xdbut atleast you fixed up your code, so it wont bite you in the ass later ^^dami Link to comment Share on other sites More sharing options...
erkro1 Posted June 11, 2011 Author Share Posted June 11, 2011 **EDIT :**Alright, I've fixed the previous problem but now this :It doesn't affect guild file, can you please help me? 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