SendRPMessage(playerid,Float:tmpRange,tmpMsg[]) {
new Float:Pos[3],
string[128],
Length = strlen(tmpMsg);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
foreach(new i : Player) {
if(IsPlayerConnected(i)) {
if(IsPlayerInRangeOfPoint(i,tmpRange,Pos[0],Pos[1],Pos[2])) {
if(Length > 80) {
strmid(string, tmpMsg, 0, Length / 2);
Msg(i,-1,tmpMsg);
strmid(string, tmpMsg, Length / 2, Length);
Msg(i,-1,tmpMsg);
}
else {
Msg(i,-1,tmpMsg);
}
}
}
}
return true;
}
SendRPMessage(playerid,Float:tmpRange,tmpMsg[]) {
new Float:Pos[3],
string[128],
Length = strlen(tmpMsg);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
foreach(new i : Player) {
if(IsPlayerConnected(i)) {
if(IsPlayerInRangeOfPoint(i,tmpRange,Pos[0],Pos[1],Pos[2])) {
if(Length > 80) {
strmid(string, tmpMsg, 0, Length/2);
Msg(i,-1,string);
strmid(string, tmpMsg, Length/2, Length);
Msg(i,-1,string);
}
else {
Msg(i,-1,tmpMsg);
}
}
}
}
return true;
}
SendRPMessage(playerid,Float:tmpRange,tmpMsg[]) {
new Float:Pos[3],
string[128],
Length = strlen(tmpMsg);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
foreach(new i : Player) {
if(IsPlayerConnected(i)) {
if(IsPlayerInRangeOfPoint(i,tmpRange,Pos[0],Pos[1],Pos[2])) {
if(Length > 80) {
strmid(string, tmpMsg, 0, Length / 2);
Msg(i,-1,tmpMsg);
strmid(string, tmpMsg, Length / 2, Length);
Msg(i,-1,tmpMsg);
}
else {
Msg(i,-1,tmpMsg);
}
}
}
}
return true;
}
SendRPMessage(playerid,Float:tmpRange,tmpMsg[]) {
new Float:Pos[3],
string[128],
Length = strlen(tmpMsg);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
foreach(new i : Player) {
if(IsPlayerConnected(i)) {
if(IsPlayerInRangeOfPoint(i,tmpRange,Pos[0],Pos[1],Pos[2])) {
if(Length > 80) {
strmid(string, tmpMsg, 0, Length/2);
Msg(i,-1,string);
strmid(string, tmpMsg, Length/2, Length);
Msg(i,-1,string);
}
else {
Msg(i,-1,tmpMsg);
}
}
}
}
return true;
}
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);
}
else if(IsPlayerInRangeOfPoint(i,20,Pos[0],Pos[1],Pos[2])) {
format(message, sizeof(message), "{BABABA} %s", text);
SendRPMessage(playerid,20,message);
}
}
}
else {
Msg(playerid,COLOR_RED,"You are muted. You cannot speak");
return 0;
}
return 0;
}
|
There is a slight problem
With that code + PHP код:
|
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;
}
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);
}
, so you just have to end the loop at one of that, by adding return 0; to end it.
|
Yeah there is a slight problem, range 20 wont be seen for soem reason
EDIT: I seen what my buddy wrote in range 20 but he doesnt when I talk |
else if(IsPlayerInRangeOfPoint(i,20,Pos[0],Pos[1],Pos[2]))
{
format(message, sizeof(message), "{BABABA} %s", text);
SendRPMessage(playerid,20,message);
return 0;
}
if(IsPlayerInRangeOfPoint(i,20,Pos[0],Pos[1],Pos[2]))
{
format(message, sizeof(message), "{BABABA} %s", text);
SendRPMessage(playerid,20,message);
return 0;
}