Textdraw not showing - 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 not showing (
/showthread.php?tid=564606)
Textdraw not showing -
bigboy81 - 22.02.2015
Re: Textdraw not showing -
ATGOggy - 22.02.2015
You need to use TextDrawShowForPlayer in OnPlayerConnect
Re: Textdraw not showing -
AndySedeyn - 22.02.2015
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.
Re: Textdraw not showing -
muzammilfreeman - 22.02.2015
Use wikipidea & you will get many easy tuts there...
Re: Textdraw not showing -
ATGOggy - 22.02.2015
Add this:
PHP код:
for(new playerid=0; playerid<MAX_PLAYERS;playerid++)
{
//Your code
}
Re: Textdraw not showing -
AndySedeyn - 22.02.2015
Quote:
Originally Posted by ATGOggy
Add this:
PHP код:
for(new playerid=0; playerid<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.
Re: Textdraw not showing -
ATGOggy - 22.02.2015
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.
Re: Textdraw not showing -
AndySedeyn - 22.02.2015
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.
Re: Textdraw not showing -
HY - 22.02.2015
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;
}
Re: Textdraw not showing -
AndySedeyn - 22.02.2015
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.