Aibo

Scripting Moderators
  • Content Count

    1,105
  • Joined

  • Last visited

Everything posted by Aibo

  1. Aibo

    Some skins

    for those who may be interested (click on an image to download): if the links above are dead: http://mta.cgx.ru/up/Black.zip http://mta.cgx.ru/up/Orange.zip
  2. what does 136 mean? what is carHealth?
  3. Aibo

    How To get position from table ?

    eh. it shouldn't, because camera matrix applied only to the source of onPlayerJoin event.
  4. carHealth = ( math.max(getElementHealth(vehicle) - 250, 0) ) / 7.5 * 1.6
  5. Aibo

    How To get position from table ?

    -- Value = positionX, positionY, positionZ, lookAtX, lookAtY, lookAtZ local cameraPos = { { 1525.5999755859, 2833.5, 36.299999237061, 1524.8000488281, 2833.3999023438 , 35.299999237061 }, { 1464.4000244141, 2840.8999023438, 82.400001525879, 1453.5999755859, 2833.6999511719, 74.400001525879 }, { 1469.5, 2815.3000488281, 44.799999237061, 1470.0999755859, 2822.8000488281, 44.799999237061 }, --{ x, y, z, lookAtX, lookAtY, lookAtZ }, } local currentCamera = 0 function setCameraPos() fadeCamera(source, true, 5) setCameraMatrix( source, unpack(cameraPos[currentCamera + 1]) ) end
  6. Aibo

    Some skins

    I can't download it please send a link , thanks since 1.3 it is included with MTA
  7. Aibo

    Some skins

    the domain wasn't registered by me and has expired two days ago, so i have to poke that guy to prolong it. it'll be up in a few days, i guess. PS: actually it is up, but DNS servers seem to not like it, sometimes it opens, sometimes not, at least for me.
  8. Aibo

    Another help please

    local n = tonumber(string.format("%.2f", 9/7)) -- n == 1.29 PS: if you dont need it as a number for further calculations (like if you're just going to display it somewhere), you can drop tonumber(). but keep in mind that it will add zeros to integers (like 9/9 will result in 1.00 without tonumber)
  9. Aibo

    (eof) expected near end line 17

    you have an extra end at line 14. or 15. or 16. hard to tell without proper indentation
  10. Aibo

    Attempt to perform arithmetic on a nil value

    takePlayerMoney (and the whole money system) operates with integers, not floats. so you probably should round that float to an integer at some point.
  11. Aibo

    Attempt to perform arithmetic on a nil value

    probably your guiGetText dont contain any numbers, so tonumber() returns nil debug it, check the data you get from your gui elements since your conditions are logically wrong (should be AND, not OR), you're always passing even empty strings to tonumber(). example (not lua): if A is not 1 OR A is not 2 — result will always be true when A IS 2, the first condition is true (because 2 is not 1) when A IS 1, the second condition is true (because 1 is not 2) and they are both true with any other A value so you should either use AND: if (a ~= "") and (a ~= "0") then -- do stuff with your data end or change the condition and the code executed if its true: if (a == "") or (a == "0") then -- do stuff when NO VALID DATA (i.e. "a" doesnt contain numbers or is "0") is present else -- do stuff with your data end
  12. Aibo

    add an image to a gui window.

    no, you put mainWindow as parent in the last argument of guiCreateStaticImage: mainWindow = guiCreateWindow(screenWidth/2-mainWidth/2,screenHeight/2-mainHeight/2,mainWidth,mainHeight,"Login panel",false) myImage = guiCreateStaticImage(x, y, imageWidth, imageHeight, "path/to/image.png", false, mainWindow)
  13. Aibo

    Help with guiGetText

    you can also try to check if the length of the returned string is > 0 using guiGetText(descriptionMemo):len() or utfLen(guiGetText(descriptionMemo))
  14. Aibo

    Help with guiGetText

    where's descriptionMemo defined?
  15. Aibo

    need help (xml)!

    xmlNodeGetAttribute returns a string and you're comparing it with a number.
  16. Aibo

    Watch my new project

    http://cgx.ru/-/234m349ds3
  17. Aibo

    GUI Clicking other element

    if you're using onClientClick event, try opening the window only if state == "down"
  18. Aibo

    [Needed] Traductions

    sounds kinda racist.
  19. Aibo

    SQLite to My-SQL community top times

    haha, i see this is the most popular answer in the scripting section these days. where may i suggest to rename the section to "we will not do it for you"? actually, "we will not do it for you" is a pretty legit name. because we won't. this section is for questions/problems/support, not requests. meh, if you wanna go personal — do it via PM.
  20. зачем еще раз вызывать функцию которая не будет работать (потому, что source будет nil) если она уже привязана в эвенту?
  21. Aibo

    :o. How is that possible?

    getElementByID
  22. Aibo

    onColShapeHit

    you should've learned some programming logic instead of semicolons and type prefixes in a dynamically-typed language. think whatever you like, but dont confuse other people into thinking they can pass nil values and "add function there later". also if you and SolidSnake14 are going to argue who called who what, please do that in PM.
  23. Aibo

    onColShapeHit

    DrakeN youre adding event handlers before handler functions are even defined.
  24. Aibo

    Export functions

    kimmis9 its on the wiki page for call function.
  25. Aibo

    help please

    guiGetText returns a string, try it with tonumber(housenumber) also "/debugscript 3" helps