#1

How to make that when a player types something the message will show only to near players??
I want like in LS-RP?
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
new Float:pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInRangeOfPoint(i, range, pPos[0], pPos[1], pPos[2]) continue;//Put sg instead of range
SendClientMessage(i, 0xffffffff, text);
}
return 0;
}
Reply
#3

Quote:
Originally Posted by Nonameman
Посмотреть сообщение
pawn Код:
public OnPlayerText(playerid, text[])
{
new Float:pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInRangeOfPoint(i, range, pPos[0], pPos[1], pPos[2]) continue;//Put sg instead of range
SendClientMessage(i, 0xffffffff, text);
}
return 0;
}
Or you can do in OnGameModeInit();
pawn Код:
LimitGlobalChatRadius(/*RADIUS*/);
I recommend the Radius, 10.0.

Greetin's
Reply
#4

Thnx. Now I'm on my laptop, when I get my PC back, because my script is there
Reply
#5

Shit it's not working. It gets a error: Expected token at ; but found ) at line
if(!IsPlayerInRangeOfPoint(i, range, pPos[0], pPos[1], pPos[2]) continue;//Put sg instead of range
How to fix it??
I wanted when player writes for example he says "Hello"
It will write "GangsTa[MD] says: Hello"
To the range 0.
What about /me command at this range?
Reply
#6

if(!IsPlayerInRangeOfPoint(i, range, pPos[0], pPos[1], pPos[2]))
Reply
#7

Undefined symbol Range
Reply
#8

Change the range with 10.0
Reply
#9

pawn Код:
new Float:x, Float:y, Float:z, string[128];
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string),"%s", text);
for(new i; i < MAX_PLAYERS; i++)
{
    if(IsPlayerInRangeOfPoint(i, 10, x, y, z))
    {
        SendPlayerMessageToPlayer(i, playerid, string);
    }
}
Add this at OnPlayerText(playerid, text[])
Reply
#10

Also make sure that on OnPlayerText returns 0 other wise it will send hower you do the chat and also the SA:MP server deafult chat.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)