Textdraws not appearing
#1

Hey guys.

I was trying to make some textdraws today, but they aren't appearing. I was using an in-game maker, so it should be right. My code:

Код:
new PlayerText:Textdraw0;

public OnPlayerConnect(playerid)
{


   	//Text Draws
	Textdraw0 = CreatePlayerTextDraw(playerid, 502.000000, 104.000000, "Ghost Riders");
	PlayerTextDrawBackgroundColor(playerid, Textdraw0, 255);
	PlayerTextDrawFont(playerid, Textdraw0, 1);
	PlayerTextDrawLetterSize(playerid, Textdraw0, 0.500000, 1.000000);
	PlayerTextDrawColor(playerid, Textdraw0, -16776961);
	PlayerTextDrawSetOutline(playerid, Textdraw0, 0);
	PlayerTextDrawSetProportional(playerid, Textdraw0, 1);
	PlayerTextDrawSetShadow(playerid, Textdraw0, 1);
	PlayerTextDrawUseBox(playerid, Textdraw0, 1);
	PlayerTextDrawBoxColor(playerid, Textdraw0, 255);
	PlayerTextDrawTextSize(playerid, Textdraw0, 610.000000, 0.000000);
	PlayerTextDrawSetSelectable(playerid, Textdraw0, 0);
No errors show up in the compiler..
Reply
#2

This line:
Код:
new PlayerText:Textdraw0;
What type is this? I think it's wrong...

Try change this line to:
Код:
new Text:Textdraw0;
Reply
#3

Quote:
Originally Posted by JoaoPedro
Посмотреть сообщение
This line:
Код:
new PlayerText:Textdraw0;
What type is this? I think it's wrong...

Try change this line to:
Код:
new Text:Textdraw0;
It's fine, PlayerText: is a new type of textdraw.
These are per-player textdraws, not global ones and were added in samp 0.3e.

After creating textdraws, you still need to show them using PlayerTextDrawShow, as CreatePlayerTextDraw only creates them, they're not automatically shown.

https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
https://sampwiki.blast.hk/wiki/PlayerTextDrawShow

Код:
new PlayerText:Textdraw0;

public OnPlayerConnect(playerid)
{


   	//Text Draws
	Textdraw0 = CreatePlayerTextDraw(playerid, 502.000000, 104.000000, "Ghost Riders");
	PlayerTextDrawBackgroundColor(playerid, Textdraw0, 255);
	PlayerTextDrawFont(playerid, Textdraw0, 1);
	PlayerTextDrawLetterSize(playerid, Textdraw0, 0.500000, 1.000000);
	PlayerTextDrawColor(playerid, Textdraw0, -16776961);
	PlayerTextDrawSetOutline(playerid, Textdraw0, 0);
	PlayerTextDrawSetProportional(playerid, Textdraw0, 1);
	PlayerTextDrawSetShadow(playerid, Textdraw0, 1);
	PlayerTextDrawUseBox(playerid, Textdraw0, 1);
	PlayerTextDrawBoxColor(playerid, Textdraw0, 255);
	PlayerTextDrawTextSize(playerid, Textdraw0, 610.000000, 0.000000);
	PlayerTextDrawSetSelectable(playerid, Textdraw0, 0);
        PlayerTextDrawShow(playerid, TextDraw0);
Reply
#4

Hmm, thank you for the replies, but:

Код:
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(114) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(115) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(116) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(117) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(118) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(119) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(120) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(121) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(122) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(123) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(124) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(125) : warning 213: tag mismatch
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(126) : error 017: undefined symbol "TextDraw0"
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(495) : warning 203: symbol is never used: "skins"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

The PlayerText: tag was actually correct.
Reply
#6

Yeah. Can anyone show me an example of each callback?
Sorry, this is my first time with textdraws..

Thanks.
Reply
#7

Your syntax was wrong,

use this one

pawn Код:
new PlayerText:Textdraw0[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{


    //Text Draws
    Textdraw0[playerid] = CreatePlayerTextDraw(502.000000, 104.000000, "Ghost Riders");
    PlayerTextDrawBackgroundColor(Textdraw0[playerid], 255);
    PlayerTextDrawFont(Textdraw0[playerid], 1);
    PlayerTextDrawLetterSize(Textdraw0[playerid], 0.500000, 1.000000);
    PlayerTextDrawColor(Textdraw0[playerid], -16776961);
    PlayerTextDrawSetOutline(Textdraw0[playerid], 0);
    PlayerTextDrawSetProportional(Textdraw0[playerid], 1);
    PlayerTextDrawSetShadow(Textdraw0[playerid], 1);
    PlayerTextDrawUseBox(Textdraw0[playerid], 1);
    PlayerTextDrawBoxColor(Textdraw0[playerid], 255);
    PlayerTextDrawTextSize(Textdraw0[playerid], 610.000000, 0.000000);
    PlayerTextDrawSetSelectable(Textdraw0[playerid], 0);
    return 1;
}
Reply
#8

Thanks for the reply but still..

Код:
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(113) : error 028: invalid subscript (not an array or too many subscripts): "Textdraw0"
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(113) : warning 215: expression has no effect
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(113) : error 001: expected token: ";", but found "]"
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(113) : error 029: invalid expression, assumed zero
C:\Users\WickeD\Desktop\Alpine Trucking\gamemodes\stunt.pwn(113) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Sorry for being a retard.
Reply
#9

Sorry i had something wrong on the code that i provided above,

pawn Код:
#include <a_samp>

new PlayerText:Textdraw0[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{


    //Text Draws
    Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 502.000000, 104.000000, "Ghost Riders");
    PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 255);
    PlayerTextDrawFont(playerid, Textdraw0[playerid], 1);
    PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.500000, 1.000000);
    PlayerTextDrawColor(playerid, Textdraw0[playerid], -16776961);
    PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
    PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
    PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 1);
    PlayerTextDrawUseBox(playerid, Textdraw0[playerid], 1);
    PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], 255);
    PlayerTextDrawTextSize(playerid, Textdraw0[playerid], 610.000000, 0.000000);
    PlayerTextDrawSetSelectable(playerid, Textdraw0[playerid], 0);
    return 1;
}
I tested it and has no errors
Reply
#10

Show us line 113.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)