[Help] Textdraws! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Textdraws! (
/showthread.php?tid=352841)
[Help] Textdraws! -
ivanVU - 21.06.2012
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!
Re: [Help] Textdraws! -
Mimic - 21.06.2012
I don't see this >
https://sampwiki.blast.hk/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.
Re: [Help] Textdraws! -
nilanjay - 21.06.2012
why you put ';' inside the brackets {}?
Re: [Help] Textdraws! -
ivanVU - 21.06.2012
Код:
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);
Re: [Help] Textdraws! -
Mimic - 21.06.2012
pawn Код:
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
https://sampwiki.blast.hk/wiki/TextDrawColor
It's suppose to be a
COLOR for example, 0xFFFFFFF. The fact that it compiles is confusing me also.
Re: [Help] Textdraws! -
ivanVU - 22.06.2012
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..