Problem DeletePlayer3DTextLabel - 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: Problem DeletePlayer3DTextLabel (
/showthread.php?tid=433834)
Problem DeletePlayer3DTextLabel -
Eudes - 29.04.2013
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.
Re: Problem DeletePlayer3DTextLabel -
zDivine - 29.04.2013
Use this:
pawn Код:
DeletePlayer3DTextLabel(PlayerToCheck, APlayerData[PlayerToCheck][Suspect]);
Re: Problem DeletePlayer3DTextLabel -
Eudes - 01.05.2013
the problem remains