Jump to content

OnPlayerText


Domnu.MC

Recommended Posts

  • 3 weeks later...

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.