What is this warning? it wont go away please help me
#1

Hey,

I am trying to kill my text draw, im trying to make the textdraw that appears on connect dissapear on spawn put it keeps giving a warning. This is my code.

Код:
    Command_Spam = TextDrawCreate(251, 152, "Do not spam");
		TextDrawAlignment(Command_Spam, 1);
		TextDrawFont(Command_Spam, 1);
		TextDrawLetterSize(Command_Spam, 1.0, 3.0);
		TextDrawColor(Command_Spam, 0xFF0000FF);
		TextDrawShowForPlayer(playerid,Command_Spam);
OnPlayerSpawn:

Код:
SetTimer("TextDrawKill",10000,0);
At the bottom of my script:

Код:
forward TextDrawKill( );
TextDrawKill( )
{
	TextDrawDestroy(Command_Spam);
}
Warning:

Код:
warning 203: symbol is never used: "TextDrawKill"
Please help me

Thank You
Reply
#2

replace

Код:
forward TextDrawKill( );
TextDrawKill( )
{
	TextDrawDestroy(Command_Spam);
}
with this

pawn Код:
forward TextDrawKill( );
public TextDrawKill( )
{
    TextDrawDestroy(Command_Spam);
}
Reply
#3

thank you very much but it doesnt destroy the text draw it just stays
Reply
#4

forward TextDrawKill( );
public TextDrawKill( )
{
TextDrawHideForPlayer(playerid,Command_Spam);
return 1;
}

OnPlayerConnect(playerid);
{
TextDrawShowForPlayer(playerid,Command_Spam);
return 1;
}
Reply
#5

pawn Код:
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Command_Spam);
    SetTimerEx("TextDrawKill", 10000, 0, "i", playerid);
    return 1;
}

forward TextDrawKill(playerid);
public TextDrawKill(playerid)
{
    TextDrawHideForPlayer(playerid, Command_Spam);
    return 1;
}
Reply
#6

Quote:
Originally Posted by bogeyman_EST
pawn Код:
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Command_Spam);
    SetTimerEx("TextDrawKill", 10000, 0, "i", playerid);
    return 1;
}

forward TextDrawKill(playerid);
public TextDrawKill(playerid)
{
    TextDrawHideForPlayer(playerid, Command_Spam);
    return 1;
}
Thanks for posting exactly what I already did.
Reply
#7

It's not exactly what you did, your code will give errors:
pawn Код:
forward TextDrawKill( );
public TextDrawKill( )
{
  TextDrawHideForPlayer(playerid,Command_Spam);//Where is playerid coming from?
    return 1;
}
and you also don't set a timer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)