Jump to content

kamani

Members
  • Posts

    47
  • Joined

  • Last visited

About kamani

  • Birthday 14/11/1992

Details

  • Location
    Vilnius

kamani's Achievements

Rat

Rat (9/54)

0

Reputation

  1. hi, i have some problem .. i update function of mysql where playername is... , but mysql update function for all players of server. script: SERVER-SIDE addEvent("blabla", true) addEventHandler("blabla", getRootElement(), function() local Save = "UPDATE players SET Function='1' WHERE username='" .. getPlayerName (source) .."'" mysql_query(sqllogin, Save) end) this function run when i click button of GUI.. this function update Function to 1 by playername, but don't work.. now when i click button of my gui window, this function update Function to 1 for all online players..
  2. i set in server-side this: addEvent("Text", true) addEventHandler("Text", getRootElement(), function() outputChatBox( " Text for only one player ", thePlayer ) outputChatBox( " Text for all players ") end) and now when i click button "Text for only one player" and text "Text for all players" show for all players.. whats wrong?
  3. Hey everyone my problem with text showing for all players of server.. i want set outputchat text to see for one player! this is script: SERVER addEvent("Text", true) addEventHandler("Text", getRootElement(), function() triggerClientEvent("SetText",getRootElement(),"blablabla") end) CLIENT addEvent("SetText",true) addEventHandler("SetText", getRootElement(), function(source) outputChatBox("Text for player!",source) end) "Text for player" see all players, i want this text set for player when he click button from gui panel..
  4. gate (ty. object ) is in MAP file.
  5. I download keypad resource and changed for me, i want to make moved object to see for all players.. CLIENT local Nuovada2 = createMarker( -1619.0522460938, 687.70208740234, 6.1344275474548, 'cylinder', 0.5, 71, 216, 0, source) function createKeypad() local sWidth, sHeight = guiGetScreenSize() local Width,Height = 142,276 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) keypadWindow = guiCreateWindow(X,Y,Width,Height,"Kalejimo Sistema",false) addEventHandler("onClientGUIClick",keypadWindow,processKeypadClicks,true) guiWindowSetSizable(keypadWindow,false) keypadButton1 = guiCreateButton(13,68,37,36,"1",false,keypadWindow) keypadButton2 = guiCreateButton(53,68,37,36,"2",false,keypadWindow) keypadButton3 = guiCreateButton(93,68,37,36,"3",false,keypadWindow) keypadButton4 = guiCreateButton(13,108,37,36,"4",false,keypadWindow) keypadButton5 = guiCreateButton(53,108,37,36,"5",false,keypadWindow) keypadButton6 = guiCreateButton(93,108,37,36,"6",false,keypadWindow) keypadButton7 = guiCreateButton(13,148,37,36,"7",false,keypadWindow) keypadButton8 = guiCreateButton(53,148,37,36,"8",false,keypadWindow) keypadButton9 = guiCreateButton(93,148,37,36,"9",false,keypadWindow) keypadButtonAsterix = guiCreateButton(13,188,37,36,"*",false,keypadWindow) keypadButton0 = guiCreateButton(53,188,37,36,"0",false,keypadWindow) keypadButtonHash = guiCreateButton(93,188,37,36,"#",false,keypadWindow) keypadButtonExit = guiCreateButton(13,235,37,36,"Iseiti",false,keypadWindow) keypadButtonEnter = guiCreateButton(53,235,37,36,"Ivesti",false,keypadWindow) keypadButtonClear = guiCreateButton(93,235,37,36,"Isvalyti",false,keypadWindow) keypadGridlistDisplay = guiCreateGridList(13,25,117,33,false,keypadWindow) guiGridListSetSelectionMode(keypadGridlistDisplay,2) guiSetAlpha(keypadGridlistDisplay,0.6) keypadLabelDisplay = guiCreateLabel(14,26,115,30,"Spauskite Isvalyti.",false,keypadWindow) guiLabelSetColor(keypadLabelDisplay,255,000,000) guiLabelSetVerticalAlign(keypadLabelDisplay,"center") guiLabelSetHorizontalAlign(keypadLabelDisplay,"center",false) guiSetVisible(keypadWindow,false) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),createKeypad) function updateDisplay(text) if text then if tonumber(text) or text == "*" or text == "#" then guiSetText(keypadLabelDisplay,guiGetText(keypadLabelDisplay) .. text) else guiSetText(keypadLabelDisplay,text) end else guiSetText(keypadLabelDisplay,"") end end function processKeypadClicks(button,state) if button == "left" and state == "up" then if getElementType(source) == "gui-button" then triggerEvent("onKeypadButtonClicked",source,getElementData(keypadWindow,"keypadID")) end end end addEvent("onKeypadButtonClicked",false) addEventHandler("onKeypadButtonClicked",root, function(keypadID) if guiGetText(keypadLabelDisplay) == "Iveskite koda." or guiGetText(keypadLabelDisplay) == "Kodas netinka." then updateDisplay() end if guiGetText(source) == "Isvalyti" then updateDisplay() elseif guiGetText(source) == "Ivesti" then local code = guiGetText(keypadLabelDisplay) if code then triggerServerEvent("verifyKeypadCode",getLocalPlayer(),code,keypadID) end elseif guiGetText(source) == "Iseiti" then guiSetVisible(keypadWindow,false) updateDisplay("Iveskite koda.") showCursor(false,false) else updateDisplay(guiGetText(source)) end end ) addEvent("onKeypadVerificationSuccessful",true) addEventHandler("onKeypadVerificationSuccessful",root, function() guiSetVisible(keypadWindow,false) updateDisplay("Iveskite koda.") showCursor(false,false) triggerServerEvent("Patikrinti",getLocalPlayer(),keypadID) end ) addEvent("onKeypadVerificationFailed",true) addEventHandler("onKeypadVerificationFailed",root, function() updateDisplay("Kodas netinka.") end ) addEventHandler ( "onClientMarkerHit", Nuovada2,function(hitPlayer, matchingDimension) if hitPlayer == getLocalPlayer() then guiSetVisible(keypadWindow,true) showCursor(true,true) setElementData(keypadWindow,"keypadID","GateKeypadCode",source) end end) SERVER local keypadCodes = { ["GateKeypadCode"] = "1234" } addEvent("verifyKeypadCode",true) addEventHandler("verifyKeypadCode",root,function(code,keypadID) if code then if code == keypadCodes[keypadID] then triggerClientEvent(client,"onKeypadVerificationSuccessful",client,keypadID) else triggerClientEvent(client,"onKeypadVerificationFailed",client,keypadID) end end end) addEvent("Patikrinti",true) addEventHandler("Patikrinti",root, function(keypadID) local gate = getElementByID(keypadID) if gate then local x = tonumber(getElementData(gate,"newPosX")) local y = tonumber(getElementData(gate,"newPosY")) local z = tonumber(getElementData(gate,"newPosZ")) moveObject(gate,1500,x,y,z) x = tonumber(getElementData(gate,"posX")) y = tonumber(getElementData(gate,"posY")) z = tonumber(getElementData(gate,"posZ")) setTimer(moveObject,5000,1,gate,1500,x,y,z) end end)
  6. i have this in server.lua: addEvent("ser",true) addEventHandler("ser",root, function(keypadID) local gate = getElementByID(keypadID) if gate then local x = tonumber(getElementData(gate,"newPosX")) local y = tonumber(getElementData(gate,"newPosY")) local z = tonumber(getElementData(gate,"newPosZ")) moveObject(gate,1500,x,y,z) x = tonumber(getElementData(gate,"posX")) y = tonumber(getElementData(gate,"posY")) z = tonumber(getElementData(gate,"posZ")) setTimer(moveObject,5000,1,gate,1500,x,y,z) end end ) and in my console get Bad argument @ 'getElementsByType' , how get me object by id ?
  7. Hey, i have object , i make script when i go to in checkpoint. object moved, but moved object see only one player (hitplayer). One question, how make the moved object to seen the other players ( for all players )...
  8. Okey, this is full script... SERVER: Job1 = false Job2 = createMarker( -1985.6575927734, 476.59652709961, 34.021896362305, 'cylinder', 1.5, 0, 255, 0, 128) function HitOnJob2(hitElement, matchingDimension) if getElementType(hitElement) == "player" then triggerClientEvent ( hitElement, "OpenJob2Gui", getRootElement()) end end addEventHandler( "onMarkerHit",Job2 ,HitOnJob2 ) addEvent("CreateJob1CP", true) addEventHandler("CreateJob1CP", getRootElement(), function() Job1 = createMarker( -1979.3596191406, 483.17581176758, 34.100391387939, 'cylinder',0.8, 0, 255, 0, 128) end) function HitOnJob1(hitElement, matchingDimension) if getElementType(hitElement) == "player" then triggerClientEvent ( hitElement, "OpenJob1Gui", getRootElement()) end end addEventHandler( "onMarkerHit", Job1 ,HitOnJob1 ) CLIENT: function Job2Gui() j2window = guiCreateWindow(386,330,519,363,"JOB SYSTEM",false) Tabfield = guiCreateTabPanel(37,58,442,213,false,j2window) field1 = guiCreateTab("Informacija",Tabfield) TabText1 = guiCreateLabel(0,3,442,179,"INFORMATION",false,field1) guiLabelSetColor(TabText1,255,255,255) guiLabelSetVerticalAlign(TabText1,"top") guiLabelSetHorizontalAlign(TabText1,"left",false) field2 = guiCreateTab("Workers",Tabfield) TabText2 = guiCreateLabel(1,4,440,175,"TEXT ABOUT WORKERS",false,field2) guiLabelSetColor(TabText2,255,255,255) guiLabelSetVerticalAlign(TabText2,"top") guiLabelSetHorizontalAlign(TabText2,"left",false) field3 = guiCreateTab("WARNING",Tabfield) TabText3 = guiCreateLabel(0,7,442,175,"INFORMATION",false,field3) guiLabelSetColor(TabText3,255,255,255) guiLabelSetVerticalAlign(TabText3,"top") guiLabelSetHorizontalAlign(TabText3,"left",false) Text = guiCreateLabel(39,274,310,33,"u want work? click work!",false,j2window) guiLabelSetColor(Text ,255,255,255) guiLabelSetVerticalAlign(Text ,"top") guiLabelSetHorizontalAlign(Text ,"left",false) WorkButton = guiCreateButton(44,318,121,29,"Work",false,j2window) CloseButton = guiCreateButton(196,319,121,27,"Close",false,j2window) addEventHandler("onClientGUIClick",CloseButton,close,false) addEventHandler("onClientGUIClick",WorkButton,work,false) end function work(source) if (getPlayerMoney(source)<=300) then outputChatBox("u don't have 300$",source,255) else guiSetVisible(j2window,false) outputChatBox("okey man,go to checkpoint to start work!", source) showCursor(false) triggerServerEvent("CreateJob1CP",source) end end addEvent ("OpenJob2Gui", true) addEventHandler( "OpenJob2Gui", getRootElement(), function() j2window() guiSetVisible(j2window, true) showCursor(true) end) addEvent ("OpenJob1Gui", true) addEventHandler( "OpenJob1Gui", getRootElement(), function() j2window() guiSetVisible(j2window, true) showCursor(true) end) i want create, when i go in job1 marker, show for me job2gui GUI. when i been in job2 marker, gui show and when i click work button marker job1 created, but i when i go in job1 marker, job2gui GUI don't show for me.
  9. Don't show gui, when i go on marker Job1
  10. ok, very thanks SOLVED!
×
×
  • Create New...