Okay, so after messing with some client features I found a neat and simple way to create 3D Text Labels. For those who don't know, this is a feature found in SA-MP that allows a server to create a label in the game world (instead of on the screen as HUD or something).
For the following snippet, and as far as LU goes, this is not limited to just labels. You could probably put images, windows of information and other things in the actual game world itself. This could be useful for putting clan logo's on top of player heads (which in my opinion, would make the word awesome an understatement). For now, I will just give you the snippet for labels and you can do the rest if you want.
To use this, just add the following snippet into a client script and use the following command:
/addlabel <text>
Keep in mind that the label disappears after you get too far away (15 units). It will reappear when you are in range.
This is tested as of a moment ago, and works smoothly on my PC.
function onClientCommand( command , params )
{
if( command.tolower( ) == "addlabel" )
{
if( params.len( ) > 0 )
{
local label = GUILabel( VectorScreen( 0 , 0 ) , ScreenSize( params.len( ) * 12 , 0 ) , params );
label.FontName = "Courier New";
label.FontSize = 12;
label.Colour = Colour( 255 , 255 , 255 );
AddGUILayer( label );
if( label )
{
Labels[ label.ID ] <- { };
Labels[ label.ID ].GamePos <- FindLocalPlayer( ).Pos;
Labels[ label.ID ].Label <- label;
Message( "[#00FF00]SUCCESS: [#FFFFFF]Label added!" );
}
else
{
Message( "[#00FF00]ERROR: [#FFFFFF]Could not add the label!" );
}
}
else
{
Message( "[#999999]USAGE: [#FFFFFF]/addlabel <message>" );
}
}
}
function onScriptLoad( )
{
Labels <- { };
}
function onClientRender( )
{
if( Labels.len( ) > 0 )
{
foreach( ii , vv in Labels )
{
if( GetDistance( FindLocalPlayer( ).Pos , vv.GamePos ) < 15 )
{
if( !vv.Label.Visible )
{
vv.Label.Visible = true;
}
vv.Label.Pos = WorldPosToScreen( vv.GamePos );
}
else
{
vv.Label.Visible = false;
}
}
}
}