25.12.2013, 11:45
How Can I disable when i enter soem text and press enter, that everyone in the server can see it
I want my chat to be like rp
I want my chat to be like rp
public OnPlayerText(playerid, text[])
{
return 0;
}
public OnPlayerText(playerid, text[])
{
new name[24],string[126];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s[%d]: %s",name,playerid,text);
SendNearMessage(playerid, -1, string);
return 0;
}
stock SendNearMessage(playerid, color, string[])
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
for(new i; i <= MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i,100.0, x,y,z)) SendClientMessage(i, color, string);
}
return 1;
}
public OnPlayerText(playerid, text[])
{
new PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
new String[128]; format(String, sizeof(String), "%s[%d]: %s", PlayerName, playerid, text);
new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2]))
{
SendClientMessage(i, -1, String);
}
}
return 0;
}