Global Chat ingame error -
SkyFlare - 09.06.2020
So it seems I keep having the same problems over and over in my Gamemode...
I have Sandboxie, so I am able to test if my functions are working, and majority are...
Unfortunately I keep having this specific error, I am wondering if its not actually linked to what I am doing, but more deeper issue, anyway if there is an issue in my code, can someone please help me find it.
- Player 1 Joins Server (ID 0)
- Player 2 Joins Server (ID 1)
Player 1(ID 0) Sends Message in /globalchat
-Player 1(ID 0) Can see the Message.
-Player 2(ID 1) Can see the Message.
Player 2(ID 1) Sends Message in /globalchat
-Player 1(ID 0) Can see the Message.
-Player 2(ID 1) Can NOT see the Message.
I Have had problems in the past, where the experience of ID 0, is not the same as id 1+
FIXED!
Code:
foreach(Player, i) if(Player[i][ToggledGlobalChat] == 0) SendClientMessage(i, -1, string);
Re: Global Chat ingame error -
Fairuz - 09.06.2020
You are using the deprecated method of foreach, just a heads up..
Re: Global Chat ingame error -
SkyFlare - 09.06.2020
Quote:
Originally Posted by Fairuz
You are using the deprecated method of foreach, just a heads up..
|
How is it deprecated? can you show me a better method please?
Re: Global Chat ingame error -
Adamoneoone - 09.06.2020
is the old way to use foreach.
Code:
foreach(new i:Player)
is how you'd want to do it.
Re: Global Chat ingame error -
SkyFlare - 09.06.2020
Quote:
Originally Posted by Adamoneoone
is the old way to use foreach.
Code:
foreach(new i:Player)
is how you'd want to do it.
|
What does that do? apart from the obvious making a new integer value named i? what benefits does it reap?