-
Posts
570 -
Joined
-
Last visited
-
Days Won
4
Everything posted by #\_oskar_/#
-
اكواد لملف lua --usfull fun executeBrowserJavascript_= executeBrowserJavascript function executeBrowserJavascript (br,te) executeBrowserJavascript_(br,"document.getElementById('Call').innerHTML = '" .. te .. "' ") end ------Browser Created------- addEventHandler("onClientBrowserCreated",resourceRoot,function () loadBrowserURL(source, "http://mta/local/index.html") end) -----gui Create-------- local sW, sH = guiGetScreenSize() window = guiCreateWindow(10, (sH - 186) / 2, 337, 186, "", false) guiSetVisible(window , false) local Name = guiGetBrowser(guiCreateBrowser(4, 23, 323, 34,true,true,false,window)) local Money = guiGetBrowser(guiCreateBrowser(4, 57, 323, 34,true,true,false,window)) ----- Send To HTML <span> function BrowserDocumentReady() executeBrowserJavascript (Name,'Yor Name ' ..getPlayerName (localPlayer)) executeBrowserJavascript (Money,'Yor Money ' ..getPlayerMoney (localPlayer)) end ----- open Window bindKey("F1","down",function ( ) guiSetVisible(window,not guiGetVisible(window)) showCursor(guiGetVisible(window)) --- refresh BrowserDocumentReady() end) كود لملف HTML <span style=" color:green; font-family: Arial, Helvetica, sans-serif;font-size : 15px" id="Call" span/> سويته لك بحيث يكون سهل عليك تفهمه بابسط طريقه
- 1 reply
-
- 1
-
data,_add = { },addEventHandler function SColor(e,r,g,b) if getElementType(e) == 'gui-button' then guiSetProperty(e, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X",r,g,b,255)) end end dxDrawImage_ = dxDrawImage local dxDrawImage = function (...) local a = {...} if isElement( a[1] ) and getElementType( a[1] ) == 'gui-button' and guiGetVisible (a[1]) then data [ a[1] ] = true local posX, posY = guiGetPosition ( a[1] , false ) local width , Height = guiGetSize ( a[1] , false ) dxDrawImage_ (posX , posY, width,Height,a[2], a[3],a[4],a[5], a[6] , a[7]) local r, g, b = getColorFromString("#"..guiGetProperty(a[1], "NormalTextColour")) dxDrawText(guiGetText ( a[1] ) or tostring '',posX, posY, width + posX , Height + posY,SetTextcolor or tocolor(r, g, b,255),1,"default-bold","center","center",false,false,true) guiSetAlpha( a[1] , 0) end if not isElement( a[1] ) then return dxDrawImage_ (...) end end local function Enter() if data [ source ] == true then SColor(source,0 ,255, 0) end end local function Leave() if data [ source ] == true then SColor(source,255, 124,124) end end _add ( "onClientMouseEnter",resourceRoot,Enter) _add ( "onClientGUIMouseUp", resourceRoot,Enter) _add ( "onClientMouseLeave",resourceRoot,Leave) _add ( "onClientGUIMouseDown",resourceRoot,Leave) -----------------\\\\\\\\\\\\\\\\\\\\----------------- event = guiCreateButton(16, 20, 250, 40, "Take", false) guiSetVisible (event, false) addEventHandler ("onClientRender", root, function () dxDrawImage(event ,'img/event.png', 0, 0, 0,tocolor(255, 255, 255, 255), true) -- attach to Button -- dxDrawImage(160, 200, 250, 40 ,'img/event.png', 0, 0, 0,tocolor(255, 255, 255, 255), true) -- dx Image end) bindKey( "k", "down",function( ) guiSetVisible( event , not guiGetVisible( event )) showCursor( guiGetVisible( event )) end ) try this
-
the code is a server, not a client
-
-- مود الايدي الي اسوي منه export local optimize = true -- Should the script be optimized? (if optimized, cannot be used client-side) local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i,not optimize) break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() for k, v in ipairs(getElementsByType("player")) do local id = getElementData(v,"id") if id then ids[id] = v end end end addEventHandler("onResourceStart",resourceRoot,startup) function getPlayerID(player) for k, v in ipairs(ids) do if v == player then return k end end end function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerByID(id) local player = ids[id] return player or false end -- ابيه يجيب ايدي اللاعب -- Client function mid ( player, commandName ) outputChatBox("Your ID IS"..getPlayerID(player), player, 0, 154, 255) end addCommandHandler ( "myid", mid )
-
function WalkingByAcl(ThePlayer,style,group) if isObjectInACLGroup("user."..getAccountName ( getPlayerAccount(ThePlayer)), aclGetGroup(group or "Admin")) then setPedWalkingStyle(ThePlayer,style or 0) end end ------------------ addEventHandler("onPlayerLogin",root,function () WalkingByAcl(source,69,'Admin') end) local function startedResource() for key,ThePlayer in ipairs(getElementsByType("player")) do WalkingByAcl(ThePlayer,69,'Admin') end end addEventHandler("onResourceStart",resourceRoot,startedResource)
-
function changeWalkStyle(ThePlayer, command) if isObjectInACLGroup("user."..getAccountName ( getPlayerAccount(ThePlayer)), aclGetGroup("Admin")) then setPedWalkingStyle(ThePlayer,69) end end addCommandHandler("WalkingStyle", changeWalkStyle)
-
This is the error replace it if isMouseInPosition(sx*.41, sy*.25, sx*.10, sy*.06) then
-
You mean like that? function AttachDxToGuiElement( GUIElement , img ) if ( guiGetVisible ( GUIElement ) ) then local x, y = guiGetPosition ( GUIElement , false ) local width , Height = guiGetSize ( GUIElement , false ) dxDrawImage(x, y, width , Height ,img, 0, 0, 0,SetImagecolor or tocolor(255, 0, 0, 255), true) dxDrawText(guiGetText ( GUIElement ) or tostring '',x, y, width + x , Height + y,SetTextcolor or tocolor(55,55,55,255),1,"default-bold","center","center",false,false,true) guiBringToFront ( GUIElement ) guiSetAlpha ( GUIElement , 0) end end ------------------ event = guiCreateButton(16, 20, 250, 40, "Take", false) addEventHandler ("onClientRender", root, function () AttachDxToGuiElement( event ,'img/event.png' ) end) bindKey( "k", "down",function( ) guiSetVisible( event , not guiGetVisible( event )) showCursor( guiGetVisible( event )) end )
-
What do you want to do
-
If you want to attach in the object dxCreateRenderTarget dxSetRenderTarget dxCreateShader dxSetShaderValue engineApplyShaderToWorldTexture or you mean this? DxDrawTextOnElement
-
You have to add it with the window open this is an example ?????? window = guiCreateWindow(0.33, 0.35, 0.34, 0.31, "Test", true) VEHICLE_SETTINGS = false bindKey( "x", "down", function() if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then guiSetVisible( window, true) showCursor( true ) VEHICLE_SETTINGS = true else guiSetVisible( window,false) showCursor( false ) VEHICLE_SETTINGS = false end end)
-
He is working VEHICLE_SETTINGS = false bindKey( "x", "down", function() if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end)
-
if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then
-
VEHICLE_SETTINGS = false addCommandHandler("steer", function() if VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end) bindKey( "x", "down", "steer" ) or VEHICLE_SETTINGS = false bindKey( "x", "down", function() if VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end)
-
playerMarker = {} function handlePlayerMarker(hitElement) if getElementType(hitElement) == "player" then if isElement(playerMarker[hitElement]) then destroyElement(playerMarker[hitElement]) end end end
-
I don't understand what do you want to do?
-
what do you want to do ? Because I see that all the proposed codes are working and there are no problems
-
Do not photograph codes and put them in a picture
-
you must use this to calculate the distance getDistanceBetweenPoints3D