Jump to content

[HELP] outputChatBox doubling while on a team


Maark

Recommended Posts

I'm having a problem, when I'm on a team, some outputChatBox end up doubling, both the chat, as well as some alert scripts, and for those who aren't on any team, it remains normal, in the Log, everything is normal. Note: it is not a problem of Freeroam, Tag script.

I search in all my files for outputChatBox and found nothing wrong.

In team:

6ufCxQa.png

Without TEAM set:

hTEmqXz.png

 

Is this a MTA problem? (Everything was normal when I closed the server, reopened with everything the same and now this is happening.) (Closed the server in 1.5.6 and re-opened in 1.5.7)

Edited by Maark
Link to comment

Well, when I encountered this problem, it was from client events triggering for everyone when I had thought it was triggered for only 1 player...

There are some Client Events such as onClientVehicleEnter that will trigger for every player on the server rather than just the player who enters the vehicle. If this proves to be the issue, then you'll just need to check if the player is the local player

onClientVehicleEnter(player,seat)
 if(player==localPlayer)then -- Checks if the player is the local player or not
  -- Whatever Code
 end
end

There was another issue I discovered that was also "doubling up on everything" which happen to be how I was triggering client side events:

triggerClientEvent("SomeClientEvent",source) -- Because I ignored/skipped the first argument, this would cause the event to trigger for everyone
triggerClientEvent(source,"SomeClientEvent",source) -- This fixed that issue for me, the event would only trigger for the "source" player

But in either of these cases, if they were a third player online, everything would triple and so on and so forth...

It doesn't sound like this will be your problem, but still worth looking into, just in case of anything

  • Like 1
Link to comment
23 minutes ago, ReZurrecti0n said:

Well, when I encountered this problem, it was from client events triggering for everyone when I had thought it was triggered for only 1 player...

There are some Client Events such as onClientVehicleEnter that will trigger for every player on the server rather than just the player who enters the vehicle. If this proves to be the issue, then you'll just need to check if the player is the local player


onClientVehicleEnter(player,seat)
 if(player==localPlayer)then -- Checks if the player is the local player or not
  -- Whatever Code
 end
end

There was another issue I discovered that was also "doubling up on everything" which happen to be how I was triggering client side events:


triggerClientEvent("SomeClientEvent",source) -- Because I ignored/skipped the first argument, this would cause the event to trigger for everyone
triggerClientEvent(source,"SomeClientEvent",source) -- This fixed that issue for me, the event would only trigger for the "source" player

But in either of these cases, if they were a third player online, everything would triple and so on and so forth...

It doesn't sound like this will be your problem, but still worth looking into, just in case of anything

Interesting, but in my case it doesn't triple and etc, it just doubles, regardless of how many players

I will check to see if it is related to this

Link to comment
1 hour ago, ReZurrecti0n said:

Well, when I encountered this problem, it was from client events triggering for everyone when I had thought it was triggered for only 1 player...

There are some Client Events such as onClientVehicleEnter that will trigger for every player on the server rather than just the player who enters the vehicle. If this proves to be the issue, then you'll just need to check if the player is the local player


onClientVehicleEnter(player,seat)
 if(player==localPlayer)then -- Checks if the player is the local player or not
  -- Whatever Code
 end
end

There was another issue I discovered that was also "doubling up on everything" which happen to be how I was triggering client side events:


triggerClientEvent("SomeClientEvent",source) -- Because I ignored/skipped the first argument, this would cause the event to trigger for everyone
triggerClientEvent(source,"SomeClientEvent",source) -- This fixed that issue for me, the event would only trigger for the "source" player

But in either of these cases, if they were a third player online, everything would triple and so on and so forth...

It doesn't sound like this will be your problem, but still worth looking into, just in case of anything

I fix 3 events without first argument, but nothing happened =/

Link to comment
  • Scripting Moderators
5 hours ago, Maark said:

I fix 3 events without first argument, but nothing happened =/

What's your server/client version?

This could be problem due of https://github.com/multitheftauto/mtasa-blue/commit/d2c53c73e327ade55862043af9bd53da64dd351a (r20391), but it should be fixed, there was 2 commits that should correct this - https://github.com/multitheftauto/mtasa-blue/commit/24a233f6e897771504a270940e05ccc4652bce53 (r20394), and https://github.com/multitheftauto/mtasa-blue/commit/a5508d8cead013a0b08e9c2cddb5914e46be1abd (r20398), so i suggest you to update your server/client to r20398 or even higher.

  • Thanks 2
Link to comment

If it is working while not on any team, but then breaking while on a team, then it must be your scripts. I would start with tracking down what triggers the chat, maybe throw in a debug output with the normal chat message to figure out if it is triggering for the same source... For example:

outputChatBox("TestMessage: ("..tostring(source)..")",255,150,50) -- Replace source with the player element maybe...

This should output "UserData:0x000" or something similar anyway, this would at least tell you if another player is triggering the chat message for you, plus your own

Otherwise, you may need to scan your code within whatever triggers the chat messages and keep in mind teams are causing double... You might not have changed anything, but the upgrade may have changed some old functions or something that would need updating if that makes any sense

Link to comment
3 hours ago, majqq said:

What's your server/client version?

This could be problem due of https://github.com/multitheftauto/mtasa-blue/commit/d2c53c73e327ade55862043af9bd53da64dd351a (r20391), but it should be fixed, there was 2 commits that should correct this - https://github.com/multitheftauto/mtasa-blue/commit/24a233f6e897771504a270940e05ccc4652bce53 (r20394), and https://github.com/multitheftauto/mtasa-blue/commit/a5508d8cead013a0b08e9c2cddb5914e46be1abd (r20398), so i suggest you to update your server/client to r20398 or even higher.

Thank you! worked and the problem is fixed.

I updated to version 20402 and everything is 100% now.

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...