26.03.2013, 18:33
(
Последний раз редактировалось CoaPsyFactor; 26.03.2013 в 19:10.
)
I am not able to find what is wrong here, but every time player use command /b or any chat server freezes, here is code that should SendClientMessage
and HERE is txt file with same function, but one is with while and other is with for, the one with for works fine.
pawn Код:
Loop = 0;
while(Loop < MAX_PLAYERS){
if(IsPlayerConnected(Loop) && Int == GetPlayerInterior(Loop) && Viwo == GetPlayerVirtualWorld(Loop)){
if(PlayerNearPlayer(playerid, Loop, radius/16)){
if(Num < 2) SendClientMessage(Loop, color1, message);
else {
while(i < Num){
if(i) format(Message, 92, "...%s", message[(i*64)+1]);
else format(Message, 67, "%.64s...", message);
SendClientMessage(Loop, color1, Message);
i++;
}
}
}else if(PlayerNearPlayer(playerid, Loop, radius/8)){
if(Num < 2) SendClientMessage(Loop, color2, message);
else {
i = 0;
while(i < Num){
if(i) format(Message, 92, "...%s", message[(i*64)+1]);
else format(Message, 67, "%.64s...", message);
SendClientMessage(Loop, color2, Message);
i++;
}
}
}else if(PlayerNearPlayer(playerid, Loop, radius/4)){
if(Num < 2) SendClientMessage(Loop, color3, message);
else {
i = 0;
while(i < Num){
if(i) format(Message, 92, "...%s", message[(i*64)+1]);
else format(Message, 67, "%.64s...", message);
SendClientMessage(Loop, color3, Message);
i++;
}
}
}else if(PlayerNearPlayer(playerid, Loop, radius/2)){
if(Num < 2) SendClientMessage(Loop, color4, message);
else {
i = 0;
while(i < Num){
if(i) format(Message, 92, "...%s", message[(i*64)+1]);
else format(Message, 67, "%.64s...", message);
SendClientMessage(Loop, color4, Message);
i++;
}
}
}else if(PlayerNearPlayer(playerid, Loop, radius)){
if(Num < 2) SendClientMessage(Loop, color5, message);
else {
i = 0;
while(i < Num){
if(i) format(Message, 92, "...%s", message[(i*64)+1]);
else format(Message, 67, "%.64s...", message);
SendClientMessage(Loop, color5, Message);
i++;
}
}
}
}
Loop++;
}