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

PK Punishment


Dawntide
 Share

Recommended Posts

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 guild
based on this guild system http://www.touchofdeathforums.com/smf2/index.php/topic,78441.0.html

```
If Player(Index).PK = PK
Player(OnlineIndex).GuildFileId = 0
Player(OnlineIndex).GuildMemberId = 0
TempPlayer(OnlineIndex).TmpGuildSlot = 0
Call ClearGuildMemberSlot(GuildSlot, MemberSlot)
PlayerMsg OnlineIndex, "You were kicked out of clan because of PKing another guild member.", BrightRed
Call 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

  • 4 months later...
Not a bad start

find in Playerattackplayer

If Damage >= GetPlayerVital(Victim, Vitals.HP) Then

' Player is dead

Call GlobalMsg(GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker), BrightRed)

add -> If player(victim).GuildfieldID = player(attacker).GuildfieldID then

and here add the part you posted clearing the guild ID etc

Player(ATTACKER).GuildFileId = 0

Player(ATTACKER).GuildMemberId = 0

TempPlayer(ATTACKER).TmpGuildSlot = 0

Call ClearGuildMemberSlot(GuildSlot, MemberSlot)

PlayerMsg ATTACKER, "You were kicked out of clan because of PKing another guild member.", BrightRed

Call 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

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