textdraw Above the head On ClassSelection - 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: textdraw Above the head On ClassSelection (
/showthread.php?tid=176826)
textdraw Above the head On ClassSelection -
DragonBlaster50 - 14.09.2010
Hey guys, I know I've probably asked this before or it has been asked a Lot but i need to know it, How can i Make a textDraw Show up Above In the screen when I select a Skin??
I got this code so far but it does not work:
Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,-50.0444,1183.8376,24.0842);
SetPlayerCameraPos(playerid,-53.1994,1184.1168,24.0842);
SetPlayerCameraLookAt(playerid,-50.0444,1183.8376,24.0842);
SetPlayerFacingAngle(playerid,90);
SetPlayerTeamFromClass(playerid, classid);
if (classid == 0) if(classid == 1) if(classid == 2)
{
TextDrawShowForPlayer(playerid, ArmyTextDraw1);
ArmyTextDraw1 = TextDrawCreate(297.000000, 30.000000, "US ARMY");
TextDrawAlignment(ArmyTextDraw1, 2);
TextDrawBackgroundColor(ArmyTextDraw1, 65535);
TextDrawFont(ArmyTextDraw1, 1);
TextDrawLetterSize(ArmyTextDraw1, 1.159999, 4.400000);
TextDrawColor(ArmyTextDraw1, 16711935);
TextDrawSetOutline(ArmyTextDraw1, 0);
TextDrawSetProportional(ArmyTextDraw1, 0);
TextDrawSetShadow(ArmyTextDraw1, 3);
}
else
{
TextDrawShowForPlayer(playerid, TerroristsTextDraw1);
TerroristsTextDraw1 = TextDrawCreate(280.000000, 36.000000, "Al Qaida Terrorists");
TextDrawAlignment(TerroristsTextDraw1, 2);
TextDrawBackgroundColor(TerroristsTextDraw1, 65535);
TextDrawFont(TerroristsTextDraw1, 1);
TextDrawLetterSize(TerroristsTextDraw1, 0.700000, 3.000000);
TextDrawColor(TerroristsTextDraw1, -16776961);
TextDrawSetOutline(TerroristsTextDraw1, 0);
TextDrawSetProportional(TerroristsTextDraw1, 1);
TextDrawSetShadow(TerroristsTextDraw1, 3);
}
return 1;
}
Thanks for the Help
Re: textdraw Above the head On ClassSelection -
Nero_3D - 14.09.2010
You try to show something which is created afterwards... :S
Solution
pawn Код:
TextDrawShowForPlayer(playerid, ArmyTextDraw1);
//Just move that
ArmyTextDraw1 = TextDrawCreate(297.000000, 30.000000, "US ARMY");
TextDrawAlignment(ArmyTextDraw1, 2);
TextDrawBackgroundColor(ArmyTextDraw1, 65535);
TextDrawFont(ArmyTextDraw1, 1);
TextDrawLetterSize(ArmyTextDraw1, 1.159999, 4.400000);
TextDrawColor(ArmyTextDraw1, 16711935);
TextDrawSetOutline(ArmyTextDraw1, 0);
TextDrawSetProportional(ArmyTextDraw1, 0);
TextDrawSetShadow(ArmyTextDraw1, 3);
//all under OnGameModeInit
Same with the other textdraw