for(new i; i< MAX_PLAYERS; i++) goes only for id 0
#1

PHP код:
for(new iMAX_PLAYERSi++) Message(iTYPE_SERVER"FWEKOGE"); 
is working only for id 0 to me for some reason, any ideas?
Reply
#2

What is Message?
Reply
#3

Quote:
Originally Posted by Lirbo
Посмотреть сообщение
PHP код:
for(new iMAX_PLAYERSi++) Message(iTYPE_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?
Reply
#4

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..
Reply
#5

i have fixed it
PHP код:
foreach(new iPlayer) if(IsPlayerConnected(i)) Message(iTYPE_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
Reply
#6

Quote:
Originally Posted by HoussamMaroc
Посмотреть сообщение
i have fixed it
PHP код:
foreach(new iPlayer) if(IsPlayerConnected(i)) Message(iTYPE_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.
Reply
#7

Quote:
Originally Posted by XeonMaster
Посмотреть сообщение
No, just no. foreach is outdated and unstable. you must use the one in YSI.
#include YSI/?
Reply
#8

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.
Reply
#9

Quote:
Originally Posted by HoussamMaroc
Посмотреть сообщение
i have fixed it
PHP код:
foreach(new iPlayer) if(IsPlayerConnected(i)) Message(iTYPE_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 PlayerMessage(iTYPE_SERVER"FWEKOGE"); 
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)