Jump to content

Search the Community

Showing results for tags 'Lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. السلام عليكم ورحمة الله وبركاته بسم الله الرحمن الرحيم سآتي لكم بطريقة تشغيل ملفات لوا داخل برنامج النوت باد باختصار لوحة مفاتيح الطريقة لاتعمل على المودات ابدا الطريقة هي عن طريق تشغيل باتش من برمجتي داخل البرنامج عند ضغط اختصار أولا تحميل الباتش rlua.bat قم بتحميل الباتش ولا تنسى ان تحتفظ بمساره ثانيا التأكد ان امر لوا مفعل داخل الكوماند قم بكتابة هذا الامر في الكوماند lua -v اذا ظهرت رسالة هكذا Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio اذا ظهرت رسالة مختلفة قم بتحميل لوا عن طريق الرابط التالي Lua5.1.5.zip الآن بعد التحميل نستخرج الملفات نضعها بمكان ما مع الاحتفاظ بالمسار ولكن هنا خطوة مهمة يجب اعادة تسمية lua5.1.exe lua5.1.dll الى lua.exe lua.dll سيصبح كما في الصورة داخل الكوماند lua الآن تعريف متغير نقوم بالذهاب الى خصائص الكمبيوتر advanced system settingsومن ثم Environment Variables ومن ثم كما في الصورة Edit ثم نضغط Path ستأتي لنا نافذة ثم نحدد سيأتي كما في الصورة نقوم باضافة الى النص عند رقم 2 بالصورة فاصلة منقوطة ومسار لوا يصبح هكذا ;C:\lua5.1 مساري هو الى ان تنغلق كافة النوافذ ok الآن نضغط نجرب الامر في الكوماند lua -v كما في السابق ان ظهرت نفس الرسالة السابقة التي تخص نسخة لوا اذا ظهر عكس ذلك فهناك مشاكل في التنزيل ++الآن نقوم بفتح النوت باد Run... ثم Run ثم نذهب لقائمة F5 او اضغط الآن تظهر لك نافذة هكذا ... نقوم بضعط الزر ستأتي لك نافذة تحديد مسار ثم نحدد مسار الباتش المحمل مسبقا ومن ثم مسافة ونكتب "$(FULL_CURRENT_PATH)" ليصبج هكذا "C:\rlua.bat" "$(FULL_CURRENT_PATH)" Save...ومن ثم نقوم بضغط ثم نقوم بتحديد المعطيات كما في الصورة ونحفظ التغيرات اتبع الخطوات بالارقام ثم سيكون لديك الاختصار جاهز هكذا الان اضغط ازرار الاختصار الذي قمت بتحديده وسيعمل كما في الصورة 32bit : Lua5.1.5.zip 64bit : Lua5.1.5.zip وانتهى الشرح بفضل الله تعالى أتمنى استفدتم من هذا الشرح ويكون كافيا والسلام عليكم ورحمة الله وبركاته
  2. --[[ -- Resource Name: Information. -- Author: Om (RipeMangoes69) -- Date: 4/12/2016 -- File: client.lua ]]-- -- GUI GUIEditor = { window = {}, label = {}, memo = {} } function createInfoObjects() local markers = { {area = "Los Santos Airport", x = 1582.45, y = -2286.32, z = 12}, {area = "Las Vegas Airport", x = 1674.30859375, y = 1444.9501953125, z = 9.2} } for _, m in ipairs(markers) do local marker = createMarker(m.x, m.y, m.z, "cylinder", 1, 255, 255, 255, 100) GUIEditor.window[1] = guiCreateWindow(645, 250, 266, 378, "Information: " .. m.area, false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(5, 353, 190, 15, "* Click anywhere on GUI Window to close it.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-small") GUIEditor.memo[1] = guiCreateMemo(9, 24, 247, 324, "", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) end end addEventHandler("onClientResourceStart", getRootElement(), createInfoObjects) function openGUI( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then if isPedInVehicle(hitElement) then outputChatBox("You cannot access GUI from vehicle!", 255, 0, 0) guiSetVisible(GUIEditor.window[1], false) showCursor(false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end end addEventHandler("onClientMarkerHit", resourceRoot, openGUI) function closeGUI() guiSetVisible(GUIEditor.window[1], false) showCursor(false) end addEventHandler("onClientGUIClick", resourceRoot, closeGUI) How am i suppose to "change" the GUI Title ? (area in the table). thanks.
  3. -- client -- local szavon = false local ido = 30 local valasz = 0 GUIEditor_Window = {} GUIEditor_Label = {} function szAblak(ker,v1,v2) if not szavon then local v_1 = v1 local v_2 = v2 local szavon = true local sw,sh = guiGetScreenSize() GUIEditor_Window[1] = guiCreateWindow(sw/1.48,sh/1.4,sw/3.2,sh/3.6,"Szavazás",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(0.0474,0.1242,0.9161,0.2919,ker,true,GUIEditor_Window[1]) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(0.0657,0.4783,0.8759,0.1553,"1.) "..v_1,true,GUIEditor_Window[1]) --guiLabelSetColor(GUIEditor_Label[2],255,200,200) --guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(0.0657,0.6335,0.8759,0.1491,"2.) "..v_2,true,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(0.0474,0.8075,0.8,0.1,ido,true,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],150,150,255) guiSetFont(GUIEditor_Label[4],"clear-normal") bindKey ("1", "down", function() guiSetFont(GUIEditor_Label[3],"clear-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) valasz = 1 guiLabelSetColor(GUIEditor_Label[2],255,200,200) guiSetFont(GUIEditor_Label[2],"default-bold-small") end) bindKey ("2", "down", function() guiSetFont(GUIEditor_Label[2],"default-normal") guiLabelSetColor(GUIEditor_Label[2],255,255,255) valasz = 2 guiLabelSetColor(GUIEditor_Label[3],255,200,200) guiSetFont(GUIEditor_Label[3],"default-bold-small") end) lejar = setTimer( function() ido = ido-1 guiSetText(GUIEditor_Label[4], ido ) if ido == 0 then szVeg() --killTimer(lejar) end end, 1000,30) end end function szVeg() if isTimer(lejar) then killTimer(lejar) end szavon = false guiSetText(GUIEditor_Label[4], "szavazatok számlálása..." ) guiSetFont(GUIEditor_Label[2],"default-normal") guiSetFont(GUIEditor_Label[3],"default-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetColor(GUIEditor_Label[2],255,255,255) --("valasz: "..valasz) triggerServerEvent("submit",getLocalPlayer(),valasz) unbindKey ("1", "down", function() guiSetFont(GUIEditor_Label[3],"clear-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) valasz = 1 guiLabelSetColor(GUIEditor_Label[2],255,200,200) guiSetFont(GUIEditor_Label[2],"default-bold-small") end) unbindKey ("2", "down", function() guiSetFont(GUIEditor_Label[2],"default-normal") guiLabelSetColor(GUIEditor_Label[2],255,255,255) valasz = 2 guiLabelSetColor(GUIEditor_Label[3],255,200,200) guiSetFont(GUIEditor_Label[3],"default-bold-small") end) end addEvent("szvzas",true) addEventHandler("szvzas",getRootElement(), function(question,answ1,answ2) szAblak(question,answ1,answ2) end) addEvent("valaszok",true) addEventHandler("valaszok",getRootElement(), function(v1,v2) guiSetText(GUIEditor_Label[4], "_@/\"" ) guiSetText(GUIEditor_Label[2], guiGetText(GUIEditor_Label[2]) .. " - " .. v1 ) guiSetText(GUIEditor_Label[3], guiGetText(GUIEditor_Label[3]) .. " - " .. v2 ) if v1 > v2 then guiSetFont(GUIEditor_Label[2],"default-bold-small") elseif v1 < v2 then guiSetFont(GUIEditor_Label[3],"default-bold-small") end setTimer( function() destroyElement(GUIEditor_Window[1]) szavon = false ido = 30 valasz = 0 end, 5000, 1) end) -- server -- function submit() bindKey ("1", "down", function() valasz = 1 end) bindKey ("2", "down", function() valasz = 2 end) end addEvent( "submit", true ) addEventHandler( "submit", root, submit ) function szvzas(question,answ1,answ2) local question = "" local answ1 = "" local answ2 = "" triggerClientEvent ( root, "szvzas", root, text) end addCommandHandler ( "k", szvzas, question, answ1, answ2 ) function valaszok(v1,v2) triggerClientEvent(root, "valaszok", root, v1, v2) bindKey(player, "1", "down", v1) bindKey(player, "2", "down", v2) end The window appear when i type '/k', but i want question, answer1, answer2 in this command (/k Question? Answ1 Answ2 example). But doesn't working.. Sorry, me very noob. And, error: server.lua:20: attempt to concatenate local 'v_1' (a nil value). Why?
  4. -- client -- function boom ( ) local pX, pY, pZ = getElementPosition ( getLocalPlayer() ) createExplosion ( pX+3, pY+3, pZ, 2 ) createExplosion ( pX-3, pY-3, pZ, 2 ) createExplosion ( pX+5, pY-2, pZ, 2 ) createExplosion ( pX-4, pY+4, pZ, 2 ) end addEvent( "rob", true ) addEventHandler( "rob", root, boom ) -- server -- function robbant(p,s) if hasObjectPermissionTo(p,"command.rob") then triggerClientEvent(getRootElement(),"rob",getRootElement()) end end addCommandHandler("rob",robbant) When i type 'rob', explode everyone.. Why? How to fix this?
  5. -- client -- local w, h = guiGetScreenSize () local destroyTime local asd = 0.138 local target local localPlayer = getLocalPlayer () local allowed = true addEvent ( "allowIt", true ) addEventHandler ( "allowIt", root, function ( element ) allowed = true end ) addEventHandler ( "onClientPlayerWeaponFire", localPlayer, function ( weapon, _, _, _, _, _, element ) if not element or not allowed then return end if weapon == 23 then target = element if not destroyTime then addEventHandler ( "onClientRender", root, drawProgress ) end destroyTime = getTickCount () end end ) function drawProgress () if not getPedTarget ( localPlayer ) then destroyTime = nil target = nil removeEventHandler ( "onClientRender", root, drawProgress ) end local prog = getTickCount () - ( destroyTime or getTickCount () ) if prog > 1000 then triggerServerEvent ( "destroyIt", localPlayer, target ) destroyTime = nil target = nil removeEventHandler ( "onClientRender", root, drawProgress ) end local w2, h2 = math.floor ( w/2 ), math.floor ( h/2 ) dxDrawLine ( w2 - 72, h2 - 6, w2 - 72, h2 + 6 ) dxDrawLine ( w2 + 72, h2 - 6, w2 + 72, h2 + 6 ) dxDrawRectangle ( w2 - 69, h2 - 6, prog * asd, 12 ) end -- server -- function destroyIt (target) destroyElement(source, target) end addEvent( "destroyIt", true ) addEventHandler( "destroyIt", root, destroyIt ) no warnings / errors...
  6. function boom ( ) local pX, pY, pZ = getElementPosition ( source ) createExplosion ( pX, pY, pZ, 2 ) end addCommandHandler( "rob", boom, getLocalPlayer() ) bad argument @ 'addCommandHandler' [Expected bool at argument 3, got player]
  7. Here is a screenshot of the error message (console) here are the lines that cause problem: not sure what's wrong, I didn't write the code, and sadly I have no clue how to fix it..
  8. Hi! I just searched for lighting effects, and i found a shader for XNA. Its an Ambient and Diffuse lighting shader with Shadow Maps: #define GENERATE_NORMALS #include "mta-helper.fx" //------------------------------------------------------------------------------ // File: BasicRender.fx // // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Global variables //------------------------------------------------------------------------------ float4 g_MaterialAmbientColor = {0.05f, 0.05f, 0.05f, 0.05f}; // Material's ambient color float4 g_MaterialDiffuseColor = {0.75f, 0.75f, 0.75f, 0.75f}; // Material's diffuse color float3 g_LightPos = {1000, 2000, 1000}; // Position of light float3 g_LightDir = {0, 0, 0}; // Direction of light (temp) float4x4 g_mLightView; // View matrix of light float4x4 g_mLightProj; // Projection matrix of light float4 g_LightDiffuse = {0.75f, 0.75f, 0.75f, 0.75f}; // Light's diffuse color float4 g_LightAmbient = {0.05f, 0.05f, 0.05f, 0.05f}; // Light's ambient color texture g_MeshTexture; // Color texture for mesh texture g_ShadowMapTexture; // Shadow map texture for lighting float4x4 g_mWorld; // World matrix for object float3 g_CameraPos; // Camera position for scene View float4x4 g_mCameraView; // Camera's view matrix float4x4 g_mCameraProj; // Projection matrix //------------------------------------------------------------------------------ // Texture samplers //------------------------------------------------------------------------------ sampler MeshTextureSampler = sampler_state { Texture = (gTexture0); MipFilter = LINEAR; MinFilter = LINEAR; MagFilter = LINEAR; }; sampler ShadowMapSampler = sampler_state { Texture = <g_ShadowMapTexture>; MinFilter = POINT; MagFilter = POINT; MipFilter = POINT; AddressU = Clamp; AddressV = Clamp; }; //------------------------------------------------------------------------------ // Vertex shader output structure //------------------------------------------------------------------------------ struct VS_OUTPUT { float4 Position : POSITION0; // vertex position float2 TextureUV : TEXCOORD0; // vertex texture coords float3 vNormal : TEXCOORD1; float4 vPos : TEXCOORD2; }; struct PS_INPUT { float2 TextureUV : TEXCOORD0; // vertex texture coords float3 vNormal : TEXCOORD1; float4 vPos : TEXCOORD2; }; struct VS_SHADOW_OUTPUT { float4 Position : POSITION; float Depth : TEXCOORD0; }; //------------------------------------------------------------------------------ // Utility function(s) //------------------------------------------------------------------------------ float4x4 CreateLookAt(float3 gView, float3 gProjection, float3 up) { float3 zaxis = normalize(gView - gProjection); float3 xaxis = normalize(cross(up, zaxis)); float3 yaxis = cross(zaxis, xaxis); float4x4 view = { xaxis.x, yaxis.x, zaxis.x, 0, xaxis.y, yaxis.y, zaxis.y, 0, xaxis.z, yaxis.z, zaxis.z, 0, -dot(xaxis, gView), -dot(yaxis, gView), -dot(zaxis, gView), 1 }; return view; } float4 GetPositionFromLight(float4 position) { float4x4 WorldViewProjection = mul(mul(gWorld, gLightDiffuse), gLightDirection); return mul(position, WorldViewProjection); } //------------------------------------------------------------------------------ // This shader computes rudimentary transform and lighting. // The XNA VertexDeclaration of our models is PositionNormalTexture. //------------------------------------------------------------------------------ VS_OUTPUT RenderShadowsVS( float3 position : POSITION, float3 normal : NORMAL, float2 vTexCoord0 : TEXCOORD0 ) { VS_OUTPUT Output; //generate the world-view-projection matrix float4x4 wvp = mul(mul(gWorld, gView), gProjection); //transform the input position to the output Output.Position = mul(float4(position, 1.0), wvp); //transform the normal to world space Output.vNormal = mul(normal, gWorld); //do not transform the position needed for the //shadow map determination Output.vPos = float4(position,1.0); //pass the texture coordinate as-is Output.TextureUV = vTexCoord0; //return the output structure return Output; } VS_SHADOW_OUTPUT RenderShadowMapVS(float4 vPos: POSITION) { VS_SHADOW_OUTPUT Out; Out.Position = GetPositionFromLight(vPos); // Depth is Z/W. This is returned by the pixel shader. // Subtracting from 1 gives us more precision in floating point. Out.Depth.x = 1-(Out.Position.z/Out.Position.w); return Out; } //------------------------------------------------------------------------------ // Pixel shader output structure //------------------------------------------------------------------------------ struct PS_OUTPUT { float4 RGBColor : COLOR0; // Pixel color }; //------------------------------------------------------------------------------ // This shader outputs the pixel's color by modulating the texture's // color with diffuse material color //------------------------------------------------------------------------------ PS_OUTPUT RenderShadowsPS( PS_INPUT In ) { PS_OUTPUT Output; // Standard lighting equation float4 vTotalLightDiffuse = float4(0.1f,0.1f,0.1f,0.1f); float3 lightDir = normalize(g_LightPos+In.vPos); // direction of light vTotalLightDiffuse += g_LightDiffuse * max(0,dot(In.vNormal, lightDir)); vTotalLightDiffuse.a = 0.5f; // Now, consult the ShadowMap to see if we're in shadow float4 lightingPosition = GetPositionFromLight(In.vPos);// Get our position on the shadow map // Get the shadow map depth value for this pixel float2 ShadowTexC = 0.5 * lightingPosition.xy / lightingPosition.w + float2( 0.5, 0.5 ); ShadowTexC.y = 1.0f - ShadowTexC.y; float shadowdepth = tex2D(ShadowMapSampler, ShadowTexC).r; // Check our value against the depth value float ourdepth = 1 + (lightingPosition.z / lightingPosition.w); // Check the shadowdepth against the depth of this pixel // a fudge factor is added to account for floating-point error if (shadowdepth-0.03 > ourdepth) { // we're in shadow, cut the light vTotalLightDiffuse = float4(0,0,0,1); }; Output.RGBColor = tex2D(MeshTextureSampler, In.TextureUV) * (vTotalLightDiffuse + g_LightAmbient); return Output; } PS_OUTPUT DiffuseOnlyPS(VS_OUTPUT In) : COLOR { PS_OUTPUT Output; //calculate per-pixel diffuse float3 directionToLight = normalize(g_LightPos - In.vPos); float diffuseIntensity = saturate( dot(directionToLight, In.vNormal)); float4 diffuse = g_LightDiffuse * diffuseIntensity; float4 color = diffuse + g_LightAmbient; color.a = 0.0; Output.RGBColor = tex2D(MeshTextureSampler, In.TextureUV) * color; return Output; } PS_OUTPUT TextureOnlyPS(float2 TextureUV : TEXCOORD0) : COLOR { PS_OUTPUT Output; Output.RGBColor = tex2D(MeshTextureSampler, TextureUV); return Output; } float4 RenderShadowMapPS( VS_SHADOW_OUTPUT In ) : COLOR { // The depth is Z divided by W. We return // this value entirely in a 32-bit red channel // using SurfaceFormat.Single. This preserves the // floating-point data for finer detail. return float4(In.Depth.x,0,0,1); } //------------------------------------------------------------------------------ // Renders scene to render target //------------------------------------------------------------------------------ technique TextureRender { pass P0 { VertexShader = compile vs_2_0 RenderShadowsVS(); PixelShader = compile ps_2_0 TextureOnlyPS(); } pass P1 { VertexShader = compile vs_2_0 RenderShadowsVS(); PixelShader = compile ps_2_0 RenderShadowsPS(); } pass P2 { // These render states are necessary to get a shadow map. // You should consider resetting CullMode and AlphaBlendEnable // before you render your main scene. CullMode = CW; ZEnable = TRUE; ZWriteEnable = TRUE; AlphaBlendEnable = TRUE; VertexShader = compile vs_2_0 RenderShadowMapVS(); PixelShader = compile ps_2_0 RenderShadowMapPS(); } } This is not the original .fx file, i configured it for MTA. The diffuse and the ambient light works correctly, but not generating shadows. Any Idea?
  9. Piorun

    WebSockets

    Hi, Do WebSockets (for ex. libraries like Socket.IO) are working with browser created in MTA? I'm asking because I want to connect server via Socket.IO locally (NodeJS Express.js).
  10. -- client -- local displayWidth, displayHeight = guiGetScreenSize(); local notificationData = {}; local notificationFont = dxCreateFont('files/fonts/roboto.ttf', 12 * 2, false); local iconsFont = dxCreateFont('files/fonts/icons.ttf', 12 * 2, false); addEventHandler('onClientRender', root, function() for k, v in pairs(notificationData) do if (v.State == 'fadeIn') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 255; end if (alphaProgress > 1) then v.Tick = getTickCount(); v.State = 'openTile'; end elseif (v.State == 'fadeOut') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 0; end if (alphaProgress > 1) then notificationData = {}; end elseif (v.State == 'openTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end if (tileProgress > 1) then v.State = 'fixTile'; setTimer(function() v.Tick = getTickCount(); v.State = 'closeTile'; end, string.len(v.Text) * 45 + 5000, 1); end elseif (v.State == 'closeTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.StartX; v.CurrentWidth = 0; end if (tileProgress > 1) then v.AlphaTick = getTickCount(); v.State = 'fadeOut'; end elseif (v.State == 'fixTile') then v.Alpha = 255; v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true); dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true); if (v.Alpha == 255) then dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', true, false, true); end if (v.Type == 'error') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'warning') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'info') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'success') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(80, 205, 105, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); end end end ) addEvent('addNotification', true); function addNotification(text, type) if (text and type) then if (notificationData ~= nil) then table.remove(notificationData, #notificationData); end table.insert(notificationData, { StartX = (displayWidth / 2) - (25 / 2), EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2), Text = text, Width = dxGetTextWidth(text, 0.40, notificationFont) + 20, Alpha = 0, State = 'fadeIn', Tick = 0, AlphaTick = getTickCount(), CurrentX = (displayWidth / 2) - (25 / 2), CurrentWidth = 0, Type = type or 'info' } ); playSoundFrontEnd(11); end end addEventHandler('addNotification', root, addNotification); function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end --> Background dxDrawRectangle(x, y, w, h, bgColor, postGUI); --> Border dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right end end -- server -- function addNotification(player, text, type) if (player and text and type) then exports["notices"]:addNotification("Test","success"); triggerClientEvent(player, 'addNotification', player, text, type); end end addEventHandler("onResourceStart", addNotification, player, text, type)
  11. function checkAFKPlayers() for index, source in ipairs(getElementsByType("player")) do if (getPlayerIdleTime(source) > 1000) then setElementDimension ( source, 50) setElementAlpha(source, 50) outputChatBox("#004B00[DDC - Afk] #FFffFFNem mozogtál 2 percig, afk módba léptél! Kikapcsoláshoz mozdulj meg!", root, 255,000,000, true) elseif isElementMoving(source) then setElementAlpha(source, 255) setElementDimension ( source, 0) outputChatBox("#004B00[DDC - Afk] #FFffFFKiléptél az afk módból!", root, 255,000,000, true) end end end setTimer(checkAFKPlayers, 1000, 0) function isElementMoving ( theElement ) if isElement ( theElement ) then local x, y, z = getElementVelocity( theElement ) return x ~= 0 or y ~= 0 or z ~= 0 end return false end how to fix this? i want once outputChatbox
  12. function replaceModel() txd = engineLoadTXD("santa.txd", 290 ) engineImportTXD(txd, 290 ) dff = engineLoadDFF("santa.dff", 290 ) engineReplaceModel(dff, 290 ) txd = engineLoadTXD("male01.txd", 44 ) engineImportTXD(txd, 44 ) dff = engineLoadDFF("male01.dff", 44 ) engineReplaceModel(dff, 44 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) addCommandHandler ( "reloadcar", replaceModel ) First skin (santa) is working fine, second (male01) got this error: Error loading DFF @ 'engineLoadDFF' [male01.dff] and bad argument @ engineReplaceModel [expected dff at argument 1, got boolean]... Wtf.. How to fix this? I do not understand this..
  13. function addToGroup( group ) group = aclGetGroup( group ) if group == false or group == nil then error( "The value of the 'group' is nil or false !" ) end account = getPlayerAccount( source ) if not isGuestAccount( account ) then local name = getAccountName( account ) local add = aclGroupAddObject( group, "user."..name ) if getPlayerMoney(source) >= 2500 then elseif add then outputChatBox( "Színesen írsz, amíg turbesz el nem veszi.", root, 0, 255, 0, true ) triggerClientEvent( source, "hideall", source ) takePlayerMoney ( source, 2000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end else outputChatBox( "Regisztrálj, és jelentkezz be.", source, 255, 0, 0, true ) end end addEvent( "addToGroup", true ) addEventHandler( "addToGroup", root, addToGroup )
  14. Zdravím, Len som zvedavý či tu vlastne je niekto aktívny aj zo Slovenska alebo Česka okrem mňa. Ak teda hej tak stačí len odpovedať :D. Povedzme, že toto je taký môj malý súkromný prieskum.
  15. Hi! This script makes possible to play a 3d sound (looped sound) by pressing the CTRL button, and stop the sound when the CTRL button is "up". Well, it has a really annoying sync bug. As you can see, there is a setElementData function in my client side script, that stores the sound element. When the player stops pressing the CTRL button then the script stops the sound with the stored element. Well the problem is that when another player press the CTRL button then the setElementData will be overwritted, and will cause really strange, annoying bugs. So the bug is: when player1 press CTRL, and after that player2 also press CTRL then the sound for player1 will not stop anymore, because player2 owerwrited the setElementData, when he pressed CTRL. Well, its not easy to explain, so i hope you understood me. Is the any way to avoid this owerwriting? or do i have to do this another way, without setElementData? Thanks in advance. client --start sound function start_fire_sound() if isPedInVehicle (localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 476 then triggerServerEvent ( "start_fire_sound", resourceRoot, veh ) end end end bindKey("lctrl", "down", start_fire_sound) function start_fire_c(veh) local x,y,z = getElementPosition (veh) local sound_fire = playSound3D("files/fire.wav",x,y,z, true) setSoundMaxDistance( sound_fire, 500 ) setSoundVolume(sound_fire, 1) attachElements ( sound_fire, veh, 0,0,0 ) setElementData(localPlayer, "sound_fire", sound_fire) end addEvent( "start_fire_sound", true ) addEventHandler( "start_fire_sound", localPlayer, start_fire_c ) --stop sound function stop_fire_sound() if isPedInVehicle (localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 476 then triggerServerEvent ( "stop_fire_sound", resourceRoot, veh ) end end end bindKey("lctrl", "up", stop_fire_sound) function stop_fire_sound_c(veh) local x,y,z = getElementPosition (veh) local sound_fire_lastshot = playSound3D("files/fire_lastshot.wav",x,y,z, false) setSoundMaxDistance( sound_fire_lastshot, 500 ) setSoundVolume(sound_fire_lastshot, 1) attachElements ( sound_fire_lastshot, veh, 0,0,0 ) local sound_fire = getElementData(localPlayer, "sound_fire") stopSound(sound_fire) end addEvent( "stop_fire_sound", true ) addEventHandler( "stop_fire_sound", localPlayer, stop_fire_sound_c ) server function start_fire_sound(veh) triggerClientEvent ("start_fire_sound", getRootElement(), veh) end addEvent( "start_fire_sound", true ) addEventHandler( "start_fire_sound", getRootElement(), start_fire_sound ) function stop_fire_sound(veh) triggerClientEvent ("stop_fire_sound", getRootElement(), veh) end addEvent( "stop_fire_sound", true ) addEventHandler( "stop_fire_sound", getRootElement(), stop_fire_sound )
  16. السلام عليكم ورحمة الله وبركاته..، ي شبابب! اريد واحد يسجل شرح الفيديو تسجيل صوتي لاني مااقدر اسجل صوت
  17. Приветствую. Сделал логин панель и столкнулся с такой проблемой.. Захожу в первый раз на сервер, triggerClientEvent не срабатывает, если перезайти на сервер, тогда он уже сработает. Если удалить из кэша папку со скриптом логина, тогда при следующем заходе на сервер, опять не срабатывает triggerClientEvent server.lua addEventHandler("onPlayerJoin", getRootElement(), function () local serial = getPlayerSerial (source) local account = mysql:query("SELECT * FROM users WHERE serial = '".. serial .."' LIMIT 1") if account then local rows = mysql:num_rows(account) if rows > 0 then triggerClientEvent(source, "loginpage", source) else triggerClientEvent(source, "registerpage", source) end end mysql:free_result(account) end ) client.lua function loginpage() addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(source, page2) -- login showCursor(true) end ) end addEvent("loginpage", true) addEventHandler("loginpage", localPlayer, loginpage) В чем проблема?
  18. ---server function warpMe(targetPlayer) local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) if getElementData(targetPlayer, "IsWarpLocked") then outputChatBox("Ez a játékos nem engedte meg, hogy rá warpoljanak!", source, r, g, b, false) return end if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) if not vehicle then -- target player is not in a vehicle - just warp next to him local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) else -- target player is in a vehicle - warp into it if there's space left if getPedOccupiedVehicle(source) then --removePlayerFromVehicle(source) outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox("No free seats left in " .. getPlayerName(targetPlayer) .. "'s vehicle.", source, 255, 0, 0) end end function(player) setElementData(player, "IsWarpLocked", true) else removeElementData(player, "IsWarpLocked") end addEvent( "warponoff", true ) addEventHandler( "warponoff", root, giveWeaponsOnSpawn ) ---client function warponoff ( ) triggerServerEvent("warponoff", getLocalPlayer(), group) end {'chk', id='Warp', onclick=warponoff, width=60},
  19. i tried create a window in freeroam, but doesn't working --------------------------- -- Teszt --------------------------- local GUIEditor = { button = {}, window = {}, label = {} } wnd.GUIEditor.window[1] = guiCreateWindow(541, 375, 360, 222, "Teszt", false) guiWindowSetSizable(wnd.GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(10, 182, 340, 30, "teszt", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(9, 26, 341, 156, "- Teszt", false, GUIEditor.window[1]) guiSetVisible( wnd.GUIEditor.window[1], false ) {'btn', id='gift', window=wnd.GUIEditor.window[1], width=250} Error: gui.lua:283: attempt to index local 'wnd' (a userdata value) what wrong?
  20. addEventHandler ( "onPlayerChat", root, function ( msg, type ) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) and type == 0 then cancelEvent ( ) function outputMessage(author,message) outputChatBox("#ff0000[T] #FFffff"..author..": #FF0000"..message,getRootElement(),0,0,0,true) end function changetag(author,message) outputChatBox("#ff0000[Tulaj] #FFffff"..author..": #FFd700"..message,getRootElement(),0,0,0,true) end addCommandHandler("rang",changetag) why not working this? what wrong?
  21. --client local GUIEditor = { tab = {}, tabpanel = {}, label = {}, button = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(0.32, 0.29, 0.37, 0.29, "[DDC]© Fegyverbolt /turbesz\"", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) GUIEditor.button[1] = guiCreateButton(0.02, 0.91, 0.96, 0.05, "bezárás", true, GUIEditor.window[1]) GUIEditor.tabpanel[1] = guiCreateTabPanel(0.02, 0.08, 0.96, 0.80, true, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("#1", GUIEditor.tabpanel[1]) GUIEditor.label[1] = guiCreateLabel(0.01, 0.00, 0.99, 0.29, "M4 - 5000 tölténnyel", true, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[1], "sa-header") guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) GUIEditor.button[2] = guiCreateButton(0.01, 0.27, 0.99, 0.12, "Kérem ezt! Ár: 3000$!", true, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF24FE00") GUIEditor.label[2] = guiCreateLabel(0.01, 0.38, 0.99, 0.29, "AK47 - 5000 tölténnyel", true, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[2], "sa-header") guiLabelSetHorizontalAlign(GUIEditor.label[2], "left", true) GUIEditor.button[3] = guiCreateButton(0.00, 0.67, 0.99, 0.12, "Kérem ezt! Ár: 2500$!", true, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF24FE00") GUIEditor.label[3] = guiCreateLabel(0.11, 0.85, 0.78, 0.10, "Folytatást a következő fülön találhatsz! ;)", true, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 251, 248, 2) GUIEditor.tab[2] = guiCreateTab("#2", GUIEditor.tabpanel[1]) GUIEditor.label[4] = guiCreateLabel(0.01, 0.05, 0.97, 0.30, "9MM - 4000 Tölténnyel", true, GUIEditor.tab[2]) guiSetFont(GUIEditor.label[4], "sa-header") GUIEditor.button[4] = guiCreateButton(0.01, 0.37, 0.97, 0.12, "Kérem ezt! Ár: 2000$!", true, GUIEditor.tab[2]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFBF802") GUIEditor.label[5] = guiCreateLabel(0.01, 0.48, 0.98, 0.27, "Uzi - 4000 Tölténnyel", true, GUIEditor.tab[2]) guiSetFont(GUIEditor.label[5], "sa-header") GUIEditor.button[5] = guiCreateButton(0.01, 0.78, 0.97, 0.12, "Kérem ezt! Ár: 2500$!", true, GUIEditor.tab[2]) guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFFBF802") GUIEditor.tab[3] = guiCreateTab("#3", GUIEditor.tabpanel[1]) GUIEditor.label[6] = guiCreateLabel(0.02, 0.04, 0.96, 0.29, "RPG - 100 Tölténnyel", true, GUIEditor.tab[3]) guiSetFont(GUIEditor.label[6], "sa-header") GUIEditor.button[6] = guiCreateButton(0.01, 0.31, 0.97, 0.13, "Kérem ezt! Ára: 300000$!", true, GUIEditor.tab[3]) guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FF01C4B8") GUIEditor.label[7] = guiCreateLabel(0.02, 0.45, 0.96, 0.29, "M.lövész - 100 Tölténnyel", true, GUIEditor.tab[3]) guiSetFont(GUIEditor.label[7], "sa-header") GUIEditor.button[7] = guiCreateButton(0.01, 0.77, 0.97, 0.13, "Kérem ezt! Ára: 50000$!", true, GUIEditor.tab[3]) guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FF01C4B8") GUIEditor.tab[4] = guiCreateTab("#4", GUIEditor.tabpanel[1]) GUIEditor.label[8] = guiCreateLabel(0.02, 0.05, 0.96, 0.10, "MP5 - 3000 Tölténnyel", true, GUIEditor.tab[4]) guiSetFont(GUIEditor.label[8], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[8], "center", false) GUIEditor.button[8] = guiCreateButton(0.09, 0.17, 0.81, 0.11, "Kérem ezt! Ár: 4000$!", true, GUIEditor.tab[4]) GUIEditor.label[9] = guiCreateLabel(0.02, 0.30, 0.96, 0.10, "Tec9 - 3000 Tölténnyel", true, GUIEditor.tab[4]) guiSetFont(GUIEditor.label[9], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[9], "center", false) GUIEditor.button[9] = guiCreateButton(0.09, 0.41, 0.81, 0.11, "Kérem ezt! Ár: 4500$!", true, GUIEditor.tab[4]) GUIEditor.label[10] = guiCreateLabel(0.02, 0.54, 0.96, 0.10, "Shotgun - 2500 Tölténnyel", true, GUIEditor.tab[4]) guiSetFont(GUIEditor.label[10], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[10], "center", false) GUIEditor.button[10] = guiCreateButton(0.09, 0.64, 0.81, 0.11, "Kérem ezt! Ár: 5000$!", true, GUIEditor.tab[4]) GUIEditor.label[11] = guiCreateLabel(0.02, 0.77, 0.96, 0.10, "Lefűrészelt csövű puska - 2500 Tölténnyel", true, GUIEditor.tab[4]) guiSetFont(GUIEditor.label[11], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[11], "center", false) GUIEditor.button[11] = guiCreateButton(0.09, 0.88, 0.81, 0.11, "Kérem ezt! Ár: 5500$!", true, GUIEditor.tab[4]) GUIEditor.tab[5] = guiCreateTab("#5", GUIEditor.tabpanel[1]) GUIEditor.label[12] = guiCreateLabel(0.01, 0.02, 0.97, 0.10, "Hangtompítós pisztoly - 3000 tölténnyel", true, GUIEditor.tab[5]) guiSetFont(GUIEditor.label[12], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[12], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[12], "center") GUIEditor.button[12] = guiCreateButton(0.12, 0.13, 0.75, 0.11, "Kérem ezt! Ára: 1500$!", true, GUIEditor.tab[5]) GUIEditor.label[13] = guiCreateLabel(0.01, 0.24, 0.97, 0.10, "Lángszóró - 3000 tölténnyel", true, GUIEditor.tab[5]) guiSetFont(GUIEditor.label[13], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[13], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[13], "center") GUIEditor.button[13] = guiCreateButton(0.12, 0.36, 0.75, 0.11, "Kérem ezt! Ára: 10000$!", true, GUIEditor.tab[5]) GUIEditor.label[14] = guiCreateLabel(0.01, 0.47, 0.97, 0.10, "Gránát - 50 darab", true, GUIEditor.tab[5]) guiSetFont(GUIEditor.label[14], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[14], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[14], "center") GUIEditor.button[14] = guiCreateButton(0.12, 0.59, 0.75, 0.11, "Kérem ezt! Ára: 15000$!", true, GUIEditor.tab[5]) GUIEditor.label[15] = guiCreateLabel(0.01, 0.70, 0.97, 0.10, "Tapadós bomba - 50 darab", true, GUIEditor.tab[5]) guiSetFont(GUIEditor.label[15], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[15], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[15], "center") GUIEditor.button[15] = guiCreateButton(0.12, 0.84, 0.75, 0.11, "Kérem ezt! Ára: 20000$!", true, GUIEditor.tab[5]) GUIEditor.tab[6] = guiCreateTab("#6", GUIEditor.tabpanel[1]) GUIEditor.label[16] = guiCreateLabel(0.00, 0.03, 0.98, 0.28, "Molotov - 50 darab", true, GUIEditor.tab[6]) guiSetFont(GUIEditor.label[16], "sa-header") GUIEditor.button[16] = guiCreateButton(0.00, 0.33, 0.99, 0.15, "Kérem ezt! Ár: 10000$!", true, GUIEditor.tab[6]) guiSetFont(GUIEditor.button[16], "clear-normal") guiSetProperty(GUIEditor.button[16], "NormalTextColour", "FF4F09FE") GUIEditor.label[17] = guiCreateLabel(0.00, 0.51, 0.98, 0.28, "Könnygáz - 50 darab", true, GUIEditor.tab[6]) guiSetFont(GUIEditor.label[17], "sa-header") GUIEditor.button[17] = guiCreateButton(0.00, 0.80, 0.99, 0.15, "Kérem ezt! Ár: 20000$!", true, GUIEditor.tab[6]) guiSetFont(GUIEditor.button[17], "clear-normal") guiSetProperty(GUIEditor.button[17], "NormalTextColour", "FF4F09FE") guiSetVisible ( GUIEditor.window[1], false ) function OpenWin() if guiGetVisible ( GUIEditor.window[1] ) == false then guiSetVisible ( GUIEditor.window[1], true ) showCursor(true) elseif guiGetVisible ( GUIEditor.window[1] ) == true then guiSetVisible ( GUIEditor.window[1], false ) showCursor(false) end end bindKey ( "F2", "down", OpenWin) function bezarom() guiSetVisible ( GUIEditor.window[1], false ) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor.button[1], bezarom) function m4() triggerServerEvent ("m4",getLocalPlayer(),m4) end addEventHandler("onClientGUIClick", GUIEditor.button[2], m4) function ak47() triggerServerEvent ("ak47",getLocalPlayer(),ak47) end addEventHandler("onClientGUIClick", GUIEditor.button[3], ak47) function kilencmm() triggerServerEvent ("kilencmm",getLocalPlayer(),kilencmm) end addEventHandler("onClientGUIClick", GUIEditor.button[4], kilencmm) function uzi() triggerServerEvent ("uzi",getLocalPlayer(),uzi) end addEventHandler("onClientGUIClick", GUIEditor.button[5], uzi) function rpg() triggerServerEvent ("rpg",getLocalPlayer(),rpg) end addEventHandler("onClientGUIClick", GUIEditor.button[6], rpg) function sniper() triggerServerEvent ("sniper",getLocalPlayer(),sniper) end addEventHandler("onClientGUIClick", GUIEditor.button[7], sniper) function mp5() triggerServerEvent ("mp5",getLocalPlayer(),mp5) end addEventHandler("onClientGUIClick", GUIEditor.button[8], mp5) function tec() triggerServerEvent ("tec",getLocalPlayer(),tec) end addEventHandler("onClientGUIClick", GUIEditor.button[9], tec) function shotgun() triggerServerEvent ("shotgun",getLocalPlayer(),shotgun) end addEventHandler("onClientGUIClick", GUIEditor.button[10], shotgun) function lfcsp() triggerServerEvent ("lfcsp",getLocalPlayer(),lfcsp) end addEventHandler("onClientGUIClick", GUIEditor.button[11], lfcsp) function silenced() triggerServerEvent ("silenced",getLocalPlayer(),silenced) end addEventHandler("onClientGUIClick", GUIEditor.button[12], silenced) function lsz() triggerServerEvent ("lsz",getLocalPlayer(),lsz) end addEventHandler("onClientGUIClick", GUIEditor.button[13], lsz) function granat() triggerServerEvent ("granat",getLocalPlayer(),granat) end addEventHandler("onClientGUIClick", GUIEditor.button[14], granat) function tapados() triggerServerEvent ("tapados",getLocalPlayer(),tapados) end addEventHandler("onClientGUIClick", GUIEditor.button[15], tapados) function molotov() triggerServerEvent ("molotov",getLocalPlayer(),molotov) end addEventHandler("onClientGUIClick", GUIEditor.button[16], molotov) function konnygaz() triggerServerEvent ("konnygaz",getLocalPlayer(),konnygaz) end addEventHandler("onClientGUIClick", GUIEditor.button[17], konnygaz) --server function elso ( ) if getPlayerMoney(source) >= 3000 then giveWeapon ( source, 31, 5000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 3000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "m4", true ) addEventHandler( "m4", root, elso ) function masodik ( ) if getPlayerMoney(source) >= 2500 then giveWeapon ( source, 30, 5000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 2500 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "ak47", true ) addEventHandler( "ak47", root, masodik ) function harmadik ( ) if getPlayerMoney(source) >= 2000 then giveWeapon ( source, 22, 4000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 2000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "kilencmm", true ) addEventHandler( "kilencmm", root, harmadik ) function negyedik ( ) if getPlayerMoney(source) >= 2500 then giveWeapon ( source, 28, 4000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 2500 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "uzi", true ) addEventHandler( "uzi", root, negyedik ) function otodik ( ) if getPlayerMoney(source) >= 300000 then giveWeapon ( source, 36, 100 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 300000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "rpg", true ) addEventHandler( "rpg", root, otodik ) function hatodik ( ) if getPlayerMoney(source) >= 50000 then giveWeapon ( source, 34, 100 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 50000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "sniper", true ) addEventHandler( "sniper", root, hatodik ) function hetedik ( ) if getPlayerMoney(source) >= 4000 then giveWeapon ( source, 29, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 4000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "mp5", true ) addEventHandler( "mp5", root, hetedik ) function nyolcadik ( ) if getPlayerMoney(source) >= 4500 then giveWeapon ( source, 32, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 4500 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "tec", true ) addEventHandler( "tec", root, nyolcadik ) function kilencedik ( ) if getPlayerMoney(source) >= 5000 then giveWeapon ( source, 25, 2500 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 5000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "shotgun", true ) addEventHandler( "shotgun", root, kilencedik ) function tizedik ( ) if getPlayerMoney(source) >= 5500 then giveWeapon ( source, 26, 2500 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 5500 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "lfcsp", true ) addEventHandler( "lfcsp", root, tizedik ) function tizenegyedik ( ) if getPlayerMoney(source) >= 1500 then giveWeapon ( source, 23, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 1500 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "silenced", true ) addEventHandler( "silenced", root, tizenegyedik ) function tizenkettedik ( ) if getPlayerMoney(source) >= 10000 then giveWeapon ( source, 37, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 10000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "lsz", true ) addEventHandler( "lsz", root, tizenkettedik ) function tizenharmadik ( ) if getPlayerMoney(source) >= 15000 then giveWeapon ( source, 16, 50 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 15000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "granat", true ) addEventHandler( "granat", root, tizenharmadik ) function tizennegyedik ( ) if getPlayerMoney(source) >= 20000 then giveWeapon ( source, 39, 50 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "tapados", true ) addEventHandler( "tapados", root, tizennegyedik ) function tizenotodik ( ) if getPlayerMoney(source) >= 10000 then giveWeapon ( source, 18, 50 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 10000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "molotov", true ) addEventHandler( "molotov", root, tizenotodik ) function tizenhatodik ( ) if getPlayerMoney(source) >= 20000 then giveWeapon ( source, 17, 50 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20000 ) else outputChatBox("Nincs erre pénzed.", source, 255, 0, 0, false) end end addEvent( "konnygaz", true ) addEventHandler( "konnygaz", root, tizenhatodik ) when i click on a tab, my money is decrease, and give me weapons, why? how to fix it?
  22. local GUIEditor = { window = {}, scrollbar = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(406, 147, 673, 585, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.scrollbar[1] = guiCreateScrollBar(615, 35, 27, 513, false, false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(18, 42, 587, 496, "a\n\nb\n\nc\n\nd\n\ne\n\nf\n\ng\n\nh\n\ni\n\nj\n\nk\n\nl\n\nm\n\nn\n\no\n\np\n\nq\n\nr\n\ns\n\nt\n\nu\n\nv\n\nw\n\nx\n\ny\n\nz", false, GUIEditor.window[1]) scrollbar doesn't working, why? o_O
  23. local x, y = guiGetScreenSize() local font_os = (x/1600+y/900)/2 local font = font_os*1 local nSpaceY = dxGetFontHeight(font, "default-bold") local nSpaceYOld = dxGetFontHeight(2, "default-bold") local szovegek = {} local lp = getPlayerName(getLocalPlayer()) for i=0, 0, 1 do szovegeki = "" end function itsRenderTime() for i = 0, 0, 1 do if szovegeki then local topSpaceX = dxGetTextWidth(szovegeki:gsub("#%x%x%x%x%x%x",""),font,"default-bold") local webX=topSpaceX+font_os*10 dxDrawRectangle ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 0, 0, 0, 155 ) ) dxDrawEmptyRec ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 255, 255, 255, 200 ), 2 ) dxDrawText ( szovegeki, x-webX, nSpaceYOld*2+font_os*10+nSpaceY*(4-i)+font_os*(4-i), topSpaceX, nSpaceY, tocolor ( 255, 255, 255, 255 ), font, "default-bold", "left", "top",true,false,false,true ) end end end addEventHandler("onClientRender", getRootElement(), itsRenderTime) function infoServer2(szoveg) for i = 3, 0, -1 do szovegek[i+1] = szovegeki end szovegek[0] = szoveg end addEvent("infoServer2", true) addEventHandler("infoServer2",getRootElement(), infoServer2) function dxDrawEmptyRec(absX,absY,sizeX,sizeY,color,ancho) dxDrawRectangle ( absX,absY,sizeX,ancho,color ) dxDrawRectangle ( absX,absY+ancho,ancho,sizeY-ancho,color ) dxDrawRectangle ( absX+ancho,absY+sizeY-ancho,sizeX-ancho,ancho,color ) dxDrawRectangle ( absX+sizeX-ancho,absY+ancho,ancho,sizeY-ancho*2,color ) end local aValto = true function azEltunteto() if aValto then aValto = false removeEventHandler ( "onClientRender", root, itsRenderTime ) else aValto = true addEventHandler ( "onClientRender", root, itsRenderTime ) end end bindKey("delete","down",azEltunteto) this is client (^) --- this is server (v) addEventHandler("onPlayerChangeNick", root, function(lastNick, newNick) local pName = getPlayerName(source) table.insert(szovegeki, lastNick.." change nick: "..newNick) triggerClientEvent("infoServer2", szovegeki) end) what wrong? how to fix ? thanks the help
  24. function giveWeaponsOnSpawn0 ( ) giveWeapon ( source, 31, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20 ) else outputChatBox("You do not have enough money.", source, 255, 0, 0, false) end addEvent( "giveweaponm4", true ) addEventHandler( "giveweaponm4", root, giveWeaponsOnSpawn0 ) what wrong in this?
  25. local x, y = guiGetScreenSize() local font_os = (x/1600+y/900)/2 local font = font_os*1 local nSpaceY = dxGetFontHeight(font, "default-bold") local nSpaceYOld = dxGetFontHeight(2, "default-bold") local szovegek = {} for i=0, 4, 1 do szovegeki = "s" end function itsRenderTime() for i = 0, 4, 1 do if szovegeki then local topSpaceX = dxGetTextWidth(szovegeki:gsub("#%x%x%x%x%x%x",""),font,"default-bold") local webX=topSpaceX+font_os*10 dxDrawRectangle ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 0, 0, 0, 155 ) ) dxDrawEmptyRec ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 255, 255, 255, 200 ), 2 ) dxDrawText ( szovegeki, x-webX, nSpaceYOld*2+font_os*10+nSpaceY*(4-i)+font_os*(4-i), topSpaceX, nSpaceY, tocolor ( 255, 255, 255, 255 ), font, "default-bold", "left", "top",true,false,false,true ) end end end addEventHandler("onClientRender", getRootElement(), itsRenderTime) addEventHandler("onClientPlayerChangeNick", root, function(lastNick, newNick) szovegeki = ""..lastNick.." #00baffneve mostantól#ffFFff "..newNick, true end) function infoServer2(szoveg) for i = 3, 0, -1 do szovegek[i+1] = szovegeki end szovegek[0] = szoveg end addEvent("infoServer2", true) addEventHandler("infoServer2",getRootElement(), infoServer2) function dxDrawEmptyRec(absX,absY,sizeX,sizeY,color,ancho) dxDrawRectangle ( absX,absY,sizeX,ancho,color ) dxDrawRectangle ( absX,absY+ancho,ancho,sizeY-ancho,color ) dxDrawRectangle ( absX+ancho,absY+sizeY-ancho,sizeX-ancho,ancho,color ) dxDrawRectangle ( absX+sizeX-ancho,absY+ancho,ancho,sizeY-ancho*2,color ) end local aValto = true function azEltunteto() if aValto then aValto = false removeEventHandler ( "onClientRender", root, itsRenderTime ) else aValto = true addEventHandler ( "onClientRender", root, itsRenderTime ) end end bindKey("delete","down",azEltunteto) the script working, but the message show in 5 line instead of 1, how to fix this?
×
×
  • Create New...