SA-MP Forums Archive
Set a player key in 3d text label? - 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: Set a player key in 3d text label? (/showthread.php?tid=507610)



Set a player key in 3d text label? - SomebodyAndMe - 18.04.2014

How can I set in a 3d TextLabel:

Press 'SPACE' to refuel your vehicle!

But then where the text 'SPACE' stands, would actually be KEY_SPRINT? Is there a way to create this?


Re: Set a player key in 3d text label? - Conradus - 18.04.2014

I think this is impossible because you can't get the player's keyboard configuration.


Re : Set a player key in 3d text label? - S4t3K - 18.04.2014

Yeah, it is a way.

With GetPlayerKeys and the %k specifier in format.


Re: Set a player key in 3d text label? - Bingo - 18.04.2014

https://sampwiki.blast.hk/wiki/Attach3DTextLabelToVehicle

Example:-

pawn Код:
new Text3D:vehicle3Dtext[MAX_VEHICLES],vehicle_id;
// Creating the TextLabel for later use (On top)
 
public OnGameModeInit ( )
{
    vehicle_id = CreateVehicle( 411, 0.0. 0.0, 15.0, 5, 0, 120 );
    vehicle3Dtext[ vehicle_id ] = Create3DTextLabel( "Press Space to refuel your vehicle!", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
    //Creating the Vehicle
    //Attaching Text Label To Vehicle
    Attach3DTextLabelToVehicle( vehicle3Dtext[ vehicle_id ] , vehicle_id, 0.0, 0.0, 2.0);
}
public OnGameModeExit ( )
{
    Delete3DTextLabel( vehicle3Dtext[ vehicle_id ] );
    return true;
}
Clear example from mr.wiki

And keys list (default) You cant change them. https://sampwiki.blast.hk/wiki/Keys