Log in to reply
 

[C++] Why this code is not working?



  • Here is my code:

    void func_15(char * iParam0) {
    UI::BEGIN_TEXT_COMMAND_PRINT("STRING");
    UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(iParam0);
    UI::END_TEXT_COMMAND_PRINT(5000,1);
    }
    It is not working. But the notification above the radar is working. But this subtitle NOT.
    Why?
    My script is almost done, but i need this function.


  • Banned

    malembedwe ndi yolakwika



  • Syntax is wrong? But where? Witch line? Please tell me! :)



  • Try changing
    UI::BEGIN_TEXT_COMMAND_PRINT("STRING");
    to
    UI::_SET_NOTIFICATION_TEXT_ENTRY("STRING");



  • @aimless said in [C++] Why this code is not working?:

    UI::_SET_NOTIFICATION_TEXT_ENTRY("STRING");

    it's not working



  • But i dont know why...



  • @Tarack I think the natives have bean renamed.



  • @Tarack try this
    void func_15(char * iParam0) {
    UI::_SET_TEXT_ENTRY_2("CELL_EMAIL_BCON");
    UI::_ADD_TEXT_COMPONENT_STRING3(iParam0);
    UI::_DRAW_SUBTITLE_TIMED(5000,1);
    }



  • @Tarack I see you you already had a thread on this very subject. Next time just make one. So not to wast peoples time suggesting the same stuff again.



  • @aimless Natives have changed. Alot. _SET_TEXT_ENTRY_2 is now BEGIN_TEXT_COMMAND_PRINT and _DRAW_SUBTITLE_TIMED is now END_TEXT_COMMAND_PRINT.



  • @Tarack instead of that code, try this:

    void func_15(char * iParam0) 
    {
    	UI::BEGIN_TEXT_COMMAND_PRINT("CELL_EMAIL_BCON");
    	UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(iParam0);
    	UI::END_TEXT_COMMAND_PRINT(5000, 1);
    }
    


  • @Tarack I have this code, works 100% fine:

    void update()
    {
    	if (GetAsyncKeyState(0x54))
    	{
    		show_subtitle("You pressed the ~r~T~w~ key!");
    	}
    }
    
    void show_subtitle(char* message) {
    	UI::BEGIN_TEXT_COMMAND_PRINT("CELL_EMAIL_BCON");
    	UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(message);
    	UI::END_TEXT_COMMAND_PRINT(5000, 1);
    }
    


  • I try This code thanks i replika if its working



  • @AHK1221 Wow. it's working, but i dont know why. THANK YOU!!



  • @Tarack It's all good :)

    The reason was you used:

    UI::BEGIN_TEXT_COMMAND_PRINT("STRING");
    

    where you should have used this:

    UI::BEGIN_TEXT_COMMAND_PRINT("CELL_EMAIL_BCON");
    


  • I tried cell email bacon and its not working. BUt now it's working! :)



  • Andd how can i destroy the subtitle? example: get in vehicle, and when get it(i know its if invehicle) how can i remove subtitle?



  • @Tarack The number in this line is the length of time the subtitle will display in milliseconds. 1 second = 1000 milliseconds.

    UI::END_TEXT_COMMAND_PRINT(5000, 1);

    So that will display it for 5 seconds. Set that number smaller (like 100) and keep drawing it until you get in the vehicle, then stop drawing it and it will go away quicker.

    You can't turn a subtitle off, you just have to stop drawing it and wait for it to disappear.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.