Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Soccer.cs
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Twister" data-source="post: 433967" data-attributes="member: 59638"><p>Hello DevBest, </p><p></p><p>I fixing the football on Plusemu and I fixe the distance at 4 cases when you shoot but they are not the move of the ball:</p><p></p><p>Screen: <a href="https://gyazo.com/dfcdb3251ad77c24325625338272730a" target="_blank">https://gyazo.com/dfcdb3251ad77c24325625338272730a</a></p><p> </p><p>My Method</p><p>[PHP]public void OnUserWalk(RoomUser User)</p><p> {</p><p> if (User == null)</p><p> return;</p><p></p><p> foreach (Item item in this._balls.Values.ToList())</p><p> {</p><p> int NewX = 0;</p><p> int NewY = 0;</p><p> int differenceX = User.X - item.GetX;</p><p> int differenceY = User.Y - item.GetY;</p><p></p><p> if (differenceX == 0 && differenceY == 0)</p><p> {</p><p> if (User.RotBody == 4)</p><p> {</p><p> NewX = User.X;</p><p> NewY = User.Y + 4;</p><p> item.ExtraData = "55";</p><p> item.BallIsMoving = true;</p><p> item.BallValue = 1;</p><p></p><p> }</p><p> else if (User.RotBody == 6)</p><p> {</p><p> NewX = User.X - 4;</p><p> NewY = User.Y;</p><p> item.ExtraData = "55";</p><p> item.BallIsMoving = true;</p><p> item.BallValue = 1;</p><p></p><p> }</p><p> else if (User.RotBody == 0)</p><p> {</p><p> NewX = User.X;</p><p> NewY = User.Y - 4;</p><p> item.ExtraData = "55";</p><p> item.BallIsMoving = true;</p><p> item.BallValue = 1;</p><p></p><p> }</p><p> else if (User.RotBody == 2)</p><p> {</p><p> NewX = User.X + 4;</p><p> NewY = User.Y;</p><p> item.ExtraData = "55";</p><p> item.BallIsMoving = true;</p><p> item.BallValue = 1;</p><p></p><p> }</p><p> else if (User.RotBody == 1)</p><p> {</p><p> NewX = User.X + 4;</p><p> NewY = User.Y - 4;</p><p> item.ExtraData = "55";</p><p> item.BallIsMoving = true;</p><p> item.BallValue = 1;</p><p></p><p> }</p><p> else if (User.RotBody == 7)</p><p> {</p><p> NewX = User.X - 4;</p><p> NewY = User.Y - 4;</p><p> item.ExtraData = "55";</p><p> item.BallIsMoving = true;</p><p> item.BallValue = 1;</p><p></p><p> }</p><p> else if (User.RotBody == 3)</p><p> {</p><p> NewX = User.X + 4;</p><p> NewY = User.Y + 4;</p><p> item.ExtraData = "55";</p><p> item.BallIsMoving = true;</p><p> item.BallValue = 1;</p><p></p><p> }</p><p> else if (User.RotBody == 5)</p><p> {</p><p> NewX = User.X - 4;</p><p> NewY = User.Y + 4;</p><p> item.ExtraData = "55";</p><p> item.BallIsMoving = true;</p><p> item.BallValue = 1;</p><p> }</p><p></p><p> if (!this._room.GetRoomItemHandler().CheckPosItem(User.GetClient(), item, NewX, NewY, item.Rotation, false, false))</p><p> {</p><p> if (User.RotBody == 0)</p><p> {</p><p> NewX = User.X;</p><p> NewY = User.Y + 1;</p><p> }</p><p> else if (User.RotBody == 2)</p><p> {</p><p> NewX = User.X - 1;</p><p> NewY = User.Y;</p><p> }</p><p> else if (User.RotBody == 4)</p><p> {</p><p> NewX = User.X;</p><p> NewY = User.Y - 1;</p><p> }</p><p> else if (User.RotBody == 6)</p><p> {</p><p> NewX = User.X + 1;</p><p> NewY = User.Y;</p><p> }</p><p> else if (User.RotBody == 5)</p><p> {</p><p> NewX = User.X + 1;</p><p> NewY = User.Y - 1;</p><p> }</p><p> else if (User.RotBody == 3)</p><p> {</p><p> NewX = User.X - 1;</p><p> NewY = User.Y - 1;</p><p> }</p><p> else if (User.RotBody == 7)</p><p> {</p><p> NewX = User.X + 1;</p><p> NewY = User.Y + 1;</p><p> }</p><p> else if (User.RotBody == 1)</p><p> {</p><p> NewX = User.X - 1;</p><p> NewY = User.Y + 1;</p><p> }</p><p> }</p><p> }</p><p> else if (differenceX <= 1 && differenceX >= -1 && differenceY <= -1 && differenceY >= 1 && VerifyBall(User, item.Coordinate.X, item.Coordinate.Y))//VERYFIC BALL CHECAR SI ESTA EN DIRECCION ASIA LA PELOTA</p><p> {</p><p> NewX = differenceX * -1;</p><p> NewY = differenceY * -1;</p><p></p><p> NewX = NewX + item.GetX;</p><p> NewY = NewY + item.GetY;</p><p> }</p><p></p><p> if (item.GetRoom().GetGameMap().ValidTile(NewX, NewY))</p><p> {</p><p> MoveBall(item, User.GetClient(), NewX, NewY);</p><p> }</p><p> }</p><p> }[/PHP]</p><p></p><p>Thanks you </p><p>Have a good day</p></blockquote><p></p>
[QUOTE="Twister, post: 433967, member: 59638"] Hello DevBest, I fixing the football on Plusemu and I fixe the distance at 4 cases when you shoot but they are not the move of the ball: Screen: [URL]https://gyazo.com/dfcdb3251ad77c24325625338272730a[/URL] My Method [PHP]public void OnUserWalk(RoomUser User) { if (User == null) return; foreach (Item item in this._balls.Values.ToList()) { int NewX = 0; int NewY = 0; int differenceX = User.X - item.GetX; int differenceY = User.Y - item.GetY; if (differenceX == 0 && differenceY == 0) { if (User.RotBody == 4) { NewX = User.X; NewY = User.Y + 4; item.ExtraData = "55"; item.BallIsMoving = true; item.BallValue = 1; } else if (User.RotBody == 6) { NewX = User.X - 4; NewY = User.Y; item.ExtraData = "55"; item.BallIsMoving = true; item.BallValue = 1; } else if (User.RotBody == 0) { NewX = User.X; NewY = User.Y - 4; item.ExtraData = "55"; item.BallIsMoving = true; item.BallValue = 1; } else if (User.RotBody == 2) { NewX = User.X + 4; NewY = User.Y; item.ExtraData = "55"; item.BallIsMoving = true; item.BallValue = 1; } else if (User.RotBody == 1) { NewX = User.X + 4; NewY = User.Y - 4; item.ExtraData = "55"; item.BallIsMoving = true; item.BallValue = 1; } else if (User.RotBody == 7) { NewX = User.X - 4; NewY = User.Y - 4; item.ExtraData = "55"; item.BallIsMoving = true; item.BallValue = 1; } else if (User.RotBody == 3) { NewX = User.X + 4; NewY = User.Y + 4; item.ExtraData = "55"; item.BallIsMoving = true; item.BallValue = 1; } else if (User.RotBody == 5) { NewX = User.X - 4; NewY = User.Y + 4; item.ExtraData = "55"; item.BallIsMoving = true; item.BallValue = 1; } if (!this._room.GetRoomItemHandler().CheckPosItem(User.GetClient(), item, NewX, NewY, item.Rotation, false, false)) { if (User.RotBody == 0) { NewX = User.X; NewY = User.Y + 1; } else if (User.RotBody == 2) { NewX = User.X - 1; NewY = User.Y; } else if (User.RotBody == 4) { NewX = User.X; NewY = User.Y - 1; } else if (User.RotBody == 6) { NewX = User.X + 1; NewY = User.Y; } else if (User.RotBody == 5) { NewX = User.X + 1; NewY = User.Y - 1; } else if (User.RotBody == 3) { NewX = User.X - 1; NewY = User.Y - 1; } else if (User.RotBody == 7) { NewX = User.X + 1; NewY = User.Y + 1; } else if (User.RotBody == 1) { NewX = User.X - 1; NewY = User.Y + 1; } } } else if (differenceX <= 1 && differenceX >= -1 && differenceY <= -1 && differenceY >= 1 && VerifyBall(User, item.Coordinate.X, item.Coordinate.Y))//VERYFIC BALL CHECAR SI ESTA EN DIRECCION ASIA LA PELOTA { NewX = differenceX * -1; NewY = differenceY * -1; NewX = NewX + item.GetX; NewY = NewY + item.GetY; } if (item.GetRoom().GetGameMap().ValidTile(NewX, NewY)) { MoveBall(item, User.GetClient(), NewX, NewY); } } }[/PHP] Thanks you Have a good day [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Soccer.cs
Top