Global Chat ingame error
#1

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);
Reply
#2

You are using the deprecated method of foreach, just a heads up..
Reply
#3

Quote:
Originally Posted by Fairuz
View Post
You are using the deprecated method of foreach, just a heads up..
How is it deprecated? can you show me a better method please?
Reply
#4

Code:
foreach(Player, i)
is the old way to use foreach.
Code:
foreach(new i:Player)
is how you'd want to do it.
Reply
#5

Quote:
Originally Posted by Adamoneoone
View Post
Code:
foreach(Player, i)
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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)