• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Make Player Disconnect

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
I'm trying to create a -kick system over here and I'd like my system to purposely make that player disconnect
I don't want that Force Player Defeat action as we have choices like Continue Game or Exit something like that
The script GetLocalPlayer() can cause the player to disconnect, is it ?
Show me the correct usage in trigger including Event and Actions, no need Conditions
 
Level 11
Joined
Aug 1, 2009
Messages
714
Force Player Defeat has no Continue Game or Exit Tag
Only Victory can do the Continue Game or Exit
And besides. Player Disconnect is can be apply when the other player has no internet connection.

=Offtopic=
Player 1: -kick Blue
Player 2: =You are disconnected=

Wow! I think -kick can make players lose their connection. XD Hope someone help skull cause I think I might need this.
 
Level 7
Joined
May 3, 2007
Messages
210
Run a local player block for the desired player, try to manipulate one of the players agents, all hell breaks loose.

Make sure you don't catch more then just the desired player in the local player block though. I haven't coded Warcraft 3 in a while but I remember this being a way to achieve your desired effect.

I don't see any reliable way to do it via GUI, but the JASS code my look something like this:

JASS:
If(GetLocalPlayer() == #) then //Can't remember if LocalPlayer returns boolean or an actual Player, change occurdingly
 call SetUnitX(_reservedUnit[#],0)
endif

The point is your moving a players unit locally, a unit of course not supporting such an operation, thus causing a bit of kerfuffle.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
The defeat/victory dialog is from blizzard.j. So this could be left out.

JASS:
if (GetLocalPlayer() == <player>) then
    call EndGame(<showScoreScreen>)
endif

I do not like the idea of really disconnecting the game through unexpected asyncness as I think this might end the game for a part of other players or all, too.
 
Status
Not open for further replies.
Top