#1

Does anyone is having a stock for something like: SendMessageAround or something like that?
I wanna send messages around the player (roleplay) in a radius people need to hear it but other peoples won't.
Reply
#2

here:(try)
pawn Код:
stock SendClientMessageInRadius(playerid,Float:Radius,Float:X, Float:Y, Float:Z, string[], COLOR)
{
 if(IsPlayerInRangeOfPoint(playerid,Radius,X ,Y ,Z))SendClientMessage(playerid,COLOR,string);
 return 1;
}
Reply
#3

Quote:
Originally Posted by xkirill
Посмотреть сообщение
heretry)
pawn Код:
stock SendClientMessageInRadius(playerid,Float:Radius,Float:X, Float:Y, Float:Z, string[], COLOR)
{
 if(IsPlayerInRangeOfPoint(playerid,Radius,X ,Y ,Z))SendClientMessage(playerid,COLOR,string);
 return 1;
}
You have to loop it as-well so every player around receives the message and not only "playerid".

pawn Код:
stock SendClientMessageInRadius(playerid,Float:Radius,Float:X, Float:Y, Float:Z, string[], COLOR)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,Radius,X ,Y ,Z))
        {
            SendClientMessage(i,COLOR,string);
        }
    }
    return 1;
}
Reply
#4

Both thanks. I will test it when I have my buddy online. I will keep this updated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)