-
Posts
563 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Stanley Sathler
-
Bom pessoal, há alguns dias criei (na verdade tentei) um tema para o MTA. Postei na comunidade inglesa, mas para quem não entende de inglês, há pouquíssimas palavras para ler. Postei também algumas screenshots e o link de download logo abaixo das imagens. Vocês podem ver aqui: viewtopic.php?f=139&t=43394 Estou postando aqui para poder compartilhar um pouco mais com a comunidade portuguesa, visto que ela anda bastante parada nos últimos dias. Espero que gostem. (:
-
Oh, thank you ZverCR. =)
-
Try it. You wrote "guiSetVisble", missing letter "i" GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} getSetVisible(GUIEditor_Window[2], false ) GUIEditor_Window[2] = guiCreateWindow(629,219,481,301,"Police Station",false) guiWindowSetMovable(GUIEditor_Window[2],false) GUIEditor_Label[1] = guiCreateLabel(158,172,166,16,"Move To Police Station ?",false,GUIEditor_Window[2]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[1] = guiCreateButton(18,199,205,93,"Yes",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[1],"clear-normal") GUIEditor_Button[2] = guiCreateButton(297,201,175,91,"Exit",false,GUIEditor_Window[2]) guiSetFont(GUIEditor_Button[2],"clear-normal") GUIEditor_Image[1] = guiCreateStaticImage(69,24,338,136,"images/mtalogo.png",false,GUIEditor_Window[2]) Marker = createMarker(1119,1034,10,"cylinder",2,0,255,0) addEventHandler('onClientMarkerHit', Marker, function (hit) if ( hit == localPlayer ) then getSetVisible(GUIEditor_Window[2], true ) showCursor(true) elseif (hit == GUIEditor_Button[1] ) then toggleAllControls( hit, true ) setElementInterior( hit, 6 ) setElementPosition( hit, 264.74969, 77.49036, 1001.03906 ) elseif(hit == GUIEditor_Button[2]) then getSetVisible(GUIEditor_Window[2], false ) showCursor(false) toggleAllControls( hit, false ) end end)
-
Teteomar, listen to DNL. The better way to work with GUI's is: - First, create all elements that you want (windows, buttons, labels, and more). Create a function to store it. - Set all elements invisible (using guiSetVisible() function) - Attach the function to event "onClientResourceStart". So, when the player start the resource, all GUI elements will be created, but will be invisible. - Second, create another function. In this function, just set all elements visible (using, again, guiSetVisible()). - Attach this function to event "onClientMarkerHit". So, when the player hit a marker, all elements will be visible. If you do this steps, the GUI will be created just one time. And always you need it, the elements will just be visible. If you do like you did in the first code, the elements will be created everytime that player hit a marker.
-
Yes. Try it: function DestroyWindow() destroyElement(GUIEditor_Window[1]) guiSetInputEnabled(false) showCursor(false) end
-
I asked if you wanna close the Window when the player click on Button. I'm right? If yes, you must implement my code in your. I will not do it for you.
-
Attempt to perform arithmetic on a boolean value
Stanley Sathler replied to FSXTim's topic in Scripting
Oh yes, I understood. So I'm sorry, I can't help you. ): Maybe in another time. -
Attempt to perform arithmetic on a boolean value
Stanley Sathler replied to FSXTim's topic in Scripting
I don't know much about "setElementData()" and "getElementData()", but maybe you should use setElementData() to store "1" (or other value), no? Example: setElementData(lp, "Repair", 1) I should be wrong, but I'm trying help. -
Hi guys, I'm trying send a message to a client-side script (using dxDrawText()). But the message is not passed. Server-side: --[...] more code here triggerClientEvent("SendMessageToPlayer", getRootElement(), "Everything here ...") --[...] more code here Client-side: local rootElement = getRootElement() local x,y = guiGetScreenSize() -- Get players resolution. local playerName = getPlayerName ( getLocalPlayer() ) -- Get players name. function CreateMessageRectangle() dxDrawRectangle ( x-x, y-30, x, 30, tocolor ( 0, 0, 0, 200 ) ) -- Create our black transparent MOTD background Rectangle. end function SetMessageOnRectangle(theMessage) if(theMessage == nil) then theMessage = "Visit our forum: #FFFFFFhttp://sa-rc.com/forum/" end dxDrawText ( theMessage, x-x+10, y-20, x-20, y-10, tocolor ( 0, 255, 0, 255 ), 1, "default-bold", "center", "center", false, false, false, true, false) -- Create the text. end addEvent("SendMessageToPlayer", true) addEventHandler("SendMessageToPlayer", getRootElement(), SetMessageOnRectangle) function HandleTheRendering ( ) addEventHandler("onClientRender", getRootElement(), CreateMessageRectangle) -- Keep everything visible with onClientRender. addEventHandler("onClientRender", getRootElement(), SetMessageOnRectangle) end addEventHandler("onClientResourceStart", resourceRoot, HandleTheRendering) The "theMessage" variable (in client-side script) store a nil value everytime. What is wrong? P.S: the event is triggered. If I do a "tostring(theMessage)", so I see the "nil" text on my rectangle. Thanks, Stanley Sathler.
-
removeWorldModel ( 1411, 5, 347.20001220703, 1799.1999511719, 18.799999237061, 0, 0, 215 ) What mean the last three arguments?
-
Attempt to perform arithmetic on a boolean value
Stanley Sathler replied to FSXTim's topic in Scripting
The function "getElementData()" returns false if the requested data doesn't exist. Maybe is it. -
Can I set the font-size of dxDrawText() ?
Stanley Sathler replied to Stanley Sathler's topic in Scripting
I had never pay attention in this argument. My mistake. Thank you again, Solid. <3 -
Are you joking? Have you read the function syntax? You have too many arguments in your example.
-
Hi guys, Can I set the font-size of texts from dxDrawText() function? I wanna use the "bankgothic" font, but I wanna set it font-size (small size). Thanks, Stanley Sathler.
-
No, your code is wrong.
-
Blazy, pay attention to "onClientGUIClick" event. In your example, "uPlayer" stored the button that was clicked. The event there four parameters: string button, string state, int absoluteX, int absoluteY More here: https://wiki.multitheftauto.com/wiki/OnClientGUIClick One love bro.
-
Wait... do you wanna call the destroyElement() (for destroy the window) when the user click on button? If yes: function CreateGUIWindow() GUIEditor_Window[1] = guiCreateWindow(100, 100, 100, "My window title", false) GUIEditor_Button[2] = guiCreateButton(155,251,30,"Exit",false,GUIEditor_Window[1]) -- You must call the function using the "onClientGUIClick" event. addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) end addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) function DestroyWindow() destroyElement(GUIEditor_Window[1]) end Obs: the code contain some erros purposely. You must read it and understand how it works.
-
Shit, beautiful! You made an amazing project, congratulations!
-
The TAPL example does work. In your example (teteomar), you use the "Window" variable, but she's not declared. You must use GUIEditor_Window[1], because you used this variable to store the window.
-
Erro console
Stanley Sathler replied to honda_aa's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
O arquivo mtaserver.conf deve estar danificado. -
It's for what? Give 1.000 dollars to who shot a Bot? If yes, can you use "onClientPedDamage"? If not, so can use the Karthik code. Seems right (make sure of "source" variable).
-
Teteomar, I'm sorry if I'm being rude, but we aren't teachers. If we know, is because we use the Wiki and LUA Manual. Yes, I agree with you: it's hard. But we need try, bro. Read, and read again, and again.
-
Script so that a car does not start to burn as soon as it is
Stanley Sathler replied to BieHDC's topic in Scripting
No BieHDC, I'm not so good. Don't be ironic. If you wanna a script, there two ways: - Learn Lua. If you tried and failed, try again. - Pay for a scripter. If you're trying learn and have questions about your code, we will help you, make sure of this. But if you want a ready code, we will not work for you. -
JokeR, - You know how to program in Lua? I guess not. - You know the MTA Wiki? I guess not. Solidsnake sent to you the functions. Why don't you read the Wiki and learn how to use the functions? Did you know that you can find the Weapon ID's on MTA Wiki? We will not program for you. We will not work for you. If you want make something, go learn Lua. Is the better way.
-
Seb, seems very very good in your resolution. I'm happy you liked it. I'll try make new themes in future.
