samp-textdraw-streamer icon indicating copy to clipboard operation
samp-textdraw-streamer copied to clipboard

[textdraw.streamer] DestroyDynamicPlayerTextDraw: No such id was found. (playerid: 0, textId: 0) (server-package\ui-fivem.pwn:177)

Open MasRay29301 opened this issue 1 year ago • 7 comments

MasRay29301 avatar May 02 '24 10:05 MasRay29301

How To Fix Sir ?

MasRay29301 avatar May 02 '24 10:05 MasRay29301

Use:

if(IsValidDynamicPlayerTextDraw(playerid, PlayerText:textid))
{
    DestroyDynamicPlayerTextDraw(playerid, textid);
}

nexquery avatar May 02 '24 11:05 nexquery

Use:

if(IsValidDynamicPlayerTextDraw(playerid, PlayerText:textid))
{
    DestroyDynamicPlayerTextDraw(playerid, textid);
}

I used that code but it doesn't work for the script sir

MasRay29301 avatar May 02 '24 14:05 MasRay29301

The textdraw doesn't even disappear

MasRay29301 avatar May 02 '24 14:05 MasRay29301

Show your codes.

nexquery avatar May 02 '24 20:05 nexquery

I have this problem too

MatheusAgL avatar May 28 '24 13:05 MatheusAgL

This problem is caused by you or the person who made the script you are using. When you delete a textdraw, the plugin completely deletes the ID in the repository. When you try to delete it again, you get this error. Actually, the problem stems from the fact that you don't give -1 value to the textdraw variable after deleting the textdraw.

Incorrect Use:

Test_Textdraw[playerid] = CreatePlayerTextDraw(playerid, 0.0, 0.0, "Test");

PlayerTextDrawDestroy(playerid, Test_Textdraw[playerid]); // OK
PlayerTextDrawDestroy(playerid, Test_Textdraw[playerid]); // Error

// Or
for(new i = 0; i < 2; i++)
{
	// i == 0  :: OK
	// i == 1  :: Error
	PlayerTextDrawDestroy(playerid, Test_Textdraw[playerid]);
}

Correct Usage:

new PlayerText:Test_Textdraw[MAX_PLAYERS];

Test_Textdraw[playerid] = CreatePlayerTextDraw(playerid, 0.0, 0.0, "Test");

if(Test_Textdraw[playerid] != PlayerText:-1)
{
	PlayerTextDrawDestroy(playerid, Test_Textdraw[playerid]);
	Test_Textdraw[playerid] = PlayerText:-1;
}

// Or
for(new i = 0; i < 2; i++)
{
	if(Test_Textdraw[playerid] != PlayerText:-1)
	{
		PlayerTextDrawDestroy(playerid, Test_Textdraw[playerid]);
		Test_Textdraw[playerid] = PlayerText:-1;
	}
}

// Or
if(IsValidDynamicPlayerTextDraw(playerid, Test_Textdraw[playerid]))
{
    PlayerTextDrawDestroy(playerid, Test_Textdraw[playerid]);
}

nexquery avatar May 28 '24 21:05 nexquery