SA-MP Forums Archive
solved - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: solved (/showthread.php?tid=208780)



solved - jaksimaksi - 09.01.2011

solved


Re: problem... - MadeMan - 09.01.2011

You create the textdraws every time the player spawns. Create them OnPlayerConnect and destroy OnPlayerDisconnect.

pawn Код:
public OnPlayerConnect(playerid)
{
    Textdraw0[playerid] = TextDrawCreate(504.000000,103.000000,"Level");
    Textdraw1[playerid] = TextDrawCreate(505.000000,116.000000,"Xp:");
    TextDrawAlignment(Textdraw0[playerid],0);
    TextDrawAlignment(Textdraw1[playerid],0);
    TextDrawBackgroundColor(Textdraw0[playerid],0x000000ff);
    TextDrawBackgroundColor(Textdraw1[playerid],0x000000ff);
    TextDrawFont(Textdraw0[playerid],1);
    TextDrawLetterSize(Textdraw0[playerid],0.299999,1.000000);
    TextDrawFont(Textdraw1[playerid],1);
    TextDrawLetterSize(Textdraw1[playerid],0.299999,0.899999);
    TextDrawColor(Textdraw0[playerid],0xffffffff);
    TextDrawColor(Textdraw1[playerid],0xffffffff);
    TextDrawSetOutline(Textdraw0[playerid],1);
    TextDrawSetOutline(Textdraw1[playerid],1);
    TextDrawSetProportional(Textdraw0[playerid],1);
    TextDrawSetProportional(Textdraw1[playerid],1);
    TextDrawSetShadow(Textdraw0[playerid],1);
    TextDrawSetShadow(Textdraw1[playerid],1);

    TextDrawShowForPlayer(playerid,Textdraw0[playerid]);
    TextDrawShowForPlayer(playerid,Textdraw1[playerid]);
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawDestroy(Textdraw0[playerid]);
    TextDrawDestroy(Textdraw1[playerid]);
}