Problem DeletePlayer3DTextLabel
#1

hello users of the forum samp. I need your help.
I'm creating a function where the player suspected should have a TextDraw attached you and visible only to players of the police class. but I'm having problems when I try to delete the TextDraw.

2 ways I tried to develop scripts:

Код:
// This timer is created every time a player changes his class to police
public Police_CheckWantedPlayers(playerid)
{
	
	// Scan through all players
	for (new PlayerToCheck; PlayerToCheck < MAX_PLAYERS; PlayerToCheck++)
	{
	
		// check if this player is connected
		if (IsPlayerConnected(PlayerToCheck))
		{
		    if(GetPlayerWantedLevel(PlayerToCheck) > 0)
			{
		    	          APlayerData[PlayerToCheck][Suspect] = CreatePlayer3DTextLabel(playerid, "SUSPECT", 0x0000FFFF, 0.0, 0.0, 0.5, 100.0, PlayerToCheck, GetPlayerVehicleID(playerid), 0);

			}
			else
			{       
      		                DeletePlayer3DTextLabel(PlayerToCheck, PlayerText3D:APlayerData[PlayerToCheck][Suspect]);
                        }
                 }
          }
}
And

Код:
public OnPlayerUpdate(playerid)
{
if(GetPlayerWantedLevel(playerid) > 0)
	{
	    for(new i = 0; i< MAX_PLAYERS; i++)
	    	if(APlayerData[i][PlayerClass] == ClassPolice)
	    		APlayerData[playerid][Suspect] = CreatePlayer3DTextLabel(i, "Suspect", 0x0000FFFF, 0.0, 0.0, 0.5, 100.0, playerid, 0);
	 }
	 else
	 	for(new i = 0; i< MAX_PLAYERS; i++)
	 	    if(APlayerData[i][PlayerClass] == ClassPolice)
	    		DeletePlayer3DTextLabel(i, PlayerText3D:APlayerData[playerid][Suspect]);
    
    return 1;
}
none of the scripts delete TextDraw when the player is no longer a suspect.
Reply
#2

Use this:
pawn Код:
DeletePlayer3DTextLabel(PlayerToCheck, APlayerData[PlayerToCheck][Suspect]);
Reply
#3

the problem remains
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)