Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. its working thanks a lot dude
  2. Kenix

    Gui help plz

    try this addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() bindKey ( "F5", "down", function( ) if (guiGetVisible(GUIEditor_Window[1]) == false) then setWindow() showCursor(true) elseif (guiGetVisible(GUIEditor_Window[1]) == true) then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) end end) end) function setWindow() GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) guiSetFont(GUIEditor_Label[1],"sa-header") GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) end addEventHandler("onClientGUIClick",getRootElement(), function () if (source == GUIEditor_Button[13]) then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) elseif (source == GUIEditor_Button[2]) then playSound("fail.mp3",false) end end)
  3. script works but for some reason, he entered only one col shape most down I do not understand what the problem is I just really need for a resource, I'll upload it to the community. local savePlaces = {{249, 1230, 14},{249, 1230, 12},{249, 1230, 10}} function onSavePlaceHit( hitElement, matchingDimension ) if (source == savesPlaces) then outputChatBox("enter") end end addEventHandler ( "onColShapeHit", getRootElement(), onSavePlaceHit ) function createsavePlaces( thePlayer, matchingDimension ) for k,i in ipairs( savePlaces ) do local fX3 = savePlaces[k][1] local fY3 = savePlaces[k][2] local radius3 = savePlaces[k][3] savesPlaces = createColCircle ( fX3, fY3, radius3 ) -- create col shape outputChatBox("Col number "..(savePlaces[k][1]).." created !") outputChatBox("Col number "..(savePlaces[k][2]).." created !") outputChatBox("Col number "..(savePlaces[k][3]).." created !") end end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createsavePlaces )
  4. try this? addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() bindKey ( "F2", "down", function( ) if (guiGetVisible(MainWindowLevel) == false) then guiSetVisible(MainWindowLevel,true) startShowingShopLevelMenu() elseif (guiGetVisible(MainWindowLevel) == true) then guiSetVisible(MainWindowLevel,false) showCursor(false) end end) end) No because you create again the gui when you want to show it. Create this gui when the player join, then you will only use guiSetVisible: addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() startShowingShopLevelMenu() bindKey ( "F2", "down", function( ) if (guiGetVisible(MainWindowLevel) == false) then guiSetVisible(MainWindowLevel,true) elseif (guiGetVisible(MainWindowLevel) == true) then guiSetVisible(MainWindowLevel,false) showCursor(false) end end ) end) Ok ? so now the text is saved but I would like to see the text appearing on the button and not when join to the server.
  5. I know it but because the text still does not appear even if I use set/get elementdata and on set/getAcountData it will be realized when it is completed and I am 100% sure that the text does not appear because it is not right if ( skillsID ) then if getElementData(getLocalPlayer(),"SkillBuy") == tonumber(skillsID) then outputChatBox("get element data") local textAddSkill = guiGridListSetItemText(MainGrid,tonumber(skillsID),5,"purchased",false,false) local textAddSkill2 = guiGridListSetItemColor (MainGrid,tonumber(skillsID),5,0,255,0) outputChatBox("text add "..tostring(textAddSkill).." , "..tostring(textAddSkill2)) end end
  6. I'm not sure about this animation for this is not (there may be but I did not see it) most likely it will be implemented in 1.1
  7. https://wiki.multitheftauto.com/wiki/OutputDebugString https://wiki.multitheftauto.com/wiki/GetPlayerPing https://wiki.multitheftauto.com/wiki/GetPlayerIP https://wiki.multitheftauto.com/wiki/AddCommandHandler
  8. try this? addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() bindKey ( "F2", "down", function( ) if (guiGetVisible(MainWindowLevel) == false) then guiSetVisible(MainWindowLevel,true) startShowingShopLevelMenu() elseif (guiGetVisible(MainWindowLevel) == true) then guiSetVisible(MainWindowLevel,false) showCursor(false) end end) end)
  9. Try a new missiontimer recent resources mtasa-resources-r692.zip http://code.google.com/p/mtasa-resources/downloads/list may then not be a problem.
  10. use this create time local defaults = { timeLimit = 300, } local resourceName = getResourceName ( resource ) g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) destroy removeEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) destroyElement(g_MissionTimer,g_TimeLimit) Map meta add time limit: "#time_limit" value="[ 300 ]" /> I have the same standing on the my zombie mode server
  11. it would be possible, I rummaged in gamedata a mod and Hud elements found thin:) yet I do not know what Hud elements skinny, I'll use. I have a thin Hud elements of Shadow of Chernobyl and Call of Pripyat later show screenshots. Edit: It would be very nice if the MTA has supported Custom ids for objects.
  12. I have no line in the script to clean it at the expense of the tables I do not know, I just want to do what you are buying the ability and it is stored in gridList. maybe something I can not do.
  13. Thank you very much, I just started:)
  14. Hi man see when you close it then it disappears from gridList and I want to do after buying it persisted gridList (get/set ElementData) Edit: before (open and buy) after(close and open)
  15. in general when I finish the zombie mod server I will actively make a new project STALKER gamemode. progress: 2% will be done: hud inventory more quests(and bots) more objects more sounds blowout - 100% groupings: freedom debt singles and etc. and etc. screens: if someone wants to help write a Skype or pm - Skype stalker-volk1
  16. is not set Text in gridList
  17. Hello, Thanks for your help for now, but please do not laugh at my script if it looks like nothing working in it... So this is how far I am now. It creates a marker to the center of the map (the farm at 0,0,3), but it doesn't attach vehicles. It just tells me that lines 5 and 6 have errors like: "Bad Argument @ 'getPedOccupiedVehicle'" "Bad Argument @ 'attachElements'" local theMarker = createMarker ( 0, 0, 3, "cylinder", 5, 255, 255, 255, 255 ) function attach ( hitElement ) if (getElementType(hitElement) == "vehicle" ) then local vehicle = getPedOccupiedVehicle ( vehicle ) attachElements ( vehicle, theMarker ) elseif (getElementType(hitElement) == "player" ) then outputChatBox ( "Only vehicles can be attached here" ) end end addEventHandler ( "onMarkerHit", theMarker, attach ) function detach () local attachedElements = getAttachedElements ( source ) detachElements ( vehicle, source ) end addCommandHandler ( "detach", detach ) So, can someone help me? Have I missed something? try this local theMarker = createMarker ( 0, 0, 3, "cylinder", 5, 255, 255, 255, 255 ) function attach ( hitElement ) if (getElementType(hitElement) == "vehicle" ) then local Pvehicle = getPedOccupiedVehicle ( vehicle ) attachElements ( Pvehicle, theMarker ) elseif (getElementType(hitElement) == "player" ) then outputChatBox ( "Only vehicles can be attached here" ) end end addEventHandler ( "onMarkerHit", theMarker, attach ) function detach () local attachedElements = getAttachedElements ( source ) detachElements ( Pvehicle, source ) end addCommandHandler ( "detach", detach )
  18. try instead of 0 put another number setElementData(vcs1, "posZ", z or 0) maybe it will help, I honestly do not know
  19. try to check all elements of date and in general all over outputChatBox local thisResource = getThisResource() local thisResourceRoot = getResourceRootElement(thisResource) function create (cmd,thePlayer) carsh = getElementsByType ( "Carshade" ) for theKey,ca in ipairs(carsh) do x = getElementData(ca, "posX") y = getElementData(ca, "posY") z = getElementData(ca, "posZ") p = getElementData(ca, "pieces") yy = getElementData(ca, "between") outputChatBox("Check Elements: "..tostring(x).." , "..tostring(y).. " , "..tostring(z).." , "..tostring(p).." , "..tostring(yy).." , "..tostring(carsh)) -- Check Elements for i=0,p do y = y + yy vcs1 = createObject(3458, x, y, z) setElementData(vcs1, "posX", x or 0) setElementData(vcs1, "posY", y or 0) setElementData(vcs1, "posZ", z or 0) end end call(getResourceFromName("editor"),"import",thisResource) destroyElement(thisResourceRoot) end addCommandHandler ( "c", create )
  20. Kenix

    Fast Question.

    you want to say that objects are not loaded when you teleported there? or you mean that when a player comes loaded and it appears to the coordinates x = 0, y = 0, z = 0 or I do not understand
  21. I have a new question:) Added: Damn I have not done something when you buy the window closes because it is not clear whether or not I bought a GUI and I have not seen appearing a text in gridList sorry guys, I sometimes stupid ... days were difficult after closing it all disappears(something that was added to the text), I made a script: addEvent("selectSkill",true) addEventHandler( "selectSkill", getRootElement(), function(skillsID) if (tonumber(skillsID)) then guiGridListSetItemText(MainGrid,tonumber(skillsID),5,"purchased",false,false) guiGridListSetItemColor (MainGrid,tonumber(skillsID),5,0,255,0) local datasSk = setElementData(getLocalPlayer(),"SkillBuy",skillsID) outputChatBox("set data skill "..tostring(skillsID).." , "..tostring(datasSk)) outputChatBox("text change "..tonumber(skillsID)) end end ) he says set data skill 0 , false function startShowingShopLevelMenu() showCursor(true) GUIEditor_Window = {} GUIEditor_Grid = {} MainWindowLevel = guiCreateWindow(0.2234,0.0586,0.5969,0.9102,"New Skills Shop",true) MainButton = guiCreateButton(0.1289,0.9418,0.6974,0.0370,"Buy Skill",true,MainWindowLevel) MainGrid = guiCreateGridList(0.0419,0.0354,0.9058,0.8970,true,MainWindowLevel) guiGridListSetSelectionMode(MainGrid,1) guiGridListAddColumn(MainGrid,"ID",0.2) guiGridListAddColumn(MainGrid,"Name",0.2) guiGridListAddColumn(MainGrid,"$",0.2) guiGridListAddColumn(MainGrid,"Level",0.2) guiGridListAddColumn(MainGrid,"Status",0.2) if ( skillsID ) then if getElementData(getLocalPlayer(),"SkillBuy") == tonumber(skillsID) then outputChatBox("get element data") local textAddSkill = guiGridListSetItemText(MainGrid,tonumber(skillsID),5,"purchased",false,false) local textAddSkill2 = guiGridListSetItemColor (MainGrid,tonumber(skillsID),5,0,255,0) outputChatBox("text add "..tostring(textAddSkill).." , "..tostring(textAddSkill2)) end end addEventHandler ("onClientGUIClick", MainButton, onClientPlayerSkillBuy) for i,v in ipairs (skillsLevelsTable) do local row21 = guiGridListAddRow (MainGrid) guiGridListSetItemText (MainGrid, row21, 1, v[1], false, true) guiGridListSetItemText (MainGrid, row21, 2, v[2], false, true) guiGridListSetItemText (MainGrid, row21, 3, v[3], false, true) guiGridListSetItemText (MainGrid, row21, 4, v[4], false, true) guiGridListSetItemText (MainGrid, row21, 5, v[5], false, true) guiGridListSetItemText (MainGrid, row21, 6, v[6], false, true) end end
  22. no change WTF??? i create this for test and this working but text not change local textSkill = "purchased" local textt = guiGridListSetItemText(MainGrid,1,5,textSkill,false,false) outputChatBox("text:"..tostring(textt).." , "..tostring(textSkill)) he say text: true , purchased WTF what the problem?? MainGrid = guiCreateGridList(0.0419,0.0354,0.9058,0.8970,true,MainWindowLevel)
  23. may be this: function setarchievment () local serial = getPlayerSerial(source) local getSerial = executeSQLSelect("archievment", "serial", "serial='"..serial.."'") if ( type( getSerial ) == "table" and #getSerial == 0 ) or not getSerial then executeSQLInsert ( "archievment", "'"..serial.."', 'Undone', 'Undone', 'Undone', 'Undone', 'Undone', 'Undone', 'Undone', 'Undone'" ) setElementData(source, "hunterman", "Undone",true) setElementData(source, "rich", "Undone",true) setElementData(source, "points", "Undone",true) setElementData(source, "wtf", "Undone",true) setElementData(source, "skilled1", "Undone",true) setElementData(source, "skilled2", "Undone,true") setElementData(source, "skilled3", "Undone",true) setElementData(source, "unstopplayer", "Undone",true) outputDebugString("Maked archievment table for"..getPlayerName(source)) else local archievment1 = executeSQLSelect("arch", "hunterman", "serial='"..serial.."'") local archievment2 = executeSQLSelect("arch", "rich", "serial='"..serial.."'") local archievment3 = executeSQLSelect("arch", "points", "serial='"..serial.."'") local archievment4 = executeSQLSelect("arch", "wtf", "serial='"..serial.."'") local archievment5 = executeSQLSelect("arch", "unstopplayer", "serial='"..serial.."'") local archievment6 = executeSQLSelect("arch", "skilled1", "serial='"..serial.."'") local archievment7 = executeSQLSelect("arch", "skilled2", "serial='"..serial.."'") local archievment8 = executeSQLSelect("arch", "skilled3", "serial='"..serial.."'") setElementData(source, "hunterman", tostring(archievment1[1]["hunterman"]),true) setElementData(source, "rich", tostring(archievment2[1]["rich"]),true) setElementData(source, "points", tostring(archievment3[1]["points"]),true) setElementData(source, "wtf", tostring(archievment4[1]["wtf"]),true) setElementData(source, "skilled1", tostring(archievment5[1]["skilled1"]),true) setElementData(source, "skilled2", tostring(archievment6[1]["skilled2"]),true) setElementData(source, "skilled3", tostring(archievment7[1]["skilled3"]),true) setElementData(source, "unstopplayer", tostring(archievment8[1]["unstopplayer"]),true) outputDebugString("Loaded archievment table for"..getPlayerName(source)) end end addEventHandler("onPlayerJoin", getRootElement(), setarchievment)
×
×
  • Create New...