v10networkscom / saltychat-fivem

FiveM implementation of Salty Chat (TeamSpeak 3 based Voice Plugin)
https://gaming.v10networks.com
GNU General Public License v3.0
70 stars 64 forks source link

Fixed error : Unable to cast object of type 'System.Byte' to type 'Sy… #90

Closed xPiwel closed 2 years ago

xPiwel commented 2 years ago

…stem.Int32'. When adding or removing players from a call.

On an Ubuntu 18.04 FiveM server, I've had an error : SCRIPT ERROR in reference call: System.InvalidCastException: Unable to cast object of type 'System.Byte' to type 'System.Int32'. when trying to "AddPlayersToCall" and "RemovePlayersFromCall".

Was working on Windows server but not on Ubuntu.

Issue was fixed by removing the force cast to int32 of the player ID in the int[] of players id. Works on windows.

GCPhone line: exports.saltychat:AddPlayersToCall(tostring(id), {tonumber(AppelsEnCours[id].transmitter_src), tonumber(AppelsEnCours[id].receiver_src)}) that works now.

xPiwel commented 2 years ago

I don't know why Github as edited the whole file but I've only edited 2 lines.

This: foreach (int playerHandle in players.Cast<int>()) for this: foreach (int playerHandle in players) in functions AddPlayersToCall and RemovePlayersFromCall

BlackFlash5 commented 2 years ago

Thanks for debugging the issue and contributing!

I don't know why Github as edited the whole file but I've only edited 2 lines.

I think that happens when you edit the file through the web editor. Please try to fix this so that there are only legitimate changes.

xPiwel commented 2 years ago

Thanks for debugging the issue and contributing!

I don't know why Github as edited the whole file but I've only edited 2 lines.

I think that happens when you edit the file through the web editor. Please try to fix this so that there are only legitimate changes.

I'll try out in another way!