PDA

View Full Version : [Tut] Making People Don't Lose Items On Death [317]



Ahmedo0o
July 1st, 2010, 20:17
Hii...

Thats Me Ahmedo0o... I know this is my first tut or post in forums.. But iam always viewing the forums and i mostly knows all members but they don't knows me.. This is my tut to make an normal player or mod or admin don't lose Items on Death... Cuz some servers admins+ lose Items:eek:

Difficult 1/10
In Client.java in Source folder
& make a copy of ur client.java (so if u got errors)

Now Open client.java in your server folder & search for


deathStage == 2
You will see text similar to this...


if (!IsInFightCave() && !isInPitGame() && !isInPitRoom() && playerRights != 2 && playerRights != 3 && action != 1 && deathStage == 2 && System.currentTimeMillis() - deathTimer >= 2500) {
client killerz = (client) server.playerHandler.players[KillerId];
youdied();
killerz.rating += 15;
killerz.sM("You have defeated "+playerName+".");
}

Now add the Rights that u don't want them to lose items..


0 = Normal Player
1 = Mod
2 = Admin
3 = Owner
4 = Hidden Admin

& add playerRights != x after the playerRights != 3 then Compile & Run..

Btw x is the rights u don't want them to lose items...

Example : i want mods to not lose Items i added playerRights != 1


if (!IsInFightCave() && !isInPitGame() && !isInPitRoom() && playerRights != 2 && playerRights != 3 && playerRights != 1 && action != 1 && deathStage == 2 && System.currentTimeMillis() - deathTimer >= 2500) {
client killerz = (client) server.playerHandler.players[KillerId];
youdied();
killerz.rating += 15;
killerz.sM("You have defeated "+playerName+".");
}

Good Luck..
Any Error Post it Here.. ;D

123happy
July 1st, 2010, 20:22
Wow.. Not bad especially for a first Tutorial. Well done:)!

This would help a lot of new players/coders.

Ahmedo0o
July 1st, 2010, 20:30
Thnx for the Reply man...

I D3stroy I
July 1st, 2010, 20:39
Thanks already knew but good job anyways

Ahmedo0o
July 2nd, 2010, 00:03
Np.. I made it for Starters ;D

X Pwner X
July 23rd, 2010, 04:07
my game allows hiddens and when i change it it still lets them but theres no thing in there that says playerRights > 4 or watev help?

N0tlocked
August 22nd, 2010, 17:35
Good job. D:

wtf ur zerk™
October 15th, 2010, 12:50
how do u make it so like on some servers it ses on death you will not lose your firecape ect

Fire cape
October 15th, 2010, 17:57
Not really a tutorial as you don't explain much; this should really be in the snippet section.
Good job on this though.
Few tips:

Variable/method naming conventions should be lower then upper cased. - Example:
IsInFightCave Should be:
isInFightCave

cloudyscape
October 15th, 2010, 19:54
Me of all people would not able to find deathStage == 2 This blank scape sucks man but theres no other Blank

DutchVengz__
March 7th, 2011, 07:01
Thanks :D I have been looking for this for a longtime

caliscape
March 7th, 2011, 13:28
Nice tut. For starters.

dyltank
August 3rd, 2011, 07:08
heya! that was very helpful, but still....!! how would i go about coding it so that certain items drop under certain conditions or not drop at all? not ALL items together not dropping, just specified ones.. like fire cape.

VitalityX
August 4th, 2011, 00:22
how do i make it so owner dosn't lose items..?