SA-MP Forums Archive
TextDraw - 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 (/showthread.php?tid=527033)



TextDraw - mrl123 - 20.07.2014

I maked level system with textdraw but textdraw won't showing .. but level system is working ..


Код:
  	exp[playerid] = TextDrawCreate(553.000000, 102.000000, "_");
	TextDrawAlignment(exp[playerid], 2);
	TextDrawBackgroundColor(exp[playerid], 255);
	TextDrawFont(exp[playerid], 1);
	TextDrawLetterSize(exp[playerid], 0.299998, 1.499999);
	TextDrawColor(exp[playerid], -1);
	TextDrawSetOutline(exp[playerid], 1);
	TextDrawSetProportional(exp[playerid], 0);
	TextDrawUseBox(exp[playerid], 1);
	TextDrawBoxColor(exp[playerid], 0xAA3333AA);
	TextDrawTextSize(exp[playerid], 318.000000, 110.000000);



Respuesta: TextDraw - Xabi - 20.07.2014

You need to use the function TextDrawShowForPlayer(playerid, exp[playerid])


Re: Respuesta: TextDraw - mrl123 - 20.07.2014

Quote:
Originally Posted by Xabi
Посмотреть сообщение
You need to use the function TextDrawShowForPlayer(playerid, exp[playerid])
Код:
new string[128];
		new nxtlevel = PlayerInfo[playerid][pLevel]+1;
		new expamount = nxtlevel*levelexp;
		format(string, sizeof(string), "%d / %d",PlayerInfo[playerid][pExp],expamount);
		TextDrawSetString(exp[playerid], string);
		TextDrawShowForPlayer(playerid, exp[playerid]);
i use ..


Re: TextDraw - Metharon - 20.07.2014

pawn Код:
new PlayerText:exp[MAX_PLAYERS];
   
    exp[playerid] = CreatePlayerTextDraw(playerid, 553.000000, 102.000000, "_");
    PlayerTextDrawAlignment(playerid,exp[playerid], 2);
    PlayerTextDrawBackgroundColor(playerid,exp[playerid], 255);
    PlayerTextDrawFont(playerid,exp[playerid], 1);
    PlayerTextDrawLetterSize(playerid,exp[playerid], 0.299998, 1.499999);
    PlayerTextDrawColor(playerid,exp[playerid], -1);
    PlayerTextDrawSetOutline(playerid,exp[playerid], 1);
    PlayerTextDrawSetProportional(playerid,exp[playerid], 0);
    PlayerTextDrawUseBox(playerid,exp[playerid], 1);
    PlayerTextDrawBoxColor(playerid,exp[playerid], 0xAA3333AA);
    PlayerTextDrawTextSize(playerid,exp[playerid], 318.000000, 110.000000);


    To call it :
     - PlayerTextDrawShow(playerid, exp[playerid]);
    To hide it
     - PlayerTextDrawHide(playerid, exp[playerid]);
Allons-y!


Re: TextDraw - mrl123 - 20.07.2014

Quote:
Originally Posted by Metharon
Посмотреть сообщение
pawn Код:
new PlayerText:exp[MAX_PLAYERS];
   
    exp[playerid] = CreatePlayerTextDraw(playerid, 553.000000, 102.000000, "_");
    PlayerTextDrawAlignment(playerid,exp[playerid], 2);
    PlayerTextDrawBackgroundColor(playerid,exp[playerid], 255);
    PlayerTextDrawFont(playerid,exp[playerid], 1);
    PlayerTextDrawLetterSize(playerid,exp[playerid], 0.299998, 1.499999);
    PlayerTextDrawColor(playerid,exp[playerid], -1);
    PlayerTextDrawSetOutline(playerid,exp[playerid], 1);
    PlayerTextDrawSetProportional(playerid,exp[playerid], 0);
    PlayerTextDrawUseBox(playerid,exp[playerid], 1);
    PlayerTextDrawBoxColor(playerid,exp[playerid], 0xAA3333AA);
    PlayerTextDrawTextSize(playerid,exp[playerid], 318.000000, 110.000000);


    To call it :
     - PlayerTextDrawShow(playerid, exp[playerid]);
    To hide it
     - PlayerTextDrawHide(playerid, exp[playerid]);
Allons-y!
where to put this

Код:
 To call it :
     - PlayerTextDrawShow(playerid, exp[playerid]); 
    To hide it
     - PlayerTextDrawHide(playerid, exp[playerid]);



Re: TextDraw - Metharon - 20.07.2014

well , if you want to SHOW to the player at a certain moment use that function
pawn Код:
PlayerTextDrawShow(playerid, exp[playerid]);
For example , if you want to show the textdraw to the player when it's spawned

pawn Код:
public OnPlayerSpawn(playerid)
{
// string thing blabla
new string[256];
format(string, sizeof(string), "blabla");
PlayerTextDrawSetString(playerid,exp[playerid], string);       
PlayerTextDrawShow(playerid, exp[playerid]);
return 1;
}



Re: TextDraw - mrl123 - 20.07.2014

Quote:
Originally Posted by Metharon
Посмотреть сообщение
well , if you want to SHOW to the player at a certain moment use that function
pawn Код:
PlayerTextDrawShow(playerid, exp[playerid]);
For example , if you want to show the textdraw to the player when it's spawned

pawn Код:
public OnPlayerSpawn(playerid)
{
// string thing blabla
new string[256];
format(string, sizeof(string), "blabla");
PlayerTextDrawSetString(playerid,exp[playerid], string);       
PlayerTextDrawShow(playerid, exp[playerid]);
return 1;
}
Код:
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(5087) : warning 217: loose indentation
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(17815) : warning 204: symbol is assigned a value that is never used: "maxspeed"
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(19301) : warning 213: tag mismatch
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(19302) : warning 213: tag mismatch
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(19313) : warning 219: local variable "exp" shadows a variable at a preceding level
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(19638) : warning 235: public function lacks forward declaration (symbol "SaveSecurity")
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(32786) : warning 217: loose indentation
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(33428) : warning 217: loose indentation
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(36725) : warning 202: number of arguments does not match definition
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(36730) : warning 217: loose indentation
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(36739) : warning 217: loose indentation
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(36744) : warning 217: loose indentation
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(83052) : warning 213: tag mismatch
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(83066) : warning 204: symbol is assigned a value that is never used: "infostring"
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(83103) : warning 209: function "ExpTimer" should return a value
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(83104) : error 010: invalid function or declaration
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(20224) : warning 204: symbol is assigned a value that is never used: "exptimer"
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(20225) : warning 204: symbol is assigned a value that is never used: "oneminute"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase



Re: TextDraw - kesarthakur - 20.07.2014

Quote:
Originally Posted by mrl123
Посмотреть сообщение
Код:
 To call it :
     - PlayerTextDrawShow(playerid, exp[playerid]); 
    To hide it
     - PlayerTextDrawHide(playerid, exp[playerid]);
to say its not that ^^

To Call it:

ShowTexDrawForPlayer(playerid, exp[playerid]);

To Hide it:

HideTextDrawForPlayer(playerid, exp[playerid]);


Re: TextDraw - mrl123 - 20.07.2014

Код:
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(6352) : error 017: undefined symbol "HideTextDrawForPlayer"
C:\Documents and Settings\GORAN\Desktop\Raven's Roleplay 0.3x\gamemodes\larp.pwn(8395) : error 017: undefined symbol "ShowTexDrawForPlayer"



Re: TextDraw - IceBilizard - 20.07.2014

its

pawn Код:
TextDrawHideForPlayer


and

TextDrawShowForPlayer