Jump to content

tim260

Members
  • Posts

    157
  • Joined

  • Last visited

Everything posted by tim260

  1. https://wiki.multitheftauto.com/wiki/GuiBringToFront
  2. In a nutshell When i apply my custom collision to an object, it returns true so it is applied, but the whole collision stops working and when i come close the object dissapears. Which i really dont understand because i cant figure out what i am doing wrong. Client Side Script function replaceModel() armydff = engineLoadDFF("SAAF/des_a51infenc.dff", 16094) engineReplaceModel(armydff, 16094) col = engineLoadCOL("SAAF/countn2_5.col") engineReplaceCOL ( col, 16094 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) Meta <meta> <info author="A51 Custom Fence Collision" name="Custom Collision" version="1.0" type="script"/> <script src="client.lua" type="client" cache="false"/> <file src="SAAF/countn2_5.col" type="client"/> <file src="SAAF/des_a51infenc.dff" type="client"/> </meta>
  3. Sorry i dont work with those index and table stuff alot could you give me a brief example, much aprreciated.
  4. Hello fellow MTA'ers, I am having the following problem. I have had a spawn menu for ages now and this problem has been bothering me for some time. I have a grid list called Spawn. And an XML file where its loaded from. the XML looks like this < just an example > <city name="North"> <class name="Admin" r="200" g="200" b="200"> <spawn name="Admin 1" all the info... > <skin>217</skin> </spawn> <spawn name="Admin 2" all the info... > <skin>217</skin> </spawn> <spawn name="Admin 3" all the info... > <skin>217</skin> </spawn> </class> </city> Instead of outputting the Grid like this - Admin 1 - Admin 2 - Admin 3 it outputs it like: - Admin 1 - Admin 3 - Admin 2 How is this possible? the script wich creates te list is below. function onClassClick(button) if source == classGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(classGridList) > 0 then guiGridListClear(spawnGridList) local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ); local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( classGridList ); local className = guiGridListGetItemText( classGridList, selectedRow, selectedCol ) local classSkins = cities[cityName][className] for x, y in pairs(classSkins) do local row = guiGridListAddRow(spawnGridList) guiGridListSetItemText(spawnGridList, row, 1, x, false, false) end guiSetProperty(spawnScreenOKButton, "Disabled", "True") guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") guiSetText(skinNumberLabel, 1) unRenderSkin() end end end
  5. tim260

    applying LOD?

    So i have this custom model from a site but the LOD is in an seperate file. I couldn't seem to find any functions to load or apply it, dooes anybody have an solution for this? Thanks in advance, tim
  6. tim260

    Custom .col

    You load the Collision file but where do you apply/replace it? thinks this will fix it function resourceStart() txd = engineLoadTXD("materials/island.txd") engineImportTXD (txd,1337) col = engineLoadCOL("meshes/island.col") dff = engineLoadDFF("meshes/island.dff",1337) engineReplaceModel(dff,1337) engineReplaceCOL ( col, 1337 ) engineSetModelLODDistance(1337,300) end
  7. Any example how you would do it ? Or functions it could be done with
  8. I've been thinking about it for some time but i dont know if its possible. Its about streaming a live view onto something im sure you all know the CCTV Camera System, i want to make a room for it with live streaming cams. I think this image : http://ww3.hdnux.com/photos/14/20/42/32 ... 28x471.jpg Will say enough. Im just asking if its possible and how it would be if it's. Greetings, Tim260
  9. i found the problem but cant replace vehicle.txd
  10. I noticed this a long time ago but i never knew if its a bug client/server side or just something not synced. Whenever i add a mod and see the image on the internet its like this : ( colored LED beams ) http://gtapolicemods.com/downloads/tf3_3_R84.jpg but ingame they show up like this ( white ( no color ) LED beams ) http://img145.imageshack.us/img145/6485 ... 163736.png
  11. How come i saw the lights yesterday and now i dont anymore ?
  12. Direct one i ment cant find it there tried mutliply things
  13. how would i update ?edit : If someone could give me a dl link would be nice
  14. so im using the right version is this an MTA bug ? Multi Theft Auto v1.3-release-4209 Copyright (C) 2003 - 2012 Multi Theft Auto MTA:SA Server v1.3-release-4209
  15. im having trouble with addvehicle siren, i couldnt get the lights to work so i tried this : addEventHandler("onVehicleEnter",root,function(player,seat) if(player)and(seat==0)then addVehicleSirens(source,1,1) setVehicleSirens(source,1,3,0,0,1,255,0,0,255,1.0) bindKey(player,"g","up",getSiren,source) end end) function getSiren(player,button,state,vehicle) local sirenData = getVehicleSirens(vehicle) outputChatBox("Here's the properties of your vehicle sirens: Red,Green,Blue: "..tostring(sirenData[1][0])..","..tostring(sirenData[1][1])..","..tostring(sirenData[1][2])..", X,Y,Z: "..tostring(sirenData[1][3])..","..tostring(sirenData[1][4])..","..tostring(sirenData[1][5])..", minAlpha: "..tostring(sirenData[1][6])..".",player) end addEventHandler("onVehicleExit",root,function(player,seat) if(player)and(seat==0)then removeVehicleSirens(source) unbindKey(player,"g","up",getSiren) end end) BUT im gettin everything Nil again RGB and XYZ all nil btw got that script from : https://wiki.multitheftauto.com/wiki/GetVehicleSirens
  16. tim260

    admin panel

    are the commmands listed anywhere i cant find them except for a few in the ACL
  17. tim260

    admin panel

    sorry to bump this quite old one but i was also wondering how to open any kind of administrating panel then in the MTA:PARADISE
  18. tim260

    MySQl VenuX

    Thank you it worked but now when i try to register it gives this : [2012-05-12 16:22:00] INFO: Column count doesn't match value count at row 1
  19. tim260

    MySQl VenuX

    Hey when ever i start the resource "sql" it shuts the server down ( removed the database pass ) [2012-05-12 16:11:01] start: Requested by Console [2012-05-12 16:11:01] Starting sql [2012-05-12 16:11:01] Server shutdown as requested by resource sql (MySQL module missing.) [2012-05-12 16:11:01] Start up of resource sql cancelled by script [2012-05-12 16:11:01] Stopping sql [2012-05-12 16:11:01] start: Resource 'sql' start was requested (Start up of resource cancelled by script ) [2012-05-12 16:11:02] Server stopped! [2012-05-12 16:11:02] Stopping resources............... [2012-05-12 16:11:02] Closing SQLite3 database This is the MySQL script : --[[ --- |\-/| Roleplay VX Version one |\-/| --- --- Developer: AeroXbird & Lukkaz --- --- Special Thanks: Mabako --- --- SQL SYSTEM --- --- Copyright (c) 2010 MTA: Paradise --- --]] local connection = nil local connection = nil local null = nil local results = { } local max_results = 128 -- connection functions local function connect( ) -- retrieve the settings local server = get( "server" ) or "localhost" -- server local user = get( "user" ) or "root" -- username local password = get( "password" ) or "" -- password local db = get( "database" ) or "mta" -- database local port = get( "port" ) or 3306 local socket = get( "socket" ) or nil -- connect connection = mysql_connect ( server, user, password, db, port, socket ) if connection then if user == "root" then setTimer( outputDebugString, 100, 1, "Connecting to your MySQL as 'root' is strongly discouraged.", 2 ) end return true else outputDebugString ( "Connection to MySQL Failed.", 1 ) return false end end local function disconnect( ) if connection and mysql_ping( connection ) then mysql_close( connection ) end end local function checkConnection( ) if not connection or not mysql_ping( connection ) then return connect( ) end return true end addEventHandler( "onResourceStart", resourceRoot, function( ) if not mysql_connect then if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "MySQL module missing." ) end cancelEvent( true, "MySQL module missing." ) elseif not hasObjectPermissionTo( resource, "function.mysql_connect" ) then if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "Insufficient ACL rights for mysql resource." ) end cancelEvent( true, "Insufficient ACL rights for mysql resource." ) elseif not connect( ) then if connection then outputDebugString( mysql_error( connection ), 1 ) end if hasObjectPermissionTo( resource, "function.shutdown" ) then shutdown( "MySQL failed to connect." ) end cancelEvent( true, "MySQL failed to connect." ) else null = mysql_null( ) end end ) addEventHandler( "onResourceStop", resourceRoot, function( ) for key, value in pairs( results ) do mysql_free_result( value.r ) outputDebugString( "Query not free()'d: " .. value.q, 2 ) end disconnect( ) end ) -- function escape_string( str ) if type( str ) == "string" then return mysql_escape_string( connection, str ) elseif type( str ) == "number" then return tostring( str ) end end local function query( str, ... ) checkConnection( ) if ( ... ) then local t = { ... } for k, v in ipairs( t ) do t[ k ] = escape_string( tostring( v ) ) or "" end str = str:format( unpack( t ) ) end local result = mysql_query( connection, str ) if result then for num = 1, max_results do if not results[ num ] then results[ num ] = { r = result, q = str } return num end end mysql_free_result( result ) return false, "Unable to allocate result in pool" end return false, mysql_error( connection ) end function query_free( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end checkConnection( ) if ( ... ) then local t = { ... } for k, v in ipairs( t ) do t[ k ] = escape_string( tostring( v ) ) or "" end str = str:format( unpack( t ) ) end local result = mysql_query( connection, str ) if result then mysql_free_result( result ) return true end return false, mysql_error( connection ) end function free_result( result ) if results[ result ] then mysql_free_result( results[ result ].r ) results[ result ] = nil end end function query_assoc( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local t = { } local result, error = query( str, ... ) if result then for result, row in mysql_rows_assoc( results[ result ].r ) do local num = #t + 1 t[ num ] = { } for key, value in pairs( row ) do if value ~= null then t[ num ][ key ] = tonumber( value ) or value end end end free_result( result ) return t end return false, error end function query_assoc_single( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local t = { } local result, error = query( str, ... ) if result then local row = mysql_fetch_assoc( results[ result ].r ) if row then for key, value in pairs( row ) do if value ~= null then t[ key ] = tonumber( value ) or value end end free_result( result ) return t end free_result( result ) return false end return false, error end function query_insertid( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local result, error = query( str, ... ) if result then local id = mysql_insert_id( connection ) free_result( result ) return id end return false, error end function query_affected_rows( str, ... ) if sourceResource == getResourceFromName( "runcode" ) then return false end local result, error = query( str, ... ) if result then local rows = mysql_affected_rows( connection ) free_result( result ) return rows end return false, error end
  20. nvm, thanks castillo it worked !
  21. What im trying to do is f.e. this : function setAdmin ( thePlayer ) if getElementData(source,"Class") == "Admin" then setElementModel ( thePlayer, 217 ) end addCommandHandler ( "staff", setAdmin ) restrict commands on class do you guys understand it now ? And im using 50p's spawn menu ( with a edit from castillo )
  22. I think he means getting the element data from the scoreboard... @tim you can't get the element data from the table, the element data is on the player, so if you want to get the class from a certain player, use: getElementsByType("player") for i,v in ipairs(--[[the table from the getElementsByType]])do --code end i dont understand it ;p
  23. Hey guys, i have a table in my scoreboard for the spawned skin from 50p's spawn menu. exports["scoreboard"]:scoreboardAddColumn ( "Class", root, 80 ) setElementData ( client, "Class", skin.name ) How can i do like : if getElementData(source,"Class") == "Admin" because i cant get it to work
  24. tim260

    Problem

    solved Hope i helped i dont get it
×
×
  • Create New...