Need help with chat system
#1

Alright,so,as you know from starting a new GM and the Grand Larcette(Not sure if it's this name) ,when you type a message and press ENTER,it sends it to all. I guess over 60% of you readers have played on Roleplay scripts and I need to find a way scripting the chat to be like in RP one-shows the messages only to the people surrounding you.

Thank you from earlier.
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[]) {
    new Float:x, Float:y, Float:z, msg[128], name[MAX_PLAYER_NAME];
    GetPlayerPos(playerid, x, y, z);
    GetPlayerName(playerid, name, sizeof(name));
    format(msg, sizeof(msg), "%s (%d): %s", name, playerid, text);
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerInRangeOfPoint(i, [range], x, y, z)) {
            SendClientMessage(i, COLOR_WHITE, msg);
        }      
    }
    return 0;
}
Make sure to change [range]
Reply
#3

Uuhm,well for me IDK why the "GetPlayerName" won't work. Could you please see why it is like that and if it needs a file for #include,send it to me. All reputation goes to you btw.
Reply
#4

Click, and follow the tutorial in my signature. It covers all the RP chats, and I can assure you all the code posted in there is tested and works 100%.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)