Send players to jail for pkin

Arbink

New Member
Reaction score
0
im making an rpg and i want if a player kills another player the player that kills the other gets sent to a region, if its possible can i give them a warning the 1st time they do it?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
You could have an Integer variable to track the number of player kills each player has. Whenever they kill another player, increase the value of this variable by 1. If the variable value is 1 or less, then give them a warning, else move the killer into the region instantly.
 

xPass

All aboard the xPass Express!
Reaction score
26
You know actually you can use a trigger to do it.
It's something like:

Trigger:
  • JailTrigger
    • Event-A unit dies
    • Condition-Dying unit is equal to (TeamKiller)
    • Action-Teleport killing unit to (Jail)



Sry i don't have WE with me right now, it's something like that, for warning, you can use what Kearf said; the integer thingy. Jail is the region, TeamKiller is the type of hero, and JailTrigger is the name of the trigger. You can use the integer thingy then the else is:
Trigger:
  • else run trigger (JailTrigger)


For a shorter trigger, use what Kearf said:
Trigger:
  • else teleport (killing unit) to (Jail)]


Pls correct me if i'm wrong, i'm a newb too =D
Hopefully I've helped, if not, very very sorry
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
If I needed to, this is how I would do it:
Trigger:
  • Jail Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set JailVar[(Player number of (Owner of (Killing unit)))] = (JailVar[(Player number of (Owner of (Killing unit)))] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • JailVar[(Player number of (Owner of (Killing unit)))] Less than or equal to 1
        • Then - Actions
          • Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: (Your Warning Here)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • JailVar[(Player number of (Owner of (Killing unit)))] Greater than or equal to 2
            • Then - Actions
              • Unit - Move (Killing unit) instantly to JailRegion
            • Else - Actions
 

Squeekems

TH.net Regular
Reaction score
11
Why not just make a Boolean variable? Lol. That's essentially what you're doing. Set a Boolean Variable with an array of the number of players. If they player kill, for the first time, set it to true and tell them that they will be jailed next time. I'm feeling too lazy to make up an example trigger, but you should get the idea from the other examples.
 

Arbink

New Member
Reaction score
0
huh i cant figure out how to get the +1 in Set JailVar[(Player number of (Owner of (Killing unit)))] = (JailVar[(Player number of (Owner of (Killing unit)))] + 1)
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
You need to use the arithmetic option, which allows you to add two values.
 

sentrywiz

New Member
Reaction score
25
You prolly play conquer online right? RIGHT?

Pking and jail is soo... conquer online-like :p:p:p


But what others said is good. Make an integer array for each player that will count the number of kills on other players (dying unit is a hero and not computer controlled)

I am lazy to open WC3 editor now so ill just type-show you:

player integer array

p1[0] = 0
p2[1] = 0
p3[2] = 0
...

when hero dies

check

> if

killing unit is a hero and player controlled
and killing unit has 0 in his array

> then

set pX[player number] = pX[player number] + 1
give warning

> else

JAIL TIME! Send to region

*additional fun thing*

make dummy unit to cast entangling roots to entering unit. roots
dont have to deal damage but they will prevent spell cast and moving.
30 second penalty should be enough :p
>
 

Hatebreeder

So many apples
Reaction score
381
Just do:

Code:
Event: A unit dies
Condition: Owner of (Killed Unit) is an ally of (Killing Unit) Player
Actions: Move (Killing Unit) to (YOURJAIL)
            Pause (Killing Unit)
            Wait(30.)
            UnPause(Killing Unit)
            Move (Killing Unit) to (OUTOFYOURJAIL)

Put Killing Unit into a unit variable.

There isn't much to it actually.
This is, however, not a MUI Version.
You'd have to index your Units.
However, this can be made very easily in JASS/vJASS. I suggest you go learn it =P
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Why is everyone posting solutions after solutions.. The solution has already been posted.

Just do:

Code:
Event: A unit dies
Condition: Owner of (Killed Unit) is an ally of (Killing Unit) Player
Actions: Move (Killing Unit) to (YOURJAIL)
            Pause (Killing Unit)
            Wait(30.)
            UnPause(Killing Unit)
            Move (Killing Unit) to (OUTOFYOURJAIL)

Put Killing Unit into a unit variable.

There isn't much to it actually.
This is, however, not a MUI Version.
You'd have to index your Units.
However, this can be made very easily in JASS/vJASS. I suggest you go learn it =P

He wants a first time warning and sending to jail is only for the second time.

I believe using a boolean is more practical for this..
 

Arbink

New Member
Reaction score
0
im having problems with it (i am testing it on computer players if that matters) it only works on my units and doesent send me to jail but the warning comes up i used a real variable with an arry of 1 and initial value of 0 (i dont know about variables) heres the trigger in case i made mistakes

Code:
Jail
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
    Actions
        Set Jail[(Player number of (Owner of (Killing unit)))] = Jail[((Player number of (Owner of (Killing unit))) + 1)]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Jail[(Player number of (Owner of (Killing unit)))] Less than or equal to 1.00
            Then - Actions
                Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: NO BETRAYING, DO IT...
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Jail[(Player number of (Owner of (Killing unit)))] Greater than or equal to 2.00
                    Then - Actions
                        Unit - Move (Killing unit) instantly to (Center of Jail Region <gen>)
                    Else - Actions
i want to make a command code to bring up a box with "set free" "keep jailed" options to open the jail for 30 secs
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
The array of the variable and the value of the variable is NOT the same.

You should do
If Jail[Player number of owner of killing unit] = 0,
Then set Jail[player number of owner of killing unit = 1
Display warning

If Jail[Player number of owner of killing unit] = 1,
Send to jail
 

sentrywiz

New Member
Reaction score
25
The array of the variable and the value of the variable is NOT the same.

You should do
If Jail[Player number of owner of killing unit] = 0,
Then set Jail[player number of owner of killing unit = 1
Display warning

If Jail[Player number of owner of killing unit] = 1,
Send to jail

You mean, if:


If Jail[Player number of owner of killing unit] = 2 or more,
Send to jail

What logic in display "WARNING. Next player kill will send you to jail..." and BAM your in jail.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Nope... no error. The original value should be 0, at least in my example stated. So if it's 0, set it to 1 and display warning. However if it's 1, send the player to jail.
 

Arbink

New Member
Reaction score
0
This triggers still not working:banghead: did i put the numbers in the right place
Code:
Jail
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
    Actions
        Set Jail[(Player number of (Owner of (Killing unit)))] = Jail[((Player number of (Owner of (Killing unit))) + 0)]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Jail[((Player number of (Owner of (Killing unit))) + 1)] Less than or equal to 1.00
            Then - Actions
                Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: NO BETRAYING, DO IT...
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Jail[((Player number of (Owner of (Killing unit))) + 1)] Greater than or equal to 2.00
                    Then - Actions
                        Unit - Move (Killing unit) instantly to (Center of Jail Region <gen>)
                    Else - Actions
do i have to change my variable
 

Ayanami

칼리
Reaction score
288
The trigger is quite complicated for a simple trigger o.o

Try it this way:

Trigger:
  • Jail
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Jail[(Player number of (Owner of (Killing unit)))] Less than 1
        • Then - Actions
          • Set Jail[(Player number of (Owner of (Killing unit)))] = (Jail[(Player number of (Owner of (Killing unit)))] + 1)
          • Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) the text: NO BETRAYING, DO IT...
        • Else - Actions
          • Set TempPoint = (Center of Jail Region &lt;gen&gt;)
          • Unit - Move (Killing unit) instantly to TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)


Note that the variable Jail is an integer and that its initial value should be 0. This will warn the killer if it's the first time. If it's the second time, he will go to jail.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top