OnPlayerClickTextDraw - 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: OnPlayerClickTextDraw (
/showthread.php?tid=431734)
OnPlayerClickTextDraw -
TKZ227 - 19.04.2013
I've been messing with this for a while now - can't seem to figure out what's wrong.
Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == Textdraw8[playerid])
{
PlayerTextDrawDestroy(playerid, Textdraw8[playerid]);
}
}
Код:
work.pwn(599) : error 017: undefined symbol "Textdraw8"
work.pwn(599) : warning 215: expression has no effect
work.pwn(599) : error 001: expected token: ";", but found "]"
work.pwn(599) : error 029: invalid expression, assumed zero
work.pwn(599) : fatal error 107: too many error messages on one line
Line 599 is the line:
Код:
if(playertextid == Textdraw8[playerid])
Re: OnPlayerClickTextDraw -
DaRk_RaiN - 19.04.2013
Apart of not returning a value i don't see anything in that code.
pawn Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == Textdraw8[playerid])
{
PlayerTextDrawDestroy(playerid, Textdraw8[playerid]);
}
return 1;//Return 1 here.
}
Post the TextDraw8 info+ definition.
If you don't have the following code add it under the includes.
pawn Код:
new PlayerText:Textdraw8[MAX_PLAYERS];
Re: OnPlayerClickTextDraw -
TKZ227 - 19.04.2013
Код:
new PlayerText:Textdraw8[MAX_PLAYERS];
Textdraw8[playerid] = CreatePlayerTextDraw(playerid, 339.333343, 204.344436, "usebox");
PlayerTextDrawLetterSize(playerid, Textdraw8[playerid], 0.000000, 2.725310);
PlayerTextDrawTextSize(playerid, Textdraw8[playerid], 287.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Textdraw8[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw8[playerid], 255);
PlayerTextDrawUseBox(playerid, Textdraw8[playerid], true);
PlayerTextDrawBoxColor(playerid, Textdraw8[playerid], 255);
PlayerTextDrawSetShadow(playerid, Textdraw8[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw8[playerid], 0);
PlayerTextDrawFont(playerid, Textdraw8[playerid], 0);
PlayerTextDrawSetSelectable(playerid, Textdraw8[playerid], true);
Also, I have the return 1, just didn't copy it when I made the post.
Re: OnPlayerClickTextDraw -
ReVo_ - 19.04.2013
new PlayerText:Textdraw8[MAX_PLAYERS];
is a global variable?
Re: OnPlayerClickTextDraw -
TKZ227 - 19.04.2013
Quote:
Originally Posted by ReVo_
new PlayerText:Textdraw8[MAX_PLAYERS];
is a global variable?
|
Oops - it was not. Silly mistake. Thanks.