Jump to content

Mesaj pentru toti jucatorii


AnDrEyUpS

Recommended Posts

Ma puteti ajuta cum fac sa apara un mesaj la toti jucatorii la aceasta comanda?

https://pastebin.com/GYrEpUpr

Am incercat si cu SCMTA(COLOR_INFO, %d a castigat 600.000$ din (legendary crate)."); si inloc de numele de la jucator  ( %d ) imi da niste numere random.?

Stie cineva cum pot sa fac?

Link to comment
Share on other sites

Acum 1 oră, WHG a spus:

%d reprezinta numere, pune %s si la sfarsit  dupa paranteze variabila GetName

SCMTA(COLOR_INFO, "(( Crates: %s A primit [32 Diamonds] din [Legendary Crate] ))",GetName(playerid));

SCMTA(COLOR_INFO, "(( Crates: %s A primit [32 Diamonds] din [Legendary Crate] ))", GetName(playerid)); // cu space dupa virgula

Imi da warning  la toate case 0, 1, 2 etc. Si nu vreau sa ramana cu warning. Stii de ce imi da asa?

  • Sad 1
Link to comment
Share on other sites

Acum 11 ore, AnDrEyUpS a spus:

SCMTA(COLOR_INFO, "(( Crates: %s A primit [32 Diamonds] din [Legendary Crate] ))",GetName(playerid));

SCMTA(COLOR_INFO, "(( Crates: %s A primit [32 Diamonds] din [Legendary Crate] ))", GetName(playerid)); // cu space dupa virgula

Imi da warning  la toate case 0, 1, 2 etc. Si nu vreau sa ramana cu warning. Stii de ce imi da asa?

incearca asa:

new fString[120];
format(fString, sizeof fString, "(( Crates: %s A primit [32 Diamonds] din [Legendary Crate] ))",GetName(playerid));
SCMTA(COLOR_INFO, fString);

si modifici tu la cazuri stringul

 

Link to comment
Share on other sites

new msgString[180];

format(msgString, sizeof(msgString), "%s a primit un legendary crate!", ReturnPlayerName(playerid));
SendClientMessageToAll(COLOR, msgString);

stock ReturnPlayerName(playerid) {
	new str[MAX_PLAYER_NAME];
	GetPlayerName(playerid, str, sizeof(str));
	return str;
}

Ceea ce ți-am dat eu, ar trebui să te ajute. Pentru fiecare case, faci un format și apoi te folosești de `SendClientMessageToAll` pentru a trimite mesaj tuturor jucătorilor.

Link to comment
Share on other sites

Acum 7 ore, extazi.sex a spus:

incearca asa:


new fString[120];
format(fString, sizeof fString, "(( Crates: %s A primit [32 Diamonds] din [Legendary Crate] ))",GetName(playerid));
SCMTA(COLOR_INFO, fString);

si modifici tu la cazuri stringul

 

Multumesc, am compilat gm-u doar si nu au fost erori... Revin cu edit daca merge.

Link to comment
Share on other sites

Acum 7 ore, matei_ a spus:

new msgString[180];

format(msgString, sizeof(msgString), "%s a primit un legendary crate!", ReturnPlayerName(playerid));
SendClientMessageToAll(COLOR, msgString);

stock ReturnPlayerName(playerid) {
	new str[MAX_PLAYER_NAME];
	GetPlayerName(playerid, str, sizeof(str));
	return str;
}

Ceea ce ți-am dat eu, ar trebui să te ajute. Pentru fiecare case, faci un format și apoi te folosești de `SendClientMessageToAll` pentru a trimite mesaj tuturor jucătorilor.

Am ales varianta lui extazi.sex deoarece sunt mai putine linii. Sper sa te nu superi. Oricum +1

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.

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