Jump to content

papam77

Members
  • Posts

    517
  • Joined

  • Last visited

Everything posted by papam77

  1. Hello, how can make alpha changing if i enter with mouse to my image? lobby = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/lobbyBG.png", true) arenas = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/arenas.png", true) dm = guiCreateStaticImage(0.157, 0.19, 0.17, 0.305, "images/areny/dm.png", true, arenas) dd = guiCreateStaticImage(0.331, 0.19, 0.17, 0.305, "images/areny/dm.png", true, arenas) guiSetAlpha ( dm, 0.75 ) guiSetAlpha ( dd, 0.75 ) This is code for images alpha must be 1.00 if player enter to the button. How can do that?
  2. It can play cca 11351351351 hours. Until player select arena
  3. Yes. I have this now local bg = playSound("sound/sea.mp3") setSoundVolume(bg, 1.0) And it doesn't repeat it
  4. Yeah, work it Ty. last ask: How can set song repeat ? Again, again and again.
  5. Version 1: caa = guiCreateLabel(0.00, 0.00, 1.00, 0.14, "Choose an Arena", true) guiCreateFont(caa, "fonts/font.ttf", 20 ) guiLabelSetHorizontalAlign(caa, "center", false) guiLabelSetVerticalAlign(caa, "center") Version 2: caa = guiCreateLabel(0.00, 0.00, 1.00, 0.14, "Choose an Arena", true) caa= guiCreateFont("fonts/font.ttf", 20 ) guiLabelSetHorizontalAlign(caa, "center", false) guiLabelSetVerticalAlign(caa, "center") And doesn't work...
  6. Now works it! And why scale doesn't work? guiCreateFont(caa, "fonts/font.ttf", 20 ) And text size is still same
  7. Error: WARNING: eag/lobby_c.lua:4: Bad 'sound/player' pointer @ 'setSoundVolume'(1) lobby_c.lua function lobby(system) -- Effects local bg = playSound("sound/sea.mp3") setSoundVolume(bg, 1.0) -- Design lobby = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/lobbyBG.png", true) end addCommandHandler ("system", lobby) meta.xml "DeeJay" type="gamemode" />
  8. Hello, why it doesn't work? function lobby(player) -- Effects local bg = playSound("sounds/sea.mp3") setSoundVolume(bg, 1.0) -- Design lobby = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/lobbyBG.png", true) end addCommandHandler ("system", lobby)
  9. Hello, i wanna make maplist with DB, but how? Yes sure, getMapName But how can write it to DB, because i never worked with DB.
  10. Work it. Ty How can add colors?
  11. ERROR: JoinQuit\join_c.lua:7: attempt to concatenate local 'playerName' (a userdata value)
  12. join_c.lua ----------------------------------------- -- Join & Quit by DeeJay ----------------------------------------- function ukazToGUI() joinPlayerShowName = guiCreateLabel(0.89, 0.00, 0.11, 0.05, "ahoj", true) guiLabelSetVerticalAlign(joinPlayerShowName, "center") joinPlayerShowImage = guiCreateStaticImage(0.86, 0.00, 0.14, 0.05, "img/join.png", true) guiSetAlpha(joinPlayerShowImage, 0.39) outputChatBox("Ukazano") end addEventHandler("ukazSe", getRootElement(), ukazToGUI ) addEvent("ukazSe",true) join_s.lua ----------------------------------------- -- Join & Quit by DeeJay ----------------------------------------- addEventHandler("onPlayerLogin", root, function() outputChatBox("Trigerovano") triggerClientEvent("ukazSe", getRootElement(), source) end) Where's error ? It doesn't work...
  13. Hello, i am making my own Join Quit, but i have really stupid problem. addEventHandler("onPlayerLogin", root, function() GUIEditor.label[1] = guiCreateLabel(0.89, 0.00, 0.11, 0.05, "ahoj", true, root) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") GUIEditor.staticimage[1] = guiCreateStaticImage(0.86, 0.00, 0.14, 0.05, "img/join.png", true, root) guiSetAlpha(GUIEditor.staticimage[1], 0.39) end ) Why i don't see image and text "ahoj" ?
  14. https://sphotos-a.xx.fbcdn.net/hphotos- ... 3463_n.png
  15. I saw it on one server. The server hasn't this...
  16. This, how can change it to my design ?
  17. How can change download design ? Which function ?
  18. I need to connect toptimes to DB, where's error ? -- -- databasetable_server.lua -- -- A Lua table which is loaded/saved from the sqlite database -- Handled column types are TEXT and REAL -- SDatabaseTable = {} SDatabaseTable.__index = SDatabaseTable SDatabaseTable.instances = {} dbConnect("mysql","dbname=zahrej;host=mysql.mmhost.eu","zahrej","Its Secret") --------------------------------------------------------------------------- -- -- SDatabaseTable:create() -- -- -- --------------------------------------------------------------------------- function SDatabaseTable:create(name,columns,columnTypes) local id = #SDatabaseTable.instances + 1 SDatabaseTable.instances[id] = setmetatable( { id = id, name = name, columns = columns, columnTypes = columnTypes, rows = {}, }, self ) SDatabaseTable.instances[id]:postCreate() return SDatabaseTable.instances[id] end --------------------------------------------------------------------------- -- -- SDatabaseTable:destroy() -- -- -- --------------------------------------------------------------------------- function SDatabaseTable:destroy() SDatabaseTable.instances[self.id] = nil self.id = 0 ped = nil vehicle = nil end --------------------------------------------------------------------------- -- -- SDatabaseTable:postCreate() -- -- -- --------------------------------------------------------------------------- function SDatabaseTable:postCreate() -- Set column types as strings if not set while #self.columnTypes < #self.columns do table.insert( self.columnTypes, 'TEXT' ) end end --------------------------------------------------------------------------- -- -- SDatabaseTable:safestring() -- -- -- --------------------------------------------------------------------------- function safestring( s ) -- escape ' return s:gsub( "(['])", "''" ) end function qsafestring( s ) -- ensure is wrapped in ' return "'" .. safestring(s) .. "'" end function qsafetablename( s ) return qsafestring(s) end --------------------------------------------------------------------------- -- -- SDatabaseTable:load() -- -- -- --------------------------------------------------------------------------- function SDatabaseTable:load() for i=1,10 do if self:tryLoad() then return end end end --------------------------------------------------------------------------- -- -- SDatabaseTable:tryLoad() -- -- -- --------------------------------------------------------------------------- function SDatabaseTable:tryLoad() outputDebug( 'TOPTIMES', 'SDatabaseTable: Loading ' .. self.name ) self.rows = {} local cmd -- CREATE TABLE self:createTable() -- SELECT -- Build command cmd = 'SELECT * FROM ' .. qsafetablename( self.name ) local sqlResults = executeSQLQuery( cmd ) if not sqlResults then return false end -- Process into rows self.rows = {} for r,sqlRow in ipairs(sqlResults) do local row = {} for c,column in ipairs(self.columns) do row[column] = sqlRow[column] end table.insert( self.rows, row ) end -- Make copy to detect changes self.rowsCopy = table.deepcopy(self.rows) return true end --------------------------------------------------------------------------- -- -- SDatabaseTable:save() -- -- -- --------------------------------------------------------------------------- function SDatabaseTable:save() -- See if save required local bChanged = false if not self.rowsCopy or #self.rows ~= #self.rowsCopy then bChanged = true else for r,row in ipairs(self.rows) do for c,col in ipairs(self.columns) do if self.rows[r][col] ~= self.rowsCopy[r][col] then bChanged = true break end end if bChanged then break end end end if not bChanged then return end outputDebug( 'TOPTIMES', 'SDatabaseTable: Saving ' .. self.name ) -- Being save executeSQLQuery( 'BEGIN TRANSACTION' ); local cmd -- DELETE TABLE -- Build command --cmd = 'DELETE FROM ' .. qsafetablename( self.name ) cmd = 'DROP TABLE IF EXISTS ' .. qsafetablename( self.name ) executeSQLQuery( cmd ) -- CREATE TABLE self:createTable() -- Rebuild -- For each row for r,row in ipairs(self.rows) do -- INSERT INTO cmd = 'INSERT INTO ' .. qsafetablename( self.name ) .. ' VALUES (' for c=1,#self.columns do if c > 1 then cmd = cmd .. ', ' end local key = self.columns[c] if type(row[key]) == 'number' then cmd = cmd .. row[key] or 0 else cmd = cmd .. qsafestring( row[key] or '' ) end end cmd = cmd .. ')' executeSQLQuery( cmd ) end executeSQLQuery( 'END TRANSACTION' ); -- Make copy to detect changes self.rowsCopy = table.deepcopy(self.rows) end --------------------------------------------------------------------------- -- -- SDatabaseTable:createTable() -- -- -- --------------------------------------------------------------------------- function SDatabaseTable:createTable() local cmd -- CREATE TABLE -- Build command cmd = 'CREATE TABLE IF NOT EXISTS ' .. qsafetablename( self.name ) .. ' (' for c=1,#self.columns do if c > 1 then cmd = cmd .. ', '
  19. Hello, we are making lobby, but we have problem, we see in freeroam race scripts, why? When i press button for Join To Freeroam, will start race too...as in Race button.
  20. Hello, i need help with settings. I have lobby but i need to include it. I made setting.lua -------------------------------------------------------- ----------------- Arenas Settings ---------------------- -------------------------------------------------------- newArena = { [1] = true -- V závorce je celkový počet arén } arena = { [1] = { name = "Freeroam", elementID = "FreeroamPlayers", label = [[ ]], -- Mezi zavorky napiš jmeno labelu friendlyName = "FR", slots = 10, resource = "fr", -- Zde si napiš jmeno resource na mod zatím jsem ti tam dal DM dimension = 1 }, I need include it here: /resources/[FirstMn_Scripts_TEST]/areny/gamemodes/[Freeroam]/freeroam.lua This is main file: /resources/[FirstMn_Scripts_TEST]/areny/gui.lua And why include? Because i made onPlayerWasted but it works for freeroam and dm when i die in DM i am in hospital It is only for freeroam
×
×
  • Create New...