Jump to content

Dreft

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by Dreft

  1. with dxDraws everything Ok. But now I have problem with GUI windows. this is my GUI: Window = guiCreateWindow(0.3398,0.7591,0.327,0.1657,"Pasirinkite isvaizda | Choose skin",true) guiSetAlpha(Window,0.69999998807907) guiWindowSetMovable(Window,false) guiWindowSetSizable(Window,false) Left_Button = guiCreateButton(17,29,66,43,"<<<",false,Window) Right_Button = guiCreateButton(248,29,66,43,">>>",false,Window) EditBox = guiCreateEdit(89,32,56,36,"123",false,Window) guiEditSetMaxLength(EditBox,3) OK_Button = guiCreateButton(149,35,50,29,"OK",false,Window) Confirm_Button = guiCreateButton(33,86,265,29,"PATVIRTINTI | APPLY",false,Window) This is how it looks on 1024x768 screen(It's correct, everything there, where it need to be) - http://pics.lt/images/mta-screen%202010 ... -13-23.png This is how it looks on 1280x1024 screen(It's not correct, window is too big ) - http://pics.lt/images/mta-screen%202010 ... -14-16.png Is there anything I can do, that on 1024x768 and 1280x1024 GUI will be in same place and same size ? EDIT: NVM, fixed
  2. Erm, this always draw text at the center, but what if I want that text appear in some other place, for example top, right corner ?
  3. Hm.. dxDrawText( "someText", 102.0,236.0,1086.0,306.0,tocolor(r,g,b,a),2.0,"pricedown","center","center",false,false,false) This writing text in ~center of the screen, but near top. If I do: local sx,sy = guiGetScreenSize() local sizex,sizey = 1086,306 local posx = 0.5*sx-0.5*sizex local posy = 0.5*sy-0.5*sizey dxDrawText( "someText", 102.0,236.0,posx,posy,tocolor(r,g,b,a),2.0,"pricedown","center","center",false,false,false) Then text appears on the right(or left, i don't remember) on my screen :\ What I'm doing wrong ?
  4. How to make GUI's and dxDraw's that they fit to different screens ? I know that I need to use guiGetScreenSize, but I don't know how to calculate to correct values.. For example, if on 800x600 screen I create GUI which is on top of the corner, on 1280x1024 screen it won't be there, it will be lower. Is there some formula which can be used when calculating correct GUI's and dxDraw's coordinates to find, for different screen resolutions ?
  5. It returns not exactly in front of there, where player is facing(rotation).. it returns in front, but in North.. Oh nvm EDIT: My mistake everything works excelent
  6. Is it possible to get X and Y coordinates in front of another X, Y and Rotate coordinates ?
  7. Oh thanks, I was using getRootElement() instead of getLocalPlayer(), here was problem Thanks again.
  8. On server side script: setElementData( thePlayer, "someValue", 100 ) On client side script: setElementData( getRootElement(), "someValue", getElementData( getRootElement(), "someValue" ) -1 ) And error is on line setElementData( getRootElement(), "someValue", getElementData( getRootElement(), "someValue" ) -1 ) : ERROR: attempt to perform arithmetic on a boolean value getElementData returns false if data wasn't set, so i can understand that client sees data "someValue" as doesn't created. Maybe I'm doing something wrong ?
  9. Dreft

    Chat commands

    Or you can make everything with function PlayerToPoint(function from samp), function: function PlayerToPoint( player, radius, x, y, z ) oldpos = {} temppos = {} oldpos[0],oldpos[1],oldpos[2] = getElementPosition( player ) temppos[0] = oldpos[0] - x temppos[1] = oldpos[1] - y temppos[2] = oldpos[2] - z if(((temppos[0] < radius) and (temppos[0] > -radius)) and ((temppos[1] < radius) and (temppos[1] > -radius)) and ((temppos[2] < radius) and (temppos[2] > -radius))) then return true end return false end
  10. I don't like test drawings position on screen via scripting, because creating text/images on screen with editor is much better
  11. Ok, thx for answer. And having some dxDraw<..> editor would be much faster to make them
  12. Maybe there is some resource for dxDraw functions ? Something like "GuiEditor" ?
  13. Cool, but this editor is too confusing to me o_O Maybe because i have used Notepad++ from begining of Lua scripting
  14. Oh, easy. Thanks for help And one more question on topic :} Script 1: setElementData( thePlayer, "variable.a", 5 ) Script2: a = getElementData( thePlayer, "variable.a" ) This will be right ?
  15. Uhm.. ok, how to get it in another server-side script ? If i set a = 5, then in others server-side scripts its automatically set to 5 too ?
  16. I have: scriptone.lua - server side scripttwo.lua - client side In server side script "scriptone.lua" i created variable a = 5 How to know what "a" is equal in client side script "scripttwo.lua" ? I mean, how to move variables through all same resource scripts ?
  17. Mhm, ok. http://development.mtasa.com/index.php? ... ng_the_GUI Is this really works ? Because i do everything like here, but when i press button - nothing happens Maybe there is problem in that article ?
  18. Is there any difference is my game mode has hundreds of resources, or its just in one big *.lua resource ?
  19. Oh, there was: <script src="fr.lua"/> so I added this: <script src="fr.lua" type="client" /> and everything working thx.
  20. I don't want to make new topic every time when i want to ask something so I ask here if i had problems So i start: I get this error: [02:11:19] ERROR: ...RVER THUNDER_FR/mods/deathmatch/resources/efr/fr.lua:39: attempt to call global 'guiCreateWindow' (a nil value) Line 39 is LoginWindow = guiCreateWindow (423,209,376,102,"Prisijunkite...",false) Why this error appears? P.S. To create my GUI i used https://forum.multitheftauto.com/viewtop ... 91&t=22831 this. Waiting for help
  21. Dreft

    Hash.

    I found this http://development.mtasa.com/index.php? ... es/hashing and its very usefull, but damn, its just for windows Is there any hash module for windows and linux ? Actually i need MD5 hash module for linux, but if it isnt exist then maybe there is another alternative hash module ?
  22. works Oh how to create the same thing but just for boolean ? EDIT: Dont need it i thinked that i need to use bool:playervar when creating it, but now i see that i dont need
  23. How to make a variable "playervar" for all players, but for everyone with different value? In pawn i do this: new playervar[MAX_PLAYERS]; and then if i want to make playervar for player id 5 and 6 i do: playervar[5] = somenumber; playervar[6] = someothernumber; How to do something like this in Lua ?
  24. Dreft

    Beginning

    How to compile with Notepad++ ? Or mta dont need compiled files ?
×
×
  • Create New...