Jump to content

Michael#

Members
  • Posts

    168
  • Joined

  • Last visited

Everything posted by Michael#

  1. -- we declare a vector ( table ) local aTest = { -- we create index 'username' and 'password' and set his value [ 'username' ] = 'Jayz'; [ 'password' ] = 123456; } -- we declare a function function dTestFunction ( ) -- now we call function 'getTestData' and pass aTest vector and we allocate the return value in a var local vTest = getTestData ( aTest, 'Jayz', 123456 ) -- if vTest return true if ( vTest ) then -- call function 'otherFunction' otherFunction ( ) end end function getTestData ( aVector, user, password ) -- check if passed parameter aVector is a table if ( type ( aVector ) == 'table' ) then -- check if table user and pass are the same as parameters passed if ( aVector['username'] == tostring ( user ) and aVector['password'] == tonumber ( password ) ) then return true -- else do that else return false end -- if it's not a table do that else return false end -- end function declaration end function otherFunction ( ) -- prints Welcome on the screen ( print function don't work on MTA! ) -- _G['print'] ( 'Welcome' ) = print ( 'Welcome' ) _G['print'] ( 'Welcome' ) end -- bindKey ( 'fire', 'both', dTestFunction ) If you don't understand something just tell me. This answer your question, I think. So, you can call functions by just typing: theFunction ( parameters separated by comma ) If there are any errors, please tell me.
  2. So, here are some info that I forgot to say: - I don't want dumbs; - I need a smart people; - Mode is Race; - I have 900MB of maps ( new maps, not oldschool or these dumb maps ); - I had to cancel domain because it sucks and I can't buy another now; - I don't want to make something nab: I know much languages so I can make something good; - If you want to help, PM me or reply here: what languages do you know, what can you do, do you have any ideas, skype.
  3. function loadPlayerData ( uPed, cData ) -- check if data have been passed if ( uPed and cData and type ( cData ) == 'string' ) then -- exists element data 'loggedin' ? if ( getElementData ( uPed, 'loggedin' ) ) then local cAccount = getElementData ( uPed, 'account' ) -- are u right that dbname is localhost? local vConnect = dbConnect ( 'mysql', 'dbname = localhost ; host = localhost', 'admin', 'admin', 'share = 1' ) local vQuery = dbQuery ( vConnect, 'SELECT `?` FROM smf_sdmembers WHERE passwd = `?`', cData, cAccount ) if ( vQuery ) then outputChatBox ( tostring ( vQuery ) ) local vResult, iRow, error = dbPoll ( vQuery, -1 ) if ( iRow > 0 ) then outputChatBox ( tostring ( vResult ) ) return vResult else return false end else outputDebugString ( 'Failed to get ' .. cData .. ' for player ' .. getPlayerName ( uPed ) .. ' @ ' .. error ) end else outputDebugString ( 'Player not logged in: ' .. getPlayerName ( uPed ) ) end else outputDebugString ( 'Bad argument @ loadPlayerData' ) end end Check comments.
  4. You can remove, just edit MTA Source Code.
  5. You has a error on Char system: ERROR: character-system/s_charactersystem.lua:489: attempt to concate [ nate local 'motd' (a boolean value) Show line 489 of file s_charactersystem.lua from character-system.
  6. Oh, I forgot to mention: It's Race, I was thinking in make my own mode too but as I'm not "pro" I... Fuu it will never be like MTA Defaults and maybe will not support current maps.
  7. Hey guys! I just started a team called "EGT" ( European Gamers Tour ) as you can see in the topic name and I'm looking for a good person that can give me ideas, help managing the servers ( this doesn't means that I can't script ), etc.. Basically, to be co-owner. Forum - I bought a domain for the forum and I'm currently developing the forum, but it will take some time yet because I need change all my scripts to support IPBoard ( I was using other ) and domain nameservers changes need 24-48 hours to take effect. Server - I have a lot of original ideas but I need help with design, ideas of how can something be done ( not about scripting, but how the scripts can be ) because I want the best comfortabillity for the players. About server hosting, I don't know if I can buy it, but for now, it's not needed. If you want, you must show me that you are a good and trusted guy. Anything you need, just ask.
  8. E o que eu disse? Problema de conexão lol O cliente não conseguiu receber as informações porque a porta estava bloqueada.
  9. No problem and thanks Kenix too because he gave me an example how to do that ( I didn't know how I pass to next value in loop ).
  10. Michael#

    Help!!!

    This is Scripting section, not Host Support. If you don't want to learn what serverFFS wrote then do nothing. serverFFS is announcing that a error appeared and you can't use the Control Panel until the engineers repair.
  11. Michael#

    Help Me

    Oh yeah, I noticed this but I forgot to change
  12. No, no, no. You should pass to next index on table if it's your vehicle. Try that: addEvent ( 'onPlayerReachCheckpoint', true ) addEventHandler ( 'onPlayerReachCheckpoint', root, function ( eCheckpoint ) if ( eCheckpoint == 1 ) then outputChatBox ( '#FF0000Disabling GhostMode at the next checkpoint!', source, 255, 255, 255, true ) end if ( eCheckpoint == 2 ) then doLoop ( 1, source ) end end ) function doLoop ( index, player ) for iCount = index, #getElementsByType 'vehicle' do if ( getElementsByType 'vehicle' [ iCount ] == getPedOccupiedVehicle ( player ) ) then doLoop ( iCount + 1, player ) break end local pVehicle = getElementsByType 'vehicle' [ iCount ] local fX, fY, fZ = getElementPosition ( player ) local fVehicleX, fVehicleY, fVehicleZ = getElementPosition ( pVehicle ) local fDistance = getDistanceBetweenPoints3D ( fVehicleX, fVehicleY, fVehicleZ, fX, fY, fZ ) if ( fDistance <= 20 ) then outputChatBox ( '#FF0000players around!', source, 255, 255, 255, true ) return end end setElementData ( source, 'overrideCollide.uniqueblah', 255, false ) setElementData ( source, 'overrideAlpha.uniqueblah', 255, false ) outputChatBox ( '#FF0000GhostMode has been disabled!', source, 255, 255, 255, true ) end
  13. Oh, I know now. The loop is comparing your vehicle position too.
  14. Check value returned by getDistanceBetweenPoints3D.
  15. Michael#

    Help Me

    Totally messed code. eWindow = guiCreateWindow(202,192,655,432,"news",false) eEdit = guiCreateButton(0.8336,0.7662,0.142,0.1366,"Edit",true,window) eBox = guiCreateMemo(0.0229,0.0579,0.8015,0.9097,"",true,window) eClose = guiCreateButton(0.8336,0.088,0.142,0.1366,"Close",true,window) showCursor ( true ) -- eNews = guiCreateWindow(202,192,655,432," Edit news",false) eNEdit = guiCreateButton(0.8336,0.7662,0.142,0.1366,"Edit",true,windows) eNBox = guiCreateMemo(0.0229,0.0579,0.8015,0.9097,"",true,windows) eNClose = guiCreateButton(0.8336,0.088,0.142,0.1366,"Close",true,windows) guiSetVisible ( eNews, false ) guiEditSetMaxLength ( eNBox, 128 ) -- addEventHandler ( 'onClientResourceStart', resourceRoot, function ( ) addEventHandler ( 'onClientGUIClick', root, showGUI ) end ) -- function showGUI ( ) if ( source == eEdit ) then guiSetVisible ( eNews, true ) elseif ( source == eNClose ) then guiGetVisible ( eNews ) and showCursor ( false ) and guiSetVisible ( eNews, false ) elseif ( source == eClose ) then guiSetVisible ( eWindow, false ) showCursor ( false ) elseif ( source == eNEdit ) then local cText = guiGetText ( eNBox ) if ( cText and cText ~= 'eeee' ) then guiSetText ( eBox, cText ) end end )
  16. This happens when there are vehicles near too?
  17. Check conditions. Also, is the event being called?
  18. You should start learning english first instead of using Google Translator too.
  19. tostring in numbers? Good job lol addEvent ( 'onPlayerReachCheckpoint', true ) addEventHandler ( 'onPlayerReachCheckpoint', root, function ( eCheckpoint ) if ( eCheckpoint == 7 ) then outputChatBox ( '#FF0000Disabling GhostMode at the next checkpoint!', source, 255, 255, 255, true ) end if ( eCheckpoint == 8 ) then local fX, fY, fZ = getElementPosition ( source ) for _, pVehicle in ipairs ( getElementsByType 'vehicle' ) do local fVehicleX, fVehicleY, fVehicleZ = getElementPosition ( pVehicle ) local fDistance = getDistanceBetweenPoints3D ( iVehicleX, iVehicleY, iVehicleZ, iX, iY, iZ ) if ( fDistance <= 20 ) then return end end setElementData ( source, 'overrideCollide.uniqueblah', 255, false ) setElementData ( source, 'overrideAlpha.uniqueblah', 255, false ) outputChatBox ( '#FF0000GhostMode has been disabled!', source, 255, 255, 255, true ) end end ) Not tested. It will disable ghostmode if vehicles distance are bigger than 20. Note that this will only happens when you reach a checkpoint, not everytime the distance is major / minor.
  20. @@blazy, you're wrong. Element data is deleted when element is deleted. When player join, element data 'firsttimejoin' on player is nil. You must check by name, serial, account, ip or whatever you like.
  21. Just edit function STopTimesManager:playerFinished and put this. Just don't ask me where is the function because I don't know, I don't use this shit
×
×
  • Create New...