Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. So, like this? ed_msg = guiCreateEdit(89,138,320,38,"",false,rog_ucp_sms) guiSetInputMode("no_binds_when_editing")
  2. This is a great idea. +2
  3. I can't really figure out, how that function works
  4. How can i make it, so that if the player is typeing in the edit, that if they press "T" or "U" it wont go into the chat? So, like it unbinds everything if you're using the edit. ed_msg = guiCreateEdit(89,138,320,38,"",false,rog_ucp_sms)
  5. so, what is added is: if (source == markername) then ?
  6. thanks, but where is the bug?
  7. For some reason, when a player goes into the marker, the GUI is visible for everyone --[[ Author: xXMADEXx File: jobs/server.lua type: Server Copyright 2012 (c) xXMADEXx --]] local mechanic_job_marker_ls = createMarker (2200.19507, -1970.24207, 13.7841, "cylinder", 1.5, 0, 100, 255, 0 ) local mechanic_job_marker_sf = createMarker (-2037.205078125, 174.556640625, 27.8359375, "cylinder", 1.5, 0, 100, 255, 0 ) local mechanic_job_marker_LV = createMarker (1658.5751953125, 2199.5830078125, 9.8203125, "cylinder", 1.5, 0, 100, 255, 0 ) -- GUI -- job = "Mechanic" local resX,resY = guiGetScreenSize() local width,height = 606,372 local X = (resX/2) - (width/2) local Y = (resY/2) - (height/2) mechanic_job_window = guiCreateWindow(X,Y,width,height,"RoG Jobs - ".. job,false) guiWindowSetMovable(mechanic_job_window,false) guiWindowSetSizable(mechanic_job_window,false) guiSetVisible(mechanic_job_window,false) mechanic_job_description = guiCreateMemo(38,46,524,260,"\nAs a mehcanic, you can go around San Andreas, lookign for people who have damaged cars.\nWhen you find someone who needs their car fixed, just simply get into the vehicle and type '/fix' to repair their vehicle. You have to make sure they pay you, using the commands /pay [who] [amount] or /give [who] [amount]",false,mechanic_job_window) guiMemoSetReadOnly(mechanic_job_description,true) mechanic_job_take = guiCreateButton(44,313,261,44,"Accept Job",false,mechanic_job_window) mechanic_job_exit = guiCreateButton(306,313,261,44,"Cancel",false,mechanic_job_window) --close function -- function closeWindow() if (source == mechanic_job_exit) or (source == mechanic_job_take) then guiSetVisible(mechanic_job_window, false) showCursor(false,false) end end addEventHandler("onClientGUIClick", mechanic_job_exit, closeWindow) addEventHandler("onClientGUIClick", mechanic_job_take, closeWindow) -- When you get near ped -- function markerhit() guiSetVisible(mechanic_job_window, true) showCursor(true) end addEventHandler("onClientMarkerHit", mechanic_job_marker_ls, markerhit) addEventHandler("onClientMarkerHit", mechanic_job_marker_sf, markerhit) addEventHandler("onClientMarkerHit", mechanic_job_marker_LV, markerhit) function mechanicTakeJob() triggerServerEvent("mechanicTakesJob",localPlayer) triggerServerEvent("rog:teams:setteam:community",localPlayer) end addEventHandler("onClientGUIClick", mechanic_job_take , mechanicTakeJob, false)
  8. Thanks, lol go figure, always the 'root'
  9. For some reason, when the player triggers the event, it will not set the team client: triggerServerEvent("rog:teams:setteam:community",localPlayer) server -- Teams teamCommunity = createTeam ("Community", 255, 255, 0) --------- Functions --------- -- Community addEvent("rog:teams:setteam:community",true) addEventhandler("rog:teams:setteam:community", function () setPlayerTeam(source,teamCommunity) end )
  10. oh, okey. I figured somthing out, not exacly what i wanted but it works
  11. So, should it look like this? triggerServerEvent ( "onLoadSettings", getRootElement ( ) ) function toboolean ( v ) if v == "false" then return false elseif v == "true" then return true else return nil end end addEvent ( "onClientLoadSettings", true ) addEventHandler ( "onClientLoadSettings", getRootElement ( ), function ( settings ) if type(settings) == "table" then defscale = settings["scale"] defr = settings["r"] defg = settings["g"] defb = settings["b"] defa = settings["a"] defdd = settings["dd"] defscale3d = settings["s3d"] deffont = settings["f"] end end ) local sx, sy = guiGetScreenSize ( ) local gx = sx * 0.1 local gy = sy * 0.1 local posX = 0 local posY = 0 local sizeX = 0 local sizeY = 0 local edit = { } local deftext = { } local win = guiCreateWindow ( 0.0135, 0.315, 0.275, 0.4065, "Create New 3D DirectX Text", true ) edit[1] = guiCreateEdit ( 0.0410, 0.0990, 0.7590, 0.115, "X", true, win ) edit[2] = guiCreateEdit ( 0.0410, 0.2220, 0.7590, 0.115, "Y", true, win ) edit[3] = guiCreateEdit ( 0.0410, 0.3490, 0.7590, 0.115, "Z", true, win ) edit[4] = guiCreateEdit ( 0.0410, 0.475, 0.9130, 0.115, "Text", true, win ) edit[5] = guiCreateEdit ( 0.0410, 0.5930, 0.9130, 0.115, "Scale", true, win ) edit[6] = guiCreateEdit ( 0.0410, 0.715, 0.2045, 0.115, "R", true, win ) edit[7] = guiCreateEdit ( 0.2590, 0.715, 0.2045, 0.115, "G", true, win ) edit[8] = guiCreateEdit ( 0.4820, 0.715, 0.2045, 0.115, "B", true, win ) edit[9] = guiCreateEdit ( 0.7, 0.715, 0.2045, 0.115, "A", true, win ) local create = guiCreateButton ( 0.0410, 0.8395, 0.45, 0.122, "Create!", true, win ) local getPos = guiCreateButton ( 0.8275, 0.0955, 0.1320, 0.300, "Get XYZ", true, win ) local default = guiCreateButton ( 0.5135, 0.8395, 0.2225, 0.125, "Default", true, win ) local clear = guiCreateButton ( 0.75, 0.8395, 0.2090, 0.125, "Clear", true, win ) for i, gui in ipairs ( edit ) do deftext[i] = guiGetText ( gui ) end addEventHandler ( "onClientGUIClick", getPos, function ( ) local x, y, z = getElementPosition ( getLocalPlayer ( ) ) guiSetText ( edit[1], tostring ( x ) ) guiSetText ( edit[2], tostring ( y ) ) guiSetText ( edit[3], tostring ( z ) ) end, false ) addEventHandler ( "onClientGUIClick", clear, function ( ) for i, gui in ipairs ( edit ) do guiSetText ( gui, deftext[i] ) end end, false ) addEventHandler ( "onClientGUIClick", default, function ( ) for i = 1, 3 do if guiGetText ( edit[i] ) == "" or guiGetText ( edit[i] ) == deftext[i] then guiSetText ( edit[i], deftext[i] ) end end guiSetText ( edit[4], "Text" ) guiSetText ( edit[5], "1" ) guiSetText ( edit[6], "0" ) guiSetText ( edit[7], "255" ) guiSetText ( edit[8], "0" ) guiSetText ( edit[9], "255" ) end, false ) addEventHandler ( "onClientGUIClick", create, function ( ) --Check if the values are OK for i = 1, 3 do if tonumber ( guiGetText ( edit[i] ) ) == nil then outputChatBox ( "The 3D Texts need the position and the text to be created!", 255, 0, 0 ) return end end --Create the text local text = createElement ( "text" ) if not text then return end --The required arguments local x = tonumber ( guiGetText ( edit[1] ) ) local y = tonumber ( guiGetText ( edit[2] ) ) local z = tonumber ( guiGetText ( edit[3] ) ) local t = guiGetText ( edit[4] ) setElementPosition ( text, x, y, z ) setElementData ( text, "text", t, true ) --Now the optional ----Color local custom = true for i = 6, 9 do if tonumber ( guiGetText ( edit[i] ) ) == nil then custom = false break end end if custom == true then outputChatBox ( "..." ) local r = tonumber ( guiGetText ( edit[6] ) ) local g = tonumber ( guiGetText ( edit[7] ) ) local b = tonumber ( guiGetText ( edit[8] ) ) local a = tonumber ( guiGetText ( edit[9] ) ) setElementData ( text, "rgba", { r, g, b, a }, true ) end ----Scale local s = tonumber ( guiGetText ( edit[5] ) ) if s ~= nil then setElementData ( text, "scale", s, true ) end outputChatBox ( "3D DirectX Text sucessfully created!", 0, 255, 0 ) return text end, false ) guiSetVisible ( win, false ) showCursor ( false ) guiSetInputEnabled ( false ) guiWindowSetSizable ( win, false ) function dxtextitniga( ) guiSetVisible ( win, not guiGetVisible ( win ) ) showCursor ( not isCursorShowing ( ) ) guiSetInputEnabled ( not guiGetInputEnabled ( ) ) for i = 1, 11 do guiSetText ( edit[i], deftext[i] ) end end ) addCommandHandler("createdx", dxtextitniga) --The 3D Text part addEventHandler ( "onClientRender", getRootElement ( ), function ( ) --if dedfdd ~= nil then local px, py, pz = getElementPosition ( getLocalPlayer ( ) ) for i, t in ipairs ( getElementsByType ( "text" ) ) do local cx, cy, cz = getElementPosition ( t ) local dist = getDistanceBetweenPoints3D ( px, py, pz, cx, cy, cz ) --Check if the distance between player and text drawing distance is same or less if dist <= defdd then local scx, scy = getScreenFromWorldPosition ( cx, cy, cz, -50, true ) local scx2, scy2 = getScreenFromWorldPosition ( cx2, cy2, cz2, -40, true ) if isLineOfSightClear ( px, py, pz, cx, cy, cz, true, false, false, false ) and scx and scy then --The text default parameters local alpha = defa local r = defr local g = defg local b = defb local scale = defscale local scale3d = defscale3d local font = deffont --Custom scale config if getElementData ( t, "scale", false ) then scale = getElementData ( t, "scale", false ) end --Scale 3D config if scale3d == true then scale = scale * ( ( defdd - dist ) / defdd ) end --Loads the text and stops function if there is no text loaded local text = getElementData ( t, "text" ) if not text or text == "" then return end --If the text has custom colors, load them local c = getElementData ( t, "rgba" ) if c and type ( c ) == "table" then r = c[1] g = c[2] b = c[3] alpha = c[4] end --Also the font local f = getElementData ( t, "font" ) if f and type ( f ) == "string" then font = f end --Draw the text dxDrawText ( text, scx, scy, scx, scy, tocolor ( r, g, b, alpha ), scale, font, "center", "center" ) else alpha = 0 end else alpha = 0 end end --end end ) --Exported function function create3DText ( x, y, z, t, c, f, id ) --Check arguments if not x or not y or not z or not t then return false end --Create the text local text = createElement ( "text" ) setElementPosition ( text, x, y, z, false ) setElementData ( text, "text", t, true ) --RGBA Colors if c and type ( c ) == "table" then setElementData ( text, "rgba", { c[1], c[2], c[3], c[4] }, true ) end --Font if f and type ( f ) == "string" then setElementData ( text, "font", f ) end --ID if id and type ( id ) == "string" then setElementID ( text, id ) end --If all was OK, returns the text element return text end function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) dxDrawText ( text, x - 1, y - 1, w - 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black dxDrawText ( text, x + 1, y - 1, w + 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y + 1, w - 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y + 1, w + 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x - 1, y, w - 1, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x + 1, y, w + 1, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y - 1, w, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y + 1, w, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) end
  12. Hey guys, i got this script off of community, but don't like the way it looks. How can i put a black boarder over all the texts? c.lua triggerServerEvent ( "onLoadSettings", getRootElement ( ) ) function toboolean ( v ) if v == "false" then return false elseif v == "true" then return true else return nil end end addEvent ( "onClientLoadSettings", true ) addEventHandler ( "onClientLoadSettings", getRootElement ( ), function ( settings ) if type(settings) == "table" then defscale = settings["scale"] defr = settings["r"] defg = settings["g"] defb = settings["b"] defa = settings["a"] defdd = settings["dd"] defscale3d = settings["s3d"] deffont = settings["f"] end end ) local sx, sy = guiGetScreenSize ( ) local gx = sx * 0.1 local gy = sy * 0.1 local posX = 0 local posY = 0 local sizeX = 0 local sizeY = 0 local edit = { } local deftext = { } local win = guiCreateWindow ( 0.0135, 0.315, 0.275, 0.4065, "Create New 3D DirectX Text", true ) edit[1] = guiCreateEdit ( 0.0410, 0.0990, 0.7590, 0.115, "X", true, win ) edit[2] = guiCreateEdit ( 0.0410, 0.2220, 0.7590, 0.115, "Y", true, win ) edit[3] = guiCreateEdit ( 0.0410, 0.3490, 0.7590, 0.115, "Z", true, win ) edit[4] = guiCreateEdit ( 0.0410, 0.475, 0.9130, 0.115, "Text", true, win ) edit[5] = guiCreateEdit ( 0.0410, 0.5930, 0.9130, 0.115, "Scale", true, win ) edit[6] = guiCreateEdit ( 0.0410, 0.715, 0.2045, 0.115, "R", true, win ) edit[7] = guiCreateEdit ( 0.2590, 0.715, 0.2045, 0.115, "G", true, win ) edit[8] = guiCreateEdit ( 0.4820, 0.715, 0.2045, 0.115, "B", true, win ) edit[9] = guiCreateEdit ( 0.7, 0.715, 0.2045, 0.115, "A", true, win ) local create = guiCreateButton ( 0.0410, 0.8395, 0.45, 0.122, "Create!", true, win ) local getPos = guiCreateButton ( 0.8275, 0.0955, 0.1320, 0.300, "Get XYZ", true, win ) local default = guiCreateButton ( 0.5135, 0.8395, 0.2225, 0.125, "Default", true, win ) local clear = guiCreateButton ( 0.75, 0.8395, 0.2090, 0.125, "Clear", true, win ) for i, gui in ipairs ( edit ) do deftext[i] = guiGetText ( gui ) end addEventHandler ( "onClientGUIClick", getPos, function ( ) local x, y, z = getElementPosition ( getLocalPlayer ( ) ) guiSetText ( edit[1], tostring ( x ) ) guiSetText ( edit[2], tostring ( y ) ) guiSetText ( edit[3], tostring ( z ) ) end, false ) addEventHandler ( "onClientGUIClick", clear, function ( ) for i, gui in ipairs ( edit ) do guiSetText ( gui, deftext[i] ) end end, false ) addEventHandler ( "onClientGUIClick", default, function ( ) for i = 1, 3 do if guiGetText ( edit[i] ) == "" or guiGetText ( edit[i] ) == deftext[i] then guiSetText ( edit[i], deftext[i] ) end end guiSetText ( edit[4], "Text" ) guiSetText ( edit[5], "1" ) guiSetText ( edit[6], "0" ) guiSetText ( edit[7], "255" ) guiSetText ( edit[8], "0" ) guiSetText ( edit[9], "255" ) end, false ) addEventHandler ( "onClientGUIClick", create, function ( ) --Check if the values are OK for i = 1, 3 do if tonumber ( guiGetText ( edit[i] ) ) == nil then outputChatBox ( "The 3D Texts need the position and the text to be created!", 255, 0, 0 ) return end end --Create the text local text = createElement ( "text" ) if not text then return end --The required arguments local x = tonumber ( guiGetText ( edit[1] ) ) local y = tonumber ( guiGetText ( edit[2] ) ) local z = tonumber ( guiGetText ( edit[3] ) ) local t = guiGetText ( edit[4] ) setElementPosition ( text, x, y, z ) setElementData ( text, "text", t, true ) --Now the optional ----Color local custom = true for i = 6, 9 do if tonumber ( guiGetText ( edit[i] ) ) == nil then custom = false break end end if custom == true then outputChatBox ( "..." ) local r = tonumber ( guiGetText ( edit[6] ) ) local g = tonumber ( guiGetText ( edit[7] ) ) local b = tonumber ( guiGetText ( edit[8] ) ) local a = tonumber ( guiGetText ( edit[9] ) ) setElementData ( text, "rgba", { r, g, b, a }, true ) end ----Scale local s = tonumber ( guiGetText ( edit[5] ) ) if s ~= nil then setElementData ( text, "scale", s, true ) end outputChatBox ( "3D DirectX Text sucessfully created!", 0, 255, 0 ) return text end, false ) guiSetVisible ( win, false ) showCursor ( false ) guiSetInputEnabled ( false ) guiWindowSetSizable ( win, false ) function dxtextitniga( ) guiSetVisible ( win, not guiGetVisible ( win ) ) showCursor ( not isCursorShowing ( ) ) guiSetInputEnabled ( not guiGetInputEnabled ( ) ) for i = 1, 11 do guiSetText ( edit[i], deftext[i] ) end end ) addCommandHandler("createdx", dxtextitniga) --The 3D Text part addEventHandler ( "onClientRender", getRootElement ( ), function ( ) --if dedfdd ~= nil then local px, py, pz = getElementPosition ( getLocalPlayer ( ) ) for i, t in ipairs ( getElementsByType ( "text" ) ) do local cx, cy, cz = getElementPosition ( t ) local dist = getDistanceBetweenPoints3D ( px, py, pz, cx, cy, cz ) --Check if the distance between player and text drawing distance is same or less if dist <= defdd then local scx, scy = getScreenFromWorldPosition ( cx, cy, cz, -50, true ) local scx2, scy2 = getScreenFromWorldPosition ( cx2, cy2, cz2, -40, true ) if isLineOfSightClear ( px, py, pz, cx, cy, cz, true, false, false, false ) and scx and scy then --The text default parameters local alpha = defa local r = defr local g = defg local b = defb local scale = defscale local scale3d = defscale3d local font = deffont --Custom scale config if getElementData ( t, "scale", false ) then scale = getElementData ( t, "scale", false ) end --Scale 3D config if scale3d == true then scale = scale * ( ( defdd - dist ) / defdd ) end --Loads the text and stops function if there is no text loaded local text = getElementData ( t, "text" ) if not text or text == "" then return end --If the text has custom colors, load them local c = getElementData ( t, "rgba" ) if c and type ( c ) == "table" then r = c[1] g = c[2] b = c[3] alpha = c[4] end --Also the font local f = getElementData ( t, "font" ) if f and type ( f ) == "string" then font = f end --Draw the text dxDrawText ( text, scx, scy, scx, scy, tocolor ( r, g, b, alpha ), scale, font, "center", "center" ) else alpha = 0 end else alpha = 0 end end --end end ) --Exported function function create3DText ( x, y, z, t, c, f, id ) --Check arguments if not x or not y or not z or not t then return false end --Create the text local text = createElement ( "text" ) setElementPosition ( text, x, y, z, false ) setElementData ( text, "text", t, true ) --RGBA Colors if c and type ( c ) == "table" then setElementData ( text, "rgba", { c[1], c[2], c[3], c[4] }, true ) end --Font if f and type ( f ) == "string" then setElementData ( text, "font", f ) end --ID if id and type ( id ) == "string" then setElementID ( text, id ) end --If all was OK, returns the text element return text end s.lua addEvent ( "onLoadSettings", true ) function toboolean ( v ) if v == "false" then return false elseif v == "true" then return true else return nil end end autoloadtext = toboolean ( get ( getResourceName ( getThisResource ( ) )..".*autoloadtext" ) ) function loadText ( resource ) if not fileExists ( ":" .. getResourceName ( resource ) .."/texts.xml" ) then return end for i, t in ipairs ( xmlNodeGetChildren ( xmlLoadFile ( ":" .. getResourceName ( resource ) .."/texts.xml" ) ) ) do local x = tonumber ( xmlNodeGetAttribute ( t, "posX" ) ) local y = tonumber ( xmlNodeGetAttribute ( t, "posY" ) ) local z = tonumber ( xmlNodeGetAttribute ( t, "posZ" ) ) local tt = xmlNodeGetAttribute ( t, "text" ) if x and y and z and tt then local text = createElement ( "text" ) setElementPosition ( text, tonumber ( x ), tonumber ( y ), tonumber ( z ), false ) setElementData ( text, "text", tt ) local r = tonumber ( xmlNodeGetAttribute ( t, "red" ) ) local g = tonumber ( xmlNodeGetAttribute ( t, "green" ) ) local b = tonumber ( xmlNodeGetAttribute ( t, "blue" ) ) local a = tonumber ( xmlNodeGetAttribute ( t, "alpha" ) ) if r and g and b and a then setElementData ( text, "rgba", { r, g, b, a }, true ) end local s = tonumber ( xmlNodeGetAttribute ( t, "scale" ) ) if s then setElementData ( text, "scale", s, true ) end local f = xmlNodeGetAttribute ( t, "font" ) if f then setElementData ( text, "font", f, true ) end end end end function checkResource ( resource ) if not resource and source then resource = source elseif not resource and not source then return end if resource ~= getThisResource ( ) then loadText ( resource ) elseif autoloadtext then for i, r in ipairs ( getResources ( ) ) do if getResourceState ( r ) == "running" then loadText ( r ) end end end end addEventHandler ( "onResourceStart", getRootElement ( ), loadText ) --Exported function function create3DText ( x, y, z, t, c, f, id ) --Check arguments if not x or not y or not z or not t then return false end --Create the text local text = createElement ( "text" ) setElementPosition ( text, x, y, z, false ) setElementData ( text, "text", t, true ) --RGBA Colors if c and type ( c ) == "table" then setElementData ( text, "rgba", { c[1], c[2], c[3], c[4] }, true ) end --Font if f and type ( f ) == "string" then setElementData ( text, "font", f ) end --ID if id and type ( id ) == "string" then setElementID ( text, id ) end --If all was OK, returns the text element return text end addEventHandler ( "onLoadSettings", getRootElement ( ), function ( ) local rn = getResourceName ( getThisResource ( ) ) settings = { ["scale"] = tonumber ( get ( rn..".*scale" ) ), ["r"] = tonumber ( get ( rn..".*red" ) ), ["g"] = tonumber ( get ( rn..".*green" ) ), ["b"] = tonumber ( get ( rn..".*blue" ) ), ["a"] = tonumber ( get ( rn..".*alpha" ) ), ["dd"] = tonumber ( get ( rn..".*drawDistance" ) ), ["s3d"] = toboolean ( get ( rn..".*scale3D" ) ), ["f"] = get ( rn..".*font" ), } triggerClientEvent ( "onClientLoadSettings", getRootElement ( ), settings ) end )
  13. Okey, i did that. It still dosn't work, this is the result i got: -- Alpha Functions -- -- Dim on hover addEventHandler( "onClientMouseEnter", rog_ucp_main_img_sms, function () setElementAlpha(source,100) end ) addEventHandler( "onClientMouseEnter", rog_ucp_main, function () setElementAlpha(source,100) end ) -- Back when leave addEventHandler("onClientMouseLeave",rog_ucp_main, function () setElementAlpha(source,255) end ) addEventHandler("onClientMouseLeave",rog_ucp_main_img_sms, function () setElementAlpha(source,255) end )
  14. Hey guys, I tried making it, so that when you hover over an image, it adjusts the alpha, and when you're cursor leave the image, i puts the alpha back to 255 -- Alpha Functions -- -- Dim on hover addEventHandler( "onClientMouseEnter", rog_ucp_main_img_sms, function () setElementAlpha(rog_ucp_main_img_sms,100) end ) addEventHandler( "onClientMouseEnter", rog_ucp_main, function () setElementAlpha(rog_ucp_main,100) end ) -- Back when leave addEventHandler("onClientMouseLeave",rog_ucp_main, function () setElementAlpha(rog_ucp_main,255) end ) addEventHandler("onClientMouseLeave",rog_ucp_main_img_sms, function () setElementAlpha(rog_ucp_main_img_sms,255) end )
  15. never mind, i dont know what i did, but i guess i fixed it thank you.
  16. Copy the server side again, you had forgot to put 'root' at addEventHandler. debugscript: sms\s.lua:4 attempt to concatenate global 'msg' (a nil value)
  17. Im pretty sure: getElementData(player) would work.
  18. Thanks, but it didn't work So i wrote the server side: addEventHandler("rog:sms:send", function (player) outputChatBox ( "SMS From: ".. getPlayerName ( source) ..": ".. msg, player, 255, 255, 0 ) end ) addEvent("rog:sms:send",true) and its saying, something is wrong with the even handler.
  19. k, can you help me on the server side, i really dont have a clue what to do with it... This is baicly, what i got. -- Client -- GUI local resX,resY = guiGetScreenSize() local width,height = 422,217 local X = (resX/2) - (width/2) local Y = (resY/2) - (height/2) window = guiCreateWindow(X,Y,width,height,"Send A Message",false) guiWindowSetSizable(window,false) guiSetVisible(window,false) playerList = guiCreateGridList(10,25,403,109,false,window) guiGridListSetSelectionMode(playerList,2) column = guiGridListAddColumn(playerList,"Players",0.9) ed_msg = guiCreateEdit(89,138,320,38,"",false,window) btn_send = guiCreateButton(9,180,180,28,"Send!",false,window) btn_close = guiCreateButton(209,180,201,28,"Cancel",false,window) lbl_msg = guiCreateLabel(21,147,62,25,"Message:",false,window) guiSetProperty(btn_send,"HoverTextColour","ffffff000") guiSetProperty(btn_close,"HoverTextColour","fff000000") guiLabelSetColor(lbl_msg,0,255,0) guiSetFont(lbl_msg,"default-bold-small") guiEditSetMaxLength(ed_msg,80) -- Open GUI bindKey("h", "down", function ( ) guiSetVisible(window, not guiGetVisible ( window )) showCursor(guiGetVisible ( window )) if ( guiGetVisible ( window ) ) then guiGridListClear ( playerList ) if ( column ) then for id, player in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( playerList ) local r, g, b = getPlayerNametagColor ( player ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) guiGridListSetItemColor ( playerList, row, column, r, g, b ) end end end end ) -- Close Button addEventHandler("onClientGUIClick",btn_close, function () if (source == btn_close) then guiSetVisible(window, false) showCursor(false,false) end end ) -- Send function send() local row, col = guiGridListGetSelectedItem ( playerList ) if ( row and col and row ~= -1 and col ~= -1 ) then local who = guiGridListGetItemText ( playerList, row, 1 ) local msg = tostring(guiGetText(ed_msg)) triggerServerEvent("rog:sms:send",localplayer,localplayer) if ( msg == "" ) then ouputChatBox ( "Error: You need to enter a message.",255,0,0 ) else outputChatBox("Message sent to "..who,0,255,255) end end end addEventHandler("onClientGUIClick",btn_send,send,false) -- Server function recive(player) -- LOL -- end addEvent("rog:sms:send",true) addEventHandler("rog:sms:send",recive)
×
×
  • Create New...