Textdraw not showing
#1

Код:
Resolved
Reply
#2

You need to use TextDrawShowForPlayer in OnPlayerConnect
Reply
#3

Why are you creating player textdraws under a callback that doesn't involve players at all?

https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
https://sampwiki.blast.hk/wiki/PlayerTextDrawDestroy
https://sampwiki.blast.hk/wiki/PlayerTextDrawColor
https://sampwiki.blast.hk/wiki/PlayerTextDrawBoxColor
https://sampwiki.blast.hk/wiki/PlayerTex...ackgroundColor
https://sampwiki.blast.hk/wiki/PlayerTextDrawAlignment
https://sampwiki.blast.hk/wiki/PlayerTextDrawFont
https://sampwiki.blast.hk/wiki/PlayerTextDrawLetterSize
https://sampwiki.blast.hk/wiki/PlayerTextDrawTextSize
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetOutline
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetShadow
https://sampwiki.blast.hk/wiki/PlayerTex...etProportional
https://sampwiki.blast.hk/wiki/PlayerTextDrawUseBox
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetString
https://sampwiki.blast.hk/wiki/PlayerTextDrawShow
https://sampwiki.blast.hk/wiki/PlayerTextDrawHide

EDIT: Decided to paste the links here myself.
Reply
#4

Use wikipidea & you will get many easy tuts there...
Reply
#5

Add this:
PHP код:
for(new playerid=0playerid<MAX_PLAYERS;playerid++)
{
    
//Your code

Reply
#6

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Add this:
PHP код:
for(new playerid=0playerid<MAX_PLAYERS;playerid++)
{
    
//Your code

Why create an unnecessary and inefficient loop while all he has to do is place his code under OnPlayerConnect.
Quote: my previous post.
Reply
#7

Quote:
Originally Posted by Bible
Посмотреть сообщение
Why create an unnecessary and inefficient loop while all he has to do is place his code under OnPlayerConnect.
Quote: my previous post.
But according to what he has posted, he can use this too.
Reply
#8

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
But according to what he has posted, he can use this too.
You are missing the point of PlayerTextDraws. OnGameModeInit has no single involvement of a player whatsoever.
Reply
#9

pawn Код:
public OnPlayerConnect(playerid)
{
        new playerid;
        Simple4[playerid] = CreatePlayerTextDraw(playerid, 480.500000, 369.687500, "New Textdraw");
        PlayerTextDrawLetterSize(playerid, Simple4[playerid], 0.449999, 1.600000);
        PlayerTextDrawTextSize(playerid, Simple4[playerid], 127.000000, 126.875000);
        PlayerTextDrawAlignment(playerid, Simple4[playerid], 1);
        PlayerTextDrawColor(playerid, Simple4[playerid], -1);
        PlayerTextDrawBoxColor(playerid, Simple4[playerid], -1);
        PlayerTextDrawSetShadow(playerid, Simple4[playerid], 0);
        PlayerTextDrawSetOutline(playerid, Simple4[playerid], 1);
        PlayerTextDrawFont(playerid, Simple4[playerid], 5);
        PlayerTextDrawBackgroundColor(playerid, Simple4[playerid], 0x00000000);
        PlayerTextDrawSetPreviewModel(playerid, Simple4[playerid], GetPlayerSkin(playerid));
        PlayerTextDrawSetPreviewRot(playerid, Simple4[playerid], 0.000000, 0.000000, 0.000000, 1.000000);
        PlayerTextDrawShow(playerid, Simple4[playerid]);
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    PlayerTextDrawShow(playerid, Simple4[playerid]);
    return 1;
}
Reply
#10

Quote:
Originally Posted by HY
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
        new playerid;
        Simple4[playerid] = CreatePlayerTextDraw(playerid, 480.500000, 369.687500, "New Textdraw");
        PlayerTextDrawLetterSize(playerid, Simple4[playerid], 0.449999, 1.600000);
        PlayerTextDrawTextSize(playerid, Simple4[playerid], 127.000000, 126.875000);
        PlayerTextDrawAlignment(playerid, Simple4[playerid], 1);
        PlayerTextDrawColor(playerid, Simple4[playerid], -1);
        PlayerTextDrawBoxColor(playerid, Simple4[playerid], -1);
        PlayerTextDrawSetShadow(playerid, Simple4[playerid], 0);
        PlayerTextDrawSetOutline(playerid, Simple4[playerid], 1);
        PlayerTextDrawFont(playerid, Simple4[playerid], 5);
        PlayerTextDrawBackgroundColor(playerid, Simple4[playerid], 0x00000000);
        PlayerTextDrawSetPreviewModel(playerid, Simple4[playerid], GetPlayerSkin(playerid));
        PlayerTextDrawSetPreviewRot(playerid, Simple4[playerid], 0.000000, 0.000000, 0.000000, 1.000000);
        PlayerTextDrawShow(playerid, Simple4[playerid]);
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    PlayerTextDrawShow(playerid, Simple4[playerid]);
    return 1;
}
That will give you warning 219.
Код:
warning 219: local variable "playerid" shadows a variable at a preceding level
You are redefining playerid.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)