Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. Didn't see any post saying he solved it.
  2. Well, I just transformed, getting the text from the first gui, to the focused one. It worked, still I have no clue what was the problem.
  3. I don't understand why didn't you understand it, you got server manual, introduction to scripting / GUI. You got the functions and events server side and client side. You got every thing you need, you probably just read it fast not carefully. What do you want us to explain, you got every thing in the wiki.
  4. STOP USING CAPS. So what do you expect us to do, teach you? The Wiki is what made most guys here "Scripters". It does make sense, if you understand English, and read it carefully.
  5. Tank, it's a suggestion, replacing weapons isn't supported yet.
  6. The Wiki is all you will need, the Wiki should help you, unless you don't want to read it.
  7. JR10

    markers

    When you hide the first one, show the second one. That's easy.
  8. JR10

    markers

    use guiSetVisible onClientResourceStart? As for the GUI click, 4th argument in addEventHandler, specify it false.
  9. JR10

    markers

    addEventHandler("onClientResourceStart",resourceRoot, function() Window = {} Button1 = {} Window[1] = guiCreateWindow(0.7602,0.2939,0.2219,0.2373,"",true) Button1[1] = guiCreateButton(0.088,0.6379,0.5106,0.2263,"LS",true,Window[1]) showCursor(true) addEventHandler("onClientGUIClick", Button1[1],MarkerHit ) end ) function MarkerHit() -- define MarkerHit function for the handler setElementPosition ( getLocalPlayer(), 1688.6726074219, 1428.3284912109, 30.770175933838 ) guiSetVisible ( Window [ 1 ] , false ) showCursor ( false ) end
  10. JR10

    markers

    Why are you adding it twice, one close, and the other transport. And getElementType without arguments. addEventHandler("onClientResourceStart",resourceRoot, function() Window = {} Button1 = {} Window[1] = guiCreateWindow(0.7602,0.2939,0.2219,0.2373,"",true) Button1[1] = guiCreateButton(0.088,0.6379,0.5106,0.2263,"LS",true,Window[1]) showCursor(true) addEventHandler("onClientGUIClick", Button1[1],MarkerHit ) end ) function MarkerHit() -- define MarkerHit function for the handler setElementPosition ( getLocalPlayer(), 1688.6726074219, 1428.3284912109, 30.770175933838 ) end
  11. This is not a request forum. isObjectInACLGroup, hasObjectPermissionTo, setElementData
  12. Thought you edited it. _guiCreateWindow = guiCreateWindow function guiCreateWindow ( posX, posY, width, height, text, relative ) local element = _guiCreateWindow ( posX, posY, width, height, text, relative ) local tbl = { element=element, posX=posX, posY=posY, width=width, height=height, text=text } return tbl end resourceGui = {} local _t = resourceGui resourceGui = {} local meta = { __index = function ( t,k ) return _t [ k ] end , __newindex = function (t,k,v) if k == "text" then guiSetText ( t.element, v ) end _t[k] = v end } setmetatable(resourceGui, meta) resourceGui.window = guiCreateWindow ( blah ) resourceGui.window.text = "NewTitle" Try that.
  13. It's defined somewhere else, and that's not the problem, I tested it, the variables aren't wrong.
  14. I don't usually post for help but, 3 Hours looking through the code, to figure out this. It used to work, but not any more. local posX , posY , posZ = tonumber ( guiGetText ( cbGUI [ "cbPosxE" ] ) ) , tonumber ( guiGetText ( cbGUI [ "cbPosyE" ] ) ) , tonumber ( guiGetText ( cbGUI [ "cbPoszE" ] ) ) local intdim = guiGetText ( cbGUI [ "cbIntdimE" ] ) intdim = intdim : gsub ( " " , "" ) local interior = tonumber ( gettok ( intdim , 1 , "," ) ) local dimension = tonumber ( gettok ( intdim , 2 , "," ) ) local name = guiGetText ( cbGUI [ "cbNameE" ] ) local cost = tonumber ( guiGetText ( cbGUI [ "cbCostE" ] ) ) local payout = tonumber ( guiGetText ( cbGUI [ "cbPayoutE" ] ) ) local payoutTime = tonumber ( guiGetText ( cbGUI [ "cbPayouttE" ] ) ) local payoutUnit = guiComboBoxGetItemText ( cbGUI [ "cbPayoutuCB" ] , guiComboBoxGetSelected ( cbGUI [ "cbPayoutuCB" ] ) ) triggerServerEvent ( "server:createBusiness" , localPlayer , posX , posY , posZ , interior , dimension , name , cost , payout , payoutTime , payoutUnit ) All returns "", And nil with tonumber, the combo box returns what it should. I made a timer client side on start, to get one of those gui elements text, it worked. But for some weird reason, it doesn't work here.
  15. Well, it's not impossible, but not easy at all, there is resources for recording in the community, but not lag free.
  16. ---------Made by |DGT|Puma-------------- ---------------do not change or touch this---------- Names={} Tags={} Colors={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={"FWC Admin"} local tags ={"%FWC%"} local colors ={#fffafa} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end end addEventHandler("onResourceStart",root,loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",root,moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local name = Names[i] local color = Colors[i] end if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",root,nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",root,join) ------------------------------- ---------Quit--------------------- function quit() setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",root,quit) ------------------------------------
  17. Any errors, warnings?
  18. How about you test it?
  19. Check my job resource or 50p's peds resource. peds: https://community.multitheftauto.com/index.php?p= ... ils&id=234 J-Jobs: https://community.multitheftauto.com/index.php?p= ... ls&id=2484
  20. JR10

    script

    The wiki has all the functions, that exists. With it's arguments, mostly examples. So what is "i don't know how to do that getplayername thing " Ehm, getPlayerName(player) Is it so hard? You won't get nowhere, by Copy+Paste. Can you try doing this yourself? functions you will need: addEventHandler ( "welcome" , function ( player , cmd , playerName ) local target = getPlayerFromName ( playerName ) outputChatBox ( getPlayerName ( target ) )
  21. addEventHandler ( "onClientRender" , root , function() local scX , scY = getScreenFromWorldPosition ( posX , posY , posZ ) dxDrawText ( "Marker" , scX , scY , scX , scY , tocolor ( 255,255,255,255 ) , 2.0 ) end) EDIT: STOP PMing ME, you don't have to.
  22. hitmanMarker = createMarker ( 2303.4782714844, -2019.1921386719, 13.541597366333, "cylinder", 1.5, 205, 0, 0) function hitmanMarkerH( player , mDim ) if not mDim then return end if getElementType ( player ) ~= "player" then return end setPlayerTeam ( player, getTeamFromName ( "Hitmen" ) ) end addEventHandler( "onMarkerHit", hitmanMarker, hitmanMarkerH ) Off: You don't have to PM me.
×
×
  • Create New...