Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    dx calculations

    local sx, sy = guiGetScreenSize ( ) local example = { { "test1" }, { "test2" } } function draw ( ) local width, height = 100, 50 local x, y = ( sx / 2 - width / 2 ), ( sy / 2 - height / 2 ) for _, value in ipairs ( example ) do dxDrawRectangle ( x, y, width, height ) end end addEventHandler ( "onClientRender", root, draw )
  2. I'm not sure if it would be such a big deal when using SQLite, but it is if you use MySQL.
  3. addCommandHandler ( "model", function ( thePlayer, _, name ) if ( models [ name ] ) then outputChatBox ( "The model for: ".. name .." is: ".. models [ name ], thePlayer ) end end ) Write "/model gta3" and it should output it's model.
  4. I can't seem them either, upload them to another site, not the same one. Try this one: http://imgur.com/
  5. Put this at the end of the file: fileDelete ( "logo.lua" )
  6. function checkForUsername ( username ) handler = mysql_connect ( "127.0.0.1", "root", "", "akrp_db" ) local result = mysql_query ( handler, "SELECT USERNAME FROM `user_info` WHERE USERNAME = '" .. username .. "'" ) local res2 = mysql_fetch_assoc ( result ) if ( type ( res2 ) == "table" ) then outputChatBox ( res2.USERNAME ) else outputChatBox ( "NIL" ) end end addEvent ( "onCheckForUsername", true ) addEventHandler ( "onCheckForUsername", root, checkForUsername )
  7. What is the problem? does it output errors in the debugscript?
  8. I can't see the images you posted, upload them somewhere else.
  9. You want it to be deleted once the client finishes downloading?
  10. Depends on how you are storing these values. You can use "ORDER BY" in the query. Example: SELECT account, myValue FROM myTable ORDER BY myValue DESC LIMIT 10
  11. Check my post, I edited it, use that function and it should do the job.
  12. Could be that the size height is not enough to display the items. You can use this useful function to adjust it: https://wiki.multitheftauto.com/wiki/Gu ... justHeight *REMEMBER TO COPY THE SOURCE CODE TO USE IT*
  13. getElementPosition getDistanceBetweenPoints3D
  14. function onMarker ( hitElement ) if ( hitElement == localPlayer ) then if ( isElementWithinMarker ( localPlayer, marker ) or isElementWithinMarker ( localPlayer, marker1 ) or isElementWithinMarker ( localPlayer, marker2 ) or isElementWithinMarker ( localPlayer, marker3 ) or isElementWithinMarker ( localPlayer, marker4 ) or isElementWithinMarker ( localPlayer, marker5 ) ) then addEventHandler ( "onClientRender", root, texto ) bindKey ( "H", "down", Visible ) end end end addEventHandler ( "onClientMarkerHit", root, onMarker ) function onLeave ( leaveElement ) if ( leaveElement == localPlayer ) then removeEventHandler ( "onClientRender", root, texto ) unbindKey ( "H", "down", Visible ) guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) end end addEventHandler ( "onClientMarkerLeave", root, onLeave )
  15. But I told you to use mysql_fetch_assoc, I can't see it on that code.
  16. What do you mean by "with another model"?
  17. Post your code and tell me where is that error coming from.
  18. You must use mysql_fetch_assoc along with mysql_query if I'm right.
  19. What is "source" doing in the table?
  20. Make sure you put the script as server side in the meta.xml.
  21. My bad, I didn't notice that part. @aleksa.mta: You can always use the MTA built-on MySQL functions, they are quite easier to use, at least for me.
  22. function boxogret ( ) setTimer ( setPedAnimation, 5000, 1, localPlayer, "FIGHT_B", "FightB_2" ) end addEvent ( "oyuncuyaboxogret", true ) addEventHandler ( "oyuncuyaboxogret", getLocalPlayer(), boxogret )
×
×
  • Create New...