Dawntide Posted August 3, 2012 Author Share Posted August 3, 2012 Hi,I want to add a feature, but i do not know how to do it:I want to add a PK Punishment, so i want to kick a player out of guild when he killed a player of the same guildbased on this guild system http://www.touchofdeathforums.com/smf2/index.php/topic,78441.0.html```If Player(Index).PK = PKPlayer(OnlineIndex).GuildFileId = 0Player(OnlineIndex).GuildMemberId = 0TempPlayer(OnlineIndex).TmpGuildSlot = 0Call ClearGuildMemberSlot(GuildSlot, MemberSlot)PlayerMsg OnlineIndex, "You were kicked out of clan because of PKing another guild member.", BrightRedCall SavePlayer(OnlineIndex)Call SaveGuild(GuildSlot)Call SendPlayerData(OnlineIndex)```This is a noobish attempt, but even if it is right, it needs a check if the killed player is a guild member of the PKer's guild.thanks in advance! Link to comment Share on other sites More sharing options...
Whitepinkbun Posted December 17, 2012 Share Posted December 17, 2012 Not a bad startfind in PlayerattackplayerIf Damage >= GetPlayerVital(Victim, Vitals.HP) Then' Player is deadCall GlobalMsg(GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker), BrightRed)add -> If player(victim).GuildfieldID = player(attacker).GuildfieldID thenand here add the part you posted clearing the guild ID etcPlayer(ATTACKER).GuildFileId = 0Player(ATTACKER).GuildMemberId = 0TempPlayer(ATTACKER).TmpGuildSlot = 0Call ClearGuildMemberSlot(GuildSlot, MemberSlot)PlayerMsg ATTACKER, "You were kicked out of clan because of PKing another guild member.", BrightRedCall SavePlayer(ATTACKER)Call SaveGuild(GuildSlot)Call SendPlayerData(ATTACKER)I think that'll do it lemme know how it goes Link to comment Share on other sites More sharing options...
DeathKnight Posted December 17, 2012 Share Posted December 17, 2012 Or you could just edit the attack function to check if member is in the same guild, and exit function if they are, so they don't kill each other.Then you just add in a check if they are on a PVP map if you want them to be able to fight. Link to comment Share on other sites More sharing options...
Whitepinkbun Posted December 18, 2012 Share Posted December 18, 2012 Thats not what he wanted thou but ok lol 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