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
612
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
27
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
612
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
380
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
  • Blackveiled Blackveiled:
    I wouldn't know, I'm in Joliet, Illinois right now working. I left Houston area about 2 weeks ago lol
  • Blackveiled Blackveiled:
    Not permanently of course, just a temporary job.
    +1
  • jonas jonas:
    Glad you're ok @tom_mai78101
  • jonas jonas:
    @Blackveiled you know another word for permanent? temporary
    +1
  • Varine Varine:
    Briefly, he'll only be there for the interim. Like a stopgap of sorts, he'll be back home in short time
  • O Old Mountain Shadow:
    Hurray! Tom has reappeared!
  • The Helper The Helper:
    Happy Thursday!
  • Blackveiled Blackveiled:
    Yep. Just another fun night at work.
  • Varine Varine:
    Broke the nozzle on my 3d printer and I don't have another heater block. So... I guess I'm fucked on that this weekend
  • The Helper The Helper:
    that sucks i bet they are expensive
  • Varine Varine:
    Not really
  • Varine Varine:
    The entire hot end is like 20 dollars, I just can't get anymore until next week
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site

      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