SA-MP Forums Archive
Textdraw help - 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: Textdraw help (/showthread.php?tid=549699)



Textdraw help - Airblog - 08.12.2014

Hello
i'm trying to create a textdraw that show every players them name and id
i don't know how can i repair it
Код:
new Text:tdsite20[MAX_PLAYERS];
i put it under ongamemodeinit
Код:
new playerid;
	tdsite20[playerid] = TextDrawCreate(465.000000, 432.000000, "Name & iD");
	TextDrawBackgroundColor(tdsite20[playerid], 255);
	TextDrawFont(tdsite20[playerid], 1);
	TextDrawLetterSize(tdsite20[playerid], 0.000000, 16.000000);
	TextDrawColor(tdsite20[playerid], -1);
	TextDrawSetOutline(tdsite20[playerid], 0);
	TextDrawSetProportional(tdsite20[playerid], 1);
	TextDrawSetShadow(tdsite20[playerid], 1);
	TextDrawUseBox(tdsite20[playerid], 0);
	TextDrawBoxColor(tdsite20[playerid], 85);
	TextDrawTextSize(tdsite20[playerid], 460.000000, 30.000000);
	TextDrawSetSelectable(tdsite20[playerid], 0);
and put this under onplayerconnect
Код:
	new string[128];
	format(string,sizeof(string)," %s ( %d )", RPN(playerid), playerid);
    TextDrawSetString(tdsite20[playerid], string);
    TextDrawShowForPlayer(playerid,tdsite20[playerid]);



Re: Textdraw help - HY - 08.12.2014

pawn Код:
new Text:tdsite20;

public OnPlayerConnect(playerid)
{
    tdsite20 = TextDrawCreate(465.000000, 432.000000, "Name & iD");
    TextDrawBackgroundColor(tdsite20, 255);
    TextDrawFont(tdsite20, 1);
    TextDrawLetterSize(tdsite20, 0.000000, 16.000000);
    TextDrawColor(tdsite20, -1);
    TextDrawSetOutline(tdsite20, 0);
    TextDrawSetProportional(tdsite20, 1);
    TextDrawSetShadow(tdsite20, 1);
    TextDrawUseBox(tdsite20, 0);
    TextDrawBoxColor(tdsite20, 85);
    TextDrawTextSize(tdsite20, 460.000000, 30.000000);
    TextDrawSetSelectable(tdsite20, 0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(string,sizeof(string),"%s ( %d )", name, playerid);
    TextDrawSetString(tdsite20, string);
    TextDrawShowForPlayer(playerid, tdsite20);
    return 1;
}



Re: Textdraw help - Clad - 08.12.2014

I suggest you to put this under OnPlayerSpawn
pawn Код:
new string[128];
    format(string,sizeof(string)," %s ( %d )", RPN(playerid), playerid);
    TextDrawSetString(tdsite20[playerid], string);
    TextDrawShowForPlayer(playerid,tdsite20[playerid]);