SA-MP Forums Archive
A bug... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A bug... (/showthread.php?tid=153166)



A bug... - matthewdriftking - 07.06.2010

if(IsPlayerAdmin(playerid))
{
SetPlayerColor(playerid, 0x9900FFAA);
new Text3D:admin;
admin = Create3DTextLabel("Tha Boss- Server Owner",0x33AA33AA,0.0,0.0,2.0,160.0,0,0);//You Need To Login On RCON
Attach3DTextLabelToPlayer(admin,playerid,0.0,0.0,0 .5);



Why this is so buggy? Sometimes it works on players that are not logged in as RCON!


Re: A bug... - ~Ricky~ - 07.06.2010

Where do you placed the code?
I need more infos...
Then I can help you, I think that I now the bug.


Re: A bug... - Joe_ - 07.06.2010

Do you destroy the 3D text under OnPlayerDisconnect? (and GameModeExit if neccessary)

And do you ONLY show it when the player is RCON admin?

you could be checking once, creating it and attaching it, then the RCON admin disconnects, but the 3D text is still there, and when another player connects with the same ID as the RCON Admin, they get the tag. (It has happened, with other stuff, like textdraws)


Re: A bug... - matthewdriftking - 07.06.2010

Quote:
Originally Posted by Joe_
Do you destroy the 3D text under OnPlayerDisconnect? (and GameModeExit if neccessary)

And do you ONLY show it when the player is RCON admin?

you could be checking once, creating it and attaching it, then the RCON admin disconnects, but the 3D text is still there, and when another player connects with the same ID as the RCON Admin, they get the tag. (It has happened, with other stuff, like textdraws)
No I dont make it there..


Re: A bug... - matthewdriftking - 07.06.2010

Quote:
Originally Posted by ~Ricky~
Where do you placed the code?
I need more infos...
Then I can help you, I think that I now the bug.
Under OnPlayerSpawn


Re: A bug... - Joe_ - 07.06.2010

pawn Код:
//Top of script

new Text3D:admin[MAX_PLAYERS];

//OnPlayerConnect

if(IsPlayerAdmin(playerid))
{
SetPlayerColor(playerid, 0x9900FFAA);
admin[playerid] = Create3DTextLabel("Tha Boss- Server Owner",0x33AA33AA,0.0,0.0,2.0,160.0,0,0);
}

//OnPlayerSpawn

if(IsPlayerAdmin(playerid))
{
Attach3DTextLabelToPlayer(admin[playerid],playerid,0.0,0.0,0.5);
}

//OnPlayerDisconnect

Delete3DTextLabel(admin[playerid]);

//OnGameModeExit

for(new a, b = GetMaxPlayers(); a <b; a++)
{
Delete3DTextLabel(admin[a]);
}