for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
Lirbo - 01.08.2017
PHP код:
for(new i; i < MAX_PLAYERS; i++) Message(i, TYPE_SERVER, "FWEKOGE");
is working only for id 0 to me for some reason, any ideas?
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
OneDay - 01.08.2017
What is Message?
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
Omirrow - 01.08.2017
Quote:
Originally Posted by Lirbo
PHP код:
for(new i; i < MAX_PLAYERS; i++) Message(i, TYPE_SERVER, "FWEKOGE");
is working only for id 0 to me for some reason, any ideas?
|
I'm a hundred percent sure; the issue is about your "Message" function.
Can we see it?
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
Lirbo - 01.08.2017
Quote:
Originally Posted by OneDay
What is Message?
|
Quote:
Originally Posted by Omirrow
I'm a hundred percent sure; the issue is about your "Message" function.
Can we see it?
|
There is no problem with Message, I did the same for SendClientMessage(i, -1 , "j");
Message works perfectly..
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
HoussamMaroc - 01.08.2017
i have fixed it
PHP код:
foreach(new i; i < Player) if(IsPlayerConnected(i)) Message(i, TYPE_SERVER, "FWEKOGE");
the message send to all connected players
Note: you will get a Error(indefined symbol "foreach") if you don't add #include foreach
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
Xeon™ - 02.08.2017
Quote:
Originally Posted by HoussamMaroc
i have fixed it
PHP код:
foreach(new i; i < Player) if(IsPlayerConnected(i)) Message(i, TYPE_SERVER, "FWEKOGE");
the message send to all connected players
Note: you will get a Error(indefined symbol "foreach") if you don't add #include foreach
|
No, just no. foreach is outdated and unstable. you must use the one in YSI.
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
HoussamMaroc - 02.08.2017
Quote:
Originally Posted by XeonMaster
No, just no. foreach is outdated and unstable. you must use the one in YSI.
|
#include YSI/

?
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
oMa37 - 02.08.2017
Quote:
Originally Posted by XeonMaster
No, just no. foreach is outdated and unstable. you must use the one in YSI.
|
Wait what? Foreach/y_Iterate is the fastest and the most stable loop to use.
OT: Just use
GetPlayerPoolSize() loop if you don't want to use foreach.
if this didn't work, the issue must be from your function.
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
OneDay - 02.08.2017
Quote:
Originally Posted by HoussamMaroc
i have fixed it
PHP код:
foreach(new i; i < Player) if(IsPlayerConnected(i)) Message(i, TYPE_SERVER, "FWEKOGE");
the message send to all connected players
Note: you will get a Error(indefined symbol "foreach") if you don't add #include foreach
|
no IsPlayerConnected just
PHP код:
foreach(new i : Player) Message(i, TYPE_SERVER, "FWEKOGE");
Re: for(new i; i< MAX_PLAYERS; i++) goes only for id 0 -
Arbico - 02.08.2017
Guys guys guys, i'm sure this guy is in the server alone, the first id is 0, and it works with 0 only, because he is the only one in the server, i'm pretty sure if you add more people it would work