SA-MP Forums Archive
Is This Code Right ? - 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: Is This Code Right ? (/showthread.php?tid=307376)



Is This Code Right ? - Mr.Fames - 30.12.2011

hello guys just check and tell me if this code is right or not because when i compile it tells me tag mismatch
pawn Код:
public OnPlayerConnect(playerid)
{
    new tds[128];
    format(tds, sizeof(tds), "Score:%d",GetPlayerScore(playerid));
    Textdraw1[playerid] = TextDrawCreate(511.000000, 102.000000, tds);
    TextDrawBackgroundColor(Textdraw1[playerid], 16711935);
    TextDrawFont(Textdraw1[playerid], 1);
    TextDrawLetterSize(Textdraw1[playerid], 0.529999, 2.000000);
    TextDrawColor(Textdraw1[playerid], -1);
    TextDrawSetOutline(Textdraw1[playerid], 1);
    TextDrawSetProportional(Textdraw1[playerid], 1);
    TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
    new string[ 128 ];
    Textdraw0[playerid] = TextDrawCreate(517.000000, 81.000000, "Rank:~r~");
    TextDrawBackgroundColor(Textdraw0[playerid], 16711935);
    TextDrawFont(Textdraw0[playerid], 1);
    TextDrawLetterSize(Textdraw0[playerid], 0.524999, 2.000000);
    TextDrawColor(Textdraw0[playerid], -1);
    TextDrawSetOutline(Textdraw0[playerid], 1);
    TextDrawSetProportional(Textdraw0[playerid], 1);
    TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
        return 1;
}
if it is not right tell me the right one :P


Re: Is This Code Right ? - silvan - 30.12.2011

I think the problem is that you cant put stuff like ~r~ in textdraws you can only put them throu format.

format(string,sizeof(string),"Rank: %s", Player Rank variable HERE);
Textdraw0[playerid] = TextDrawCreate( 517.00000, 81.00000, string);

I hope this will work. + rep me if it did.


Re: Is This Code Right ? - Mr.Fames - 30.12.2011

Quote:
Originally Posted by silvan
Посмотреть сообщение
I think the problem is that you cant put stuff like ~r~ in textdraws you can only put them throu format.

format(string,sizeof(string),"Rank: %s", Player Rank variable HERE);
Textdraw0[playerid] = TextDrawCreate( 517.00000, 81.00000, string);

I hope this will work. + rep me if it did.
thx by the way i will try it at the soonest time if it works i will +rep u :P


Re: Is This Code Right ? - Norck - 30.12.2011

Quote:
Originally Posted by silvan
Посмотреть сообщение
I think the problem is that you cant put stuff like ~r~ in textdraws you can only put them throu format.
Actually you can use it without format.

In which line(s) do you have a tag mismatch warning(s)?