Jump to content

How I can do something like GameTextForPlayer on SA:MP in M?


CTCCoco

Recommended Posts

There are two main methods for creating text. You can either hook the client-side event onClientRender and draw text in the handler with dxDrawText, or you can use server-side "Text functions". More info on both are on the wiki.

Edit: dammit, I can't believe I forgot GUI... *facepalm*

Edited by Guest
Link to comment
you can also
guiCreateLabel(name,x,y,sizex,sizey,text,relative)

for textdraws like in samp with shadows best use

onClientRender together with 2 dxDrawText, 1for shadow, then for text

In SA:MP you see a text for " x " milliseconds and the text dissapear. There are many types of text in SA:MP. But I don't means a static text ( with shadow,etc ) only a little text for show something. Example: This car is for sale. Price: 3000$ when a player its near

http://wiki.sa-mp.com/wiki/GameTextForPlayer

and

http://wiki.sa-mp.com/wiki/GameTextStyle

Thanks for all :D

Link to comment
you can also
guiCreateLabel(name,x,y,sizex,sizey,text,relative)

for textdraws like in samp with shadows best use

onClientRender together with 2 dxDrawText, 1for shadow, then for text

In SA:MP you see a text for " x " milliseconds and the text dissapear. There are many types of text in SA:MP. But I don't means a static text ( with shadow,etc ) only a little text for show something. Example: This car is for sale. Price: 3000$ when a player its near

http://wiki.sa-mp.com/wiki/GameTextForPlayer

and

http://wiki.sa-mp.com/wiki/GameTextStyle

Thanks for all :D

That's exactly what you need. dxDrawText. There was a text library which should simplify it for you. Search the forum for "text lib" or "textlib".

Link to comment

ill show u example how to make white-black textdraw on center of screen

--clientside!
screenx,screeny = guiGetScreenSize()
 
function maketextdraw()
dxDrawText("this is ur textdraw",screenx/2-250,screeny/2-150,screenx/2+250,screeny/2+150,tocolor(0,0,0),1.05,"default-bold","center","center",false,true,false) -- make shadow
dxDrawText("this is ur textdraw",screenx/2-248,screeny/2-148,screenx/2+248,screeny/2+148,tocolor(255,255,255),1,"default-bold","center","center",false,true,false) -- make text
end
addEventHandler("onClientRender",getRootElement(),maketextdraw)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...