Jump to content

Recommended Posts

Posted

Salut, as vrea ca pe server sa nu fie chat global, adica daca un player scrie ceva, ce a scris el sa fie vazut doar de cei de langa el. Ma poate ajuta cineva?? 

  • 3 weeks later...
Posted

Salut! Te voi ajuta eu.

 

In primul rand, la public OnPlayerText(playerid, text[]) inloc de return 1; pui return 0; deoarece de acum noi vom formata textul.

 

Unde ai stock-urile adaugi aceste stock-uri

stock SendNearbyMessage(playerid, text[], color, Float:range) {
  	new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
  	foreach(Player, i) {
     	if(IsPlayerInRangeOfPoint(i, range, X, Y, Z)) {
          	SendClientMessage(i, color, text);
        }
    }
 	return 1; 
}

stock GetName(playerid) {
  	new PName[25];
  	GetPlayerName(playerid, PName, sizeof(PName);
 	return PName; 
}

Inloiesti public OnPlayerText(playerid, text[]) cu asta:

public OnPlayerText(playerid, text[]) {
	new str[128];
  	format(str, sizeof(str), "%s says: %s", GetName(playerid), text);
  	SendNearbyMessage(playerid, str, -1, 30.0);
	return 0;
}

Dupa cum vezi, este ceva chiar simplu. Poti schimba 30.0 cu ce distanta vrei tu, -1 cu ce culoare (aici e alb).

 

Sper ca te-am ajutat, iar daca mai ai nevoie de ceva te rog sa-mi dai un PM sau reply la topic. Succes!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.