Jump to content
  • 0

pomoc Player info


Pulpisek

Dotaz

Zdravím chtěl bych si udělat hráčovo info před dialog stylu MSG box

Jenže prostě netuším jak na to.

Na netu jsem našel nějak ale v normál textu, ale v dialogu vůbec an serverech to vidím často.

Udělal jsme sám toto ale je to prostě blbost v které je furt něco špatně :

Stačilo by mě trochu nakopat abych to pochopil. :d :D

if(strcmp(cmdtext, "/moje", true) == 0){ //Toto je když zadáte /kill tak vám to udělá to co máte za {
ShowPlayerDialog(playerid,20000,DIALOG_STYLE_MSGBOX,"Info tabulka", [Nick: %d] [ID: %d] [Peníze: %d] [Zabil jsem: %d] [Zabili mě: %d]  " ,"OK","KONEC" GetPlayerName, GetPlayerID, GetPlayerMoney(playerid), zabitejch[playerid], zabitej[playerid] );
return 1;
}
Link to comment
Share on other sites

9 odpovědí na tuto otázku

Recommended Posts

  • 0

Ehm -__-

To co jsi napsal je blbost :d
 

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

new str[256];
format(str,sizeof(str),"[Nick: %d] [ID: %d] [Peníze: %d] [Zabil jsem: %d] [Zabili mě: %d]",GetName(playerid), playerid, GetPlayerMoney(playerid), zabitejch[playerid], zabitej[playerid]);

ShowPlayerDialog(playerid,20000,DIALOG_STYLE_MSGBOX,"TVE STATS",str,"Ok","");

 

Link to comment
Share on other sites

  • 0

Ajo už chápu hele a dá se někde najít to jak tu řešíte  že když je nick tak má být %s  nevím pod čím to hledat :)

 

 

Format Strings Placeholder Meaning %b Inserts a number at this position in binary radix %c Inserts a single character. %d Inserts an integer (whole) number %f Inserts a floating point number. %i Inserts an integer. %s Inserts a string. %x Inserts a number in hexadecimal notation. %% Inserts the literal '%'
Link to comment
Share on other sites

  • 0

Tak dedukuj, jak odesilas formatovanou zpravu do chatu?

 

new string[128];

format(string,sizeof(string),"[Nick: %d] [ID: %d] [Peníze: %d] [Zabil jsem: %d] [Zabili mě: %d]",GetPlayerName, GetPlayerID, GetPlayerMoney(playerid), zabitejch[playerid], zabitej[playerid]);

SendClientMessage(playerid,-1,string);

 

Je to snad dohromady ? Tak obdobne bude i dialog :)

 

new string[128];

format(string,sizeof(string),"[Nick: %d] [ID: %d] [Peníze: %d] [Zabil jsem: %d] [Zabili mě: %d]",GetPlayerName, GetPlayerID, GetPlayerMoney(playerid), zabitejch[playerid], zabitej[playerid]);

ShowPlayerDialog(playerid,20000,DIALOG_STYLE_MSGBOX,"Info tabulka",string,"OK","KONEC");

 

proste format dela to, ze do nejake promene nastavi text a ten text mas v te promene a tu promenou zobrazujes v dane funkci

 

Jinak

%s je pro text (nick atp.)

%d je cislo

%.1f je desetine cislo s jednim desetinym cislem

%.2f je desetine cislo s dvema desetinyma cislama

..

%.5f je desetine cislo s jednim desetinyma cislama

%.f je desetine cislo se vsema mistama (vic jak 6 jich pawno nema)

Link to comment
Share on other sites

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