-
Posts
1,646 -
Joined
-
Last visited
Everything posted by CapY
-
Do i care ? I just want other help manager.
-
I have searched on the wiki , but i cant find the answer , i edited a helpmanager to this : local rootElement = getRootElement() local thisResourceRoot = getResourceRootElement(getThisResource()) local pagesXml local wndHelp, wndBlock, tPanel, btnClose local tab = {} local memo = {} local popupQueue = {} local Grid = {} local HELP_KEY = "F9" local HELP_COMMAND = "gamehelp" local POPUP_TIMEOUT = 15000 --ms local FADE_DELTA = 10 --alpha per frame local MAX_ALPHA = 10 addEvent("doShowHelp", true) addEvent("doHideHelp", true) addEvent("onHelpShown") addEvent("onHelpHidden") addEventHandler("onClientResourceStart", thisResourceRoot, function () wndHelp = guiCreateWindow(.2, .2, .6, .6, "Help", true) wndBlock = guiCreateWindow(0, 0, 1, 1, "", true) tPanel = guiCreateGridList(0.2086 ,0.1629, 0.6000, 0.6000, true, Grid) btnClose = guiCreateButton(.4, .92, .2, .08, "Close", true, wndHelp) guiSetVisible(wndHelp, false) guiSetVisible(wndBlock, false) guiWindowSetSizable(wndHelp, false) guiSetAlpha(wndBlock, 0) addEventHandler("onClientGUIClick", btnClose, function() if source == this then clientToggleHelp(false) end end ) pagesXml = xmlLoadFile("seen.xml") if not pagesXml then pagesXml = xmlCreateFile("seen.xml", "seen") end for i, resourceRoot in ipairs(getElementsByType("resource")) do --!w local resource = getResourceFromName(getElementID(resourceRoot)) if resource then addHelpTabFromXML(resource) end end addCommandHandler(HELP_COMMAND, clientToggleHelp) bindKey(HELP_KEY, "down", clientToggleHelp) end ) addEventHandler("onClientResourceStop", thisResourceRoot, function() showCursor(false) end ) -- exports function showHelp() return clientToggleHelp(true) end addEventHandler("doShowHelp", rootElement, showHelp) function hideHelp() return clientToggleHelp(false) end addEventHandler("doHideHelp", rootElement, hideHelp) function addHelpTab(resource, showPopup) if showPopup == nil then showPopup = true end -- block duplicates if tab[resource] then return false end local tabtext = getResourceName(resource) local helpnode = getResourceConfig(":" .. getResourceName(resource) .. "/help.xml") if helpnode then local nameattribute = xmlNodeGetAttribute(helpnode, "title"); if nameattribute then tabtext = nameattribute; end end tab[resource] = guiCreateGridList( tabtext , tPanel) if showPopup then addHelpPopup(resource) end return tab[resource] end function removeHelpTab(resource) if not tab[resource] then return false end if memo[resource] then destroyElement(memo[resource]) memo[resource] = nil end guiGridListClear(tab[resource], tPanel) tab[resource] = nil return true end addEventHandler("onClientResourceStop", rootElement, removeHelpTab) --private function addHelpTabFromXML(resource) -- block duplicates if tab[resource] then return false end local helpnode = getResourceConfig(":"..getResourceName(resource).."/help.xml") if helpnode then local helptext = xmlNodeGetValue(helpnode) local showPopup = not (xmlNodeGetAttribute(helpnode, "popup") == "no") if helptext then guiGridListAddRow(resource, showPopup) memo[resource] = guiCreateMemo(.01800, .00040, .08080, .09960, helptext, true, tab[resource]) guiMemoSetReadOnly(memo[resource], true) end end end addEventHandler("onClientResourceStart", rootElement, addHelpTabFromXML) function clientToggleHelp(state) if state ~= true and state ~= false then state = not guiGetVisible(wndHelp) end guiSetVisible(wndHelp, state) guiSetVisible(wndBlock, state) if state == true then triggerEvent("onHelpShown", localPlayer) guiBringToFront(wndBlock) guiBringToFront(wndHelp) showCursor(true) else triggerEvent("onHelpHidden", localPlayer) showCursor(false) end return true end local function fadeIn(wnd) local function raiseAlpha() local newAlpha = guiGetAlpha(wnd) + FADE_DELTA if newAlpha <= MAX_ALPHA then guiSetAlpha(wnd, newAlpha) else removeEventHandler("onClientRender", rootElement, raiseAlpha) end end addEventHandler("onClientRender", rootElement, raiseAlpha) end local function fadeOut(wnd) local function lowerAlpha() local newAlpha = guiGetAlpha(wnd) - FADE_DELTA if newAlpha >= 0 then guiSetAlpha(wnd, newAlpha) else removeEventHandler("onClientRender", rootElement, lowerAlpha) destroyElement(wnd) table.remove(popupQueue, 1) if #popupQueue > 0 then showHelpPopup(popupQueue[1]) end end end addEventHandler("onClientRender", rootElement, lowerAlpha) end function addHelpPopup(resource) local xmlContents = xmlNodeGetValue(pagesXml) local seenPages = split(xmlContents, string.byte(',')) local resourceName = getResourceName(resource) for i, page in ipairs(seenPages) do if page == resourceName then return end end xmlNodeSetValue(pagesXml, xmlContents..resourceName..",") xmlSaveFile(pagesXml) table.insert(popupQueue, resource) if #popupQueue == 1 then showHelpPopup(resource) end end function showHelpPopup(resource) local screenX, screenY = guiGetScreenSize() local wndPopup = guiCreateWindow(0, screenY - 20, screenX, 0, '', false) --350 local restitle = getResourceName(resource) local helpnode = getResourceConfig(":" .. getResourceName(resource) .. "/help.xml") if helpnode then local nameattribute = xmlNodeGetAttribute(helpnode, "title"); if nameattribute then restitle = nameattribute; end end local text = "Help page available for ".. restitle .."! ".. "Press "..HELP_KEY.." or type /"..HELP_COMMAND.." to read it." guiSetText(wndPopup, text) guiSetAlpha(wndPopup, 0) guiWindowSetMovable(wndPopup, false) guiWindowSetSizable(wndPopup, false) fadeIn(wndPopup) setTimer(fadeOut, POPUP_TIMEOUT, 1, wndPopup) end It's supposted to look like this : http://imageshack.us/photo/my-images/51 ... 34727.png/ But it looks like this : http://imageshack.us/photo/my-images/70 ... 35320.png/ ignore the admin panel. I did something wrong . Anybody can help ?
-
Yep i solved first problem few secs before your post , but im stuck with second problem . And i used addEventHandler , but still dont work.
-
Errors : -- Access Denied @ 'addAccount' -- Bad argument @ 'logIn' [Expected player at argument 1, got string '123] --Register function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else if (logIn(player, account, password) == true) then triggerClientEvent(player, "hideRegisterWindow", getRootElement()) end end end
-
Bugged on 1.1 Line 72, client.
-
But encoding doesnt change nothing in code, what's the difference then ?
-
Viper you have it all on Wiki , i already gave you a list.
-
Start spawnmanager if you think on that .
-
We would be happy if you post script here .
-
MTA:SA 1.1 Released: Harder, Better, Stronger, Faster
CapY replied to darkdreamingdan's topic in News
Yep that is true... i crashed every 30-40 goddamn secs. -
MTA:SA 1.1 Released: Harder, Better, Stronger, Faster
CapY replied to darkdreamingdan's topic in News
20 crashes in 10 minutes !! I'm gonna freak out . -
I just used that code ( ONLY FROM JAKE ) and no one else. He said wrong , he knows to model too , but ussally he replace textures. Then stop complaining and create your "Holy Complain List " , ofcourse if that's not hard to you .
-
Version = 1.1-release-3086.0.000 Time = Fri Aug 26 23:27:55 2011 Module = D:\Capy\Games\GTA SA\GTA-SanAndreas\gta_sa.exe Code = 0xC0000005 Offset = 0x0013368B EAX=00000000 EBX=00B917CC ECX=0303C590 EDX=00000FA0 ESI=00B917CC EDI=00000057 EBP=0FEFE948 ESP=0022FC60 EIP=0053368B FLG=00010246 CS=001B DS=0023 SS=0023 ES=0023 FS=003B GS=0000
-
Ah temperamental girl who has came on Iron Snake .
-
I got problem in one part of the script When i joins , sound starts to play , but when i press "o " sounds stops , when i press it again , sound doesnt want to start again Here : I tried like this bindKey("o", "down", function () if isElement(song) then stopSound(song) else if isElement(song) then playSound(song) end end ) and like this : bindKey("o", "down", function () if isElement(song) then stopSound(song) else playSound(song) end end ) This is just a part of the code.
-
You are just one lame modeler from DKR , you are happy, because you was find few good scripters to make your server better.
-
Can you read 50p post 10 more times ?
-
MTA:SA 1.1 Released: Harder, Better, Stronger, Faster
CapY replied to darkdreamingdan's topic in News
Yep good idea.