sousou63 / DarkRP

S&Box roleplay gamemode
MIT License
22 stars 22 forks source link

Chat Commands duplicate for every player connected #128

Open dancore-san opened 2 months ago

QueenPM commented 2 months ago

How about we add an additional parameter/config for commands called ClientOnly, a bool.

If set to true, it would only exectute the command for the client and stop execution for everyone else if they arnt the one who called it?

dancore-san commented 2 months ago

I 100% think this is the best route, when I tried fixing it, I created a isBroadcast bool in Command.cs. It worked, the problem was that the broadcasted commands were still duplicating.

SebbeJohansson commented 2 months ago

@QueenPM is there a reason why we want the execution of the command to be broadcast? Wouldnt each command broadcast the result?

SebbeJohansson commented 2 months ago

I think i have foudn a solution for this. There is an option for the broadcast property to only run on the host.

image

QueenPM commented 2 months ago

@QueenPM is there a reason why we want the execution of the command to be broadcast? Wouldnt each command broadcast the result?

Yes this was a quick fix for some broken commands. I think ideally it shouldnt be broadcast and only some parts of specific commands should be

SebbeJohansson commented 2 months ago

@QueenPM lets communicate on discord about this. I made a temporary PR that should at least fix it for now. https://github.com/sousou63/DarkRP/pull/155