SA-MP Forums Archive
Textdraw hide - 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 hide (/showthread.php?tid=615282)



Textdraw hide - Hunud - 20.08.2016

I have problem when somebody made kill spree it show textdraw but after some seconds this textdraw wont hide!

Код:
format(string, sizeof(string), "~r~%s is on killing spree 3", pname);
        TextDrawHideForPlayer(playerid,Spree);
        TextDrawSetString(Spree, string);
        TextDrawShowForAll(Spree); 
        SetTimer("RemoveTextDraw", 3000, 0);
Код:
forward RemoveTextDraw(playerid);
public RemoveTextDraw(playerid)
{
   TextDrawHideForPlayer(playerid, Spree);
   return 1;
}



Re: Textdraw hide - ThatFag - 20.08.2016

Код:
forward RemoveTextDraw(playerid);
public RemoveTextDraw(playerid)
{
for(new t=0; t<=MAX_PLAYERS; t++)
	{
   TextDrawHideForPlayer(t, Spree);
   return 1;
        }
}
test this


Re: Textdraw hide - SyS - 20.08.2016

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
Код:
forward RemoveTextDraw(playerid);
public RemoveTextDraw(playerid)
{
for(new t=0; t<=MAX_PLAYERS; t++)
	{
   TextDrawHideForPlayer(t, Spree);
   return 1;
        }
}
test this
dont return inside the loop it will break the loop there will be no sense in doing a loop and use foreach and there is not point in passing playerid and no arguements can be passed in settimer.


Re: Textdraw hide - jlalt - 20.08.2016

try this sir
PHP код:
forward RemoveTextDraw();
public 
RemoveTextDraw()
{
   
TextDrawHideForAll(Spree);
   return 
1;

You can't use a public function with playerid or an value and call it by settimer you have to call it by settimerex also this function don't need the "playerid" you just have to hide the textdraw for all as long as you were showing it for all.


Re: Textdraw hide - Hunud - 20.08.2016

Quote:
Originally Posted by jlalt
Посмотреть сообщение
try this sir
PHP код:
forward RemoveTextDraw();
public 
RemoveTextDraw()
{
   
TextDrawHideForAll(Spree);
   return 
1;

You can't use a public function with playerid or an value and call it by settimer you have to call it by settimerex also this function don't need the "playerid" you just have to hide the textdraw for all as long as you were showing it for all.
Thanks man!