haxball / haxball-issues

114 stars 43 forks source link

HaxBall Headless host question #1527

Open AvramKimi opened 2 years ago

AvramKimi commented 2 years ago

I am new with programming Haxball servers so I have a few questions.

  1. I saw other servers have betting system so I wanted to see how can I make that but on the internet I found nothing.

  2. I also wanted to add jerseys but there's no guides for that either.

  3. Is it possible to make bot be on the goal and defend and if it is how can I do that?

Zenit-2 commented 2 years ago

I'll only be able to help you in question 2 use the following code to get the uniforms in the game

else if (["!fla"].includes(message[0].toLowerCase())) { if (player.team == 1){ room.setTeamColors(1, 90, 0xFFFAFA, [0xFF0000, 0x00000, 0xFF0000]); room.sendAnnouncement(player.name + " chose flamengo uniform!!", null, 0xFFFFFF, "bold"); } else if (player.team == 2){ room.setTeamColors(2, 90, 0xFFFAFA, [0xFF0000, 0x00000, 0xFF0000]); room.sendAnnouncement(player.name + " chose flamengo uniform!", null, 0xFFFFFF, "bold"); } return false; }

AvramKimi commented 2 years ago

Thank you so much.

Zenit-2 commented 2 years ago

Thank you so much.

;)

AvramKimi commented 2 years ago

Thank you so much.

;)

sorry to bother you but do you have discord so i can ask you privately about something else so i dont type here on github

Zenit-2 commented 2 years ago

Morty ;/#5256

thenorthstar commented 2 years ago

I'll only be able to help you in question 2 use the following code to get the uniforms in the game

else if (["!fla"].includes(message[0].toLowerCase())) { if (player.team == 1){ room.setTeamColors(1, 90, 0xFFFAFA, [0xFF0000, 0x00000, 0xFF0000]); room.sendAnnouncement(player.name + " chose flamengo uniform!!", null, 0xFFFFFF, "bold"); } else if (player.team == 2){ room.setTeamColors(2, 90, 0xFFFAFA, [0xFF0000, 0x00000, 0xFF0000]); room.sendAnnouncement(player.name + " chose flamengo uniform!", null, 0xFFFFFF, "bold"); } return false; }

For the second option, I have implemented a script with wide repository of uniforms. You can find it on the following link: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Intermediate/Uniforms.js