telephone problem
#1

i have a problem with GF telephone script.
if each phone. All People can see what you write

is it true or false?

under OnplayerText

if(Mobile[playerid] != 255)
{
new idx;
tmp = strtok(text, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Sagt (Handy): %s", sendername, text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
// printf("callers line %d called %d caller %d",Mobile[Mobile[playerid]],Mobile[playerid],playerid);
return 0;
}

Reply
#2

Quote:
Originally Posted by blax
i have a problem with GF telephone script.
if each phone. All People can see what you write

is it true or false?

under OnplayerText

Код:
if(Mobile[playerid] != 255)
			{
				new idx;
				tmp = strtok(text, idx);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "%s Sagt (Handy): %s", sendername, text);
				ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
			//	printf("callers line %d called %d caller %d",Mobile[Mobile[playerid]],Mobile[playerid],playerid);
      return 0;
   		}
Reply
#3

What is the problem?
Reply
#4

the problem is all players can read the Message
if two people call each other
Reply
#5

Show your ProxDetector function.

Should be something like this:

pawn Код:
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
...
Reply
#6

is that right?


Код:
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
	if(IsPlayerConnected(playerid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		//radi = 2.0; //Trigger Radius
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				GetPlayerPos(i, posx, posy, posz);
				tempposx = (oldposx -posx);
				tempposy = (oldposy -posy);
				tempposz = (oldposz -posz);
				//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
				if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
				{
					SendClientMessage(i, col1, string);
				}
				else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
				{
					SendClientMessage(i, col2, string);
				}
				else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
				{
					SendClientMessage(i, col3, string);
				}
				else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
				{
					SendClientMessage(i, col4, string);
				}
				else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
				{
					SendClientMessage(i, col5, string);
				}
			}
			else
			{
				SendClientMessage(i, col1, string);
			}
		}


	}	//not connected
	return 1;
}
Reply
#7

You mean all people in the server or only players who are near the talking player?
Reply
#8

only players who are near the talking player
can read the Message
if two people call each other, can the third player is near in the read message
Reply
#9

If you want that only talking players can hear what they say then:

pawn Код:
if(Mobile[playerid] != 255)
{
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s Sagt (Handy): %s", sendername, text);
    SendClientMessage(playerid, COLOR_FADE1, string);
    SendClientMessage(Mobile[playerid], COLOR_FADE1, string);
    //  printf("callers line %d called %d caller %d",Mobile[Mobile[playerid]],Mobile[playerid],playerid);
    return 0;
}
Reply
#10

that is right tank you
now the problem of the players cann see what i read before it goes off
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)