PDA

View Full Version : [Help] Textdraws!


ivanVU
21/06/2012, 11:02 AM
I have this under OnPlayerSpawn :

// Rankovi
new string[128],string1[128],ranktext[64],hrvat,englez,ubojstva,smrti,kdr;
hrvat = (PlayerInfo[playerid][pJezik] == 1) ? (1) : (0);
englez = (PlayerInfo[playerid][pJezik] == 2) ? (1) : (0);
ubojstva = PlayerInfo[playerid][pUbojstva];
smrti = PlayerInfo[playerid][pSmrti];
kdr = ubojstva/smrti;
// hrvatski
if(PlayerInfo[playerid][pUbojstva] > 0 && PlayerInfo[playerid][pUbojstva] < 25 && hrvat) { ranktext="Regrut"; }
if(PlayerInfo[playerid][pUbojstva] > 25 && PlayerInfo[playerid][pUbojstva] < 50 && hrvat) { ranktext="Vojnik"; }
if(PlayerInfo[playerid][pUbojstva] > 50 && PlayerInfo[playerid][pUbojstva] < 100 && hrvat) { ranktext="Vodnik"; }
if(PlayerInfo[playerid][pUbojstva] > 100 && PlayerInfo[playerid][pUbojstva] < 250 && hrvat) { ranktext="Porucnik"; }
if(PlayerInfo[playerid][pUbojstva] > 250 && PlayerInfo[playerid][pUbojstva] < 500 && hrvat) { ranktext="Kapetan"; }
if(PlayerInfo[playerid][pUbojstva] > 500 && PlayerInfo[playerid][pUbojstva] < 1000 && hrvat) { ranktext="Major"; }
if(PlayerInfo[playerid][pUbojstva] > 1000 && PlayerInfo[playerid][pUbojstva] < 2000 && hrvat) { ranktext="Zapovjednik"; }
if(PlayerInfo[playerid][pUbojstva] > 2000 && PlayerInfo[playerid][pUbojstva] < 3000 && hrvat) { ranktext="Pukovnik"; }
if(PlayerInfo[playerid][pUbojstva] > 3000 && PlayerInfo[playerid][pUbojstva] < 4500 && hrvat) { ranktext="General"; }
if(PlayerInfo[playerid][pUbojstva] > 4500 && PlayerInfo[playerid][pUbojstva] < 6000 && hrvat) { ranktext="Feldmarsal"; }
if(PlayerInfo[playerid][pUbojstva] > 6000 && PlayerInfo[playerid][pUbojstva] < 8000 && hrvat) { ranktext="Vrhovni Marsal"; }
if(PlayerInfo[playerid][pUbojstva] > 8000 && PlayerInfo[playerid][pUbojstva] < 10000 && hrvat) { ranktext="Nacionalna Sila"; }
if(PlayerInfo[playerid][pUbojstva] > 10000 && hrvat) { ranktext="Svjetska Sila"; }
// engleski
if(PlayerInfo[playerid][pUbojstva] > 0 && PlayerInfo[playerid][pUbojstva] < 25 && englez) { ranktext="Recruit"; }
if(PlayerInfo[playerid][pUbojstva] > 25 && PlayerInfo[playerid][pUbojstva] < 50 && englez) { ranktext="Private"; }
if(PlayerInfo[playerid][pUbojstva] > 50 && PlayerInfo[playerid][pUbojstva] < 100 && englez) { ranktext="Sergeant"; }
if(PlayerInfo[playerid][pUbojstva] > 100 && PlayerInfo[playerid][pUbojstva] < 250 && englez) { ranktext="Lieutenant"; }
if(PlayerInfo[playerid][pUbojstva] > 250 && PlayerInfo[playerid][pUbojstva] < 500 && englez) { ranktext="Captain"; }
if(PlayerInfo[playerid][pUbojstva] > 500 && PlayerInfo[playerid][pUbojstva] < 1000 && englez) { ranktext="Major"; }
if(PlayerInfo[playerid][pUbojstva] > 1000 && PlayerInfo[playerid][pUbojstva] < 2000 && englez) { ranktext="Commander"; }
if(PlayerInfo[playerid][pUbojstva] > 2000 && PlayerInfo[playerid][pUbojstva] < 3000 && englez) { ranktext="Colonel"; }
if(PlayerInfo[playerid][pUbojstva] > 3000 && PlayerInfo[playerid][pUbojstva] < 4500 && englez) { ranktext="General"; }
if(PlayerInfo[playerid][pUbojstva] > 4500 && PlayerInfo[playerid][pUbojstva] < 6000 && englez) { ranktext="Field Marsal"; }
if(PlayerInfo[playerid][pUbojstva] > 6000 && PlayerInfo[playerid][pUbojstva] < 8000 && englez) { ranktext="Supreme Marshal"; }
if(PlayerInfo[playerid][pUbojstva] > 8000 && PlayerInfo[playerid][pUbojstva] < 10000 && englez) { ranktext="National Force"; }
if(PlayerInfo[playerid][pUbojstva] > 10000 && englez) { ranktext="World Class Force"; }
format(string, sizeof(string), "~r~Rank: ~w~%s ~r~Ubojstva: ~w~%d ~r~Smrti: ~w~%d ~r~KDR: ~w~%0.2d", ranktext,ubojstva,smrti,kdr);
format(string1, sizeof(string1), "~r~Rank: ~w~%s ~r~Kills: ~w~%d ~r~Deaths: ~w~%d ~r~KDR: ~w~%0.2d", ranktext,ubojstva,smrti,kdr);
if(PlayerInfo[playerid][pJezik] == 1)
{
TextDrawSetString(Nesto1, string);
}
if(PlayerInfo[playerid][pJezik] == 2)
{
TextDrawSetString(Nesto1, string1);
}
TextDrawShowForPlayer(playerid,Nesto0);
TextDrawShowForPlayer(playerid,Nesto1);

And the textdraws won't show!

Mimic
21/06/2012, 01:02 PM
I don't see this > http://wiki.sa-mp.com/wiki/TextDrawCreate

Plus, I don't see where "Nesto0" or "Nesto1" is defined. You might need to show me a little bit more code for me to help you buddy.

nilanjay
21/06/2012, 01:07 PM
why you put ';' inside the brackets {}? ???

ivanVU
21/06/2012, 07:47 PM
new Text:Nesto0;
new Text:Nesto1;

And

Nesto0 = TextDrawCreate(650.000000, 426.000000, "~n~");
TextDrawBackgroundColor(Nesto0, 255);
TextDrawFont(Nesto0, 1);
TextDrawLetterSize(Nesto0, 0.500000, 0.099999);
TextDrawColor(Nesto0, -1);
TextDrawSetOutline(Nesto0, 0);
TextDrawSetProportional(Nesto0, 1);
TextDrawSetShadow(Nesto0, 1);
TextDrawUseBox(Nesto0, 1);
TextDrawBoxColor(Nesto0, 255);
TextDrawTextSize(Nesto0, -20.000000, 0.000000);

Nesto1 = TextDrawCreate(7.000000, 426.000000, "Rank: World Class Force Next Rank:0/9001 Kills: 10000 Deaths: 1000 KDR: 0.2234");
TextDrawBackgroundColor(Nesto1, 255);
TextDrawFont(Nesto1, 2);
TextDrawLetterSize(Nesto1, 0.349999, 2.399999);
TextDrawColor(Nesto1, -1);
TextDrawSetOutline(Nesto1, 0);
TextDrawSetProportional(Nesto1, 1);
TextDrawSetShadow(Nesto1, 1);

Mimic
21/06/2012, 09:06 PM
TextDrawColor(Nesto0, -1);

I don't really use TextDraw's and aren't that familiar with them, but this is confusing me slightly? Why is it -1, according to the wiki

http://wiki.sa-mp.com/wiki/TextDrawColor

It's suppose to be a COLOR for example, 0xFFFFFFF. The fact that it compiles is confusing me also.

ivanVU
22/06/2012, 11:23 AM
I don't know why's it typing -1 there, i used zamaroth(i wrote it wrong)'s, textdraw editor, and it gave me that results.

i'll try to change it and than test..