Set a player key in 3d text label?
#1

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?
Reply
#2

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

Yeah, it is a way.

With GetPlayerKeys and the %k specifier in format.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)