Jump to content

Question

Posted

Am pus un script ca sa scrie playerii in chat cu culoarea factiunii lor, dar cand cineva scrie ceva vede Tot serverul, si eu vreau sa se vada doar pe o raza mica.. cum e normal pe toate serverele.. nu stiu ce sa fac, ma puteti ajuta? :(

[pawn]

{

new  pName[MAX_PLAYER_NAME], String[150];

GetPlayerName(playerid, pName, sizeof(pName));

format(String, sizeof(String), "%s: {FFFFFF}%s", pName, text);

SendClientMessageToAll(GetPlayerColor(playerid), String);

return 0;

}[/pawn]

4 answers to this question

Recommended Posts

Posted

Pai da din cauza lui asta SendClientMessageToAll(GetPlayerColor(playerid), String);, trebuie sa faci o functie care sa trimita mesaj celor din factiune doar.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

Vreau sa le trimita celor din jurul meu, nu celor din factiune... Pai si nu stiu ce trebuie sa pun in loc de SendClientMessageToAll ... :(

Posted

Atunci foloseste functia asta [pawn]stock SendRangedMessage(sourceid, color, message[], Float:range)

{

    new Float:x, Float:y, Float:z;

    GetPlayerPos(sourceid, x, y, z);

    for(new i = 0; i < MAX_PLAYERS; i++)

    {

        if(PlayerInfo[Logged] == 1)

        {

            if(GetPlayerVirtualWorld(sourceid) == GetPlayerVirtualWorld(i))

            {

                if(IsPlayerInRangeOfPoint(i, range, x, y, z))

                {

                    SendClientMessage(i, color, message);

                }

            }

        }

    }

    return 1;

}[/pawn]

SendRangedMessage(sourceid, color, message[], Float:range)

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.