05.01.2016, 14:54
Not tested, but this should fix it:
Tell me if it didn't though.
EDIT: Your problem is this:
Basically, the player will be in range of 10.0 and 20.0, because 10 is included in 20 , so you just have to end the loop at one of that, by adding return 0; to end it.
Код:
public OnPlayerText(playerid, text[]) { new message[128]; new Float:Pos[3]; if(AccInfo[playerid][Muted] == 0) { GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); format(message, sizeof(message), "%s says: %s", GetRoleplayName(playerid), text); IC_ChatLog(message); SetPlayerChatBubble(playerid, text, 0xFFFFFF, 10.0, 3000); foreach(new i : Player) { if(IsPlayerInRangeOfPoint(i,10,Pos[0],Pos[1],Pos[2])) { format(message, sizeof(message), "{FFFFFF} %s", text); SendRPMessage(playerid,10,message); return 0; } else if(IsPlayerInRangeOfPoint(i,20,Pos[0],Pos[1],Pos[2])) { format(message, sizeof(message), "{BABABA} %s", text); SendRPMessage(playerid,20,message); return 0; } } } else { Msg(playerid,COLOR_RED,"You are muted. You cannot speak"); return 0; } return 0; }
EDIT: Your problem is this:
Код:
if(IsPlayerInRangeOfPoint(i,10,Pos[0],Pos[1],Pos[2])) { format(message, sizeof(message), "{FFFFFF} %s", text); SendRPMessage(playerid,10,message); } else if(IsPlayerInRangeOfPoint(i,20,Pos[0],Pos[1],Pos[2])) { format(message, sizeof(message), "{BABABA} %s", text); SendRPMessage(playerid,20,message); }