Problem with ID 0
#1

Ey guys !
So i've been working on a code for OnPlayerText :


public OnPlayerText(playerid, text[])
{
new string[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{

if(IsPlayerNearPlayer(i, playerid, 20.0))
{
format(string,sizeof(string),"%s : %s",name,text);
ProxDetector(20.0,playerid,string,GetPlayerColor(p layerid),GetPlayerColor(playerid),GetPlayerColor(p layerid),GetPlayerColor(playerid),GetPlayerColor(p layerid));
return 0;
} else {
SendClientMessage(playerid, COLOR_WHITE, "[INFO] You are too far, no one hear you ! ");
return 0;
}

}
}
return 0;
}

So basically, when the player is around other players, they will hear what he said, otherwise, if he's too far, no one will get what he said, and he will receive a msg '[INFO] You are too far, no one hear you !'
That works with a player ( ID : 1 ) who tested it with me !
but for me ( ID : 0 ), I always can send the msg, no matter if i'm near or far other players !

Would be cool to get some help, and thanks
Reply


Messages In This Thread
Problem with ID 0 - by Takumi.WS - 09.08.2011, 16:46
Re: Problem with ID 0 - by Shadoww5 - 09.08.2011, 17:03
Re: Problem with ID 0 - by Norck - 09.08.2011, 17:11
Re: Problem with ID 0 - by Cameltoe - 09.08.2011, 17:16
Re: Problem with ID 0 - by Takumi.WS - 09.08.2011, 17:44
Re: Problem with ID 0 - by Cameltoe - 09.08.2011, 17:48
Re: Problem with ID 0 - by Takumi.WS - 09.08.2011, 18:01
Re: Problem with ID 0 - by Cameltoe - 09.08.2011, 18:07
Re: Problem with ID 0 - by Takumi.WS - 09.08.2011, 18:14
Re: Problem with ID 0 - by Cameltoe - 09.08.2011, 18:19

Forum Jump:


Users browsing this thread: 1 Guest(s)