logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline DemNinjas  
#1 Posted : Saturday, July 2, 2016 8:39:37 PM(UTC)
DemNinjas


Rank: Newbie

Groups: Registered
Joined: 7/2/2016(UTC)
Posts: 2
Man
Belgium
Location: In your computer.

Hello everyone,

In my 'LSPS' plugin for LSPDFR, I use natives to display text on screen, using in-game fonts. You can see the result here.
This is the code I use to draw text on screen :

Quote:
internal static void DrawText(string text, float x, float y, float scale)
{
NativeFunction.Natives.SetTextFont(4);
NativeFunction.Natives.SetTextScale(scale, scale);
NativeFunction.CallByName<uint>("SET_TEXT_COLOUR", new NativeArgument[]
{
(int)Color.White.R, (int)Color.White.G, (int)Color.White.B, 255
});
NativeFunction.Natives.SetTextWrap((float)0.0, (float)1.0);
NativeFunction.Natives.SetTextCentre(false);
NativeFunction.Natives.SetTextDropshadow(2, 2, 0, 0, 0);
NativeFunction.Natives.SetTextEdge(1, 0, 0, 0, 205);
NativeFunction.Natives.SetTextLeading(1);
NativeFunction.CallByName<uint>("_SET_TEXT_ENTRY", "STRING");
NativeFunction.CallByName<uint>("_ADD_TEXT_COMPONENT_STRING", text);
NativeFunction.CallByName<uint>("_DRAW_TEXT", y, x);
}


But now with the latest GTA patch and the latest RageHook, it won't let me add a text component and crashes everytime when executing the "_ADD_TEXT_COMPONENT_STRING" native.

Now this is the crash log I got :



Moreover, the native doesn't show up anymore in the native database now. I'm completely lost, can you help me wonderful people ? ^^
Offline albo1125  
#2 Posted : Monday, August 29, 2016 1:58:39 PM(UTC)
albo1125


Rank: Member

Groups: Registered
Joined: 7/28/2015(UTC)
Posts: 73

Was thanked: 1 time(s) in 1 post(s)
You may want to try this native? Its name may have changed.
_ADD_TEXT_COMPONENT_ITEM_STRING

I also recommend trying to call it by hash if calling by name doesn't work.
Offline DemNinjas  
#3 Posted : Monday, August 29, 2016 2:02:48 PM(UTC)
DemNinjas


Rank: Newbie

Groups: Registered
Joined: 7/2/2016(UTC)
Posts: 2
Man
Belgium
Location: In your computer.

Already tried "_ADD_TEXT_COMPONENT_ITEM_STRING", doesn't work.
I'll try to call it by its hash and see if it works.

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.