Search the Community

Showing results for tags 'help'.



More search options

  • 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
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 587 results

  1. 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?
  2. I have a question, can I just move the elements of the default interface? Or do I always have to create others from them? I just want to get, for example: getElementHealth And move it! In fact, I would like to do this with everyone, such as: getTime getPedWeapon getPedArmor getPedAmmoInClip getPedTotalAmmo getPedOxygenLevel getPlayerMoney getPlayerWantedLevel I do not want to create another, I want the standard, you know?
  3. Can anyone make me text on head "Admin On Duty [No Shooting]"? Also. Can anyone make me script, if you are around 100m then anyone can't equip weaons and shoot? function giveblood (thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin,Moderator,Owner")) then end outputChatBox ("#1AFF00 Admin "..getPlayerName(thePlayer).."#1AFF00IS NOW - ON DUTY",root,255,255,255,true) setElementData(thePlayer, "blood",999999999) setElementData(thePlayer, "food",95) setElementData(thePlayer, "thirst",95) setElementData(thePlayer, "temperature",36.5) setElementData(thePlayer, "currentweapon_1",false) setElementData(thePlayer, "currentweapon_2",false) setElementData(thePlayer, "currentweapon_3",false) setElementData(thePlayer, "bleeding",false) setElementData(thePlayer, "brokenbone",false) setElementData(thePlayer, "pain",false) setElementData(thePlayer, "cold",false) setElementData(thePlayer, "humanity",2500) end addCommandHandler("duty", giveblood) function bloodback(thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin,Moderator,Owner")) then end outputChatBox ("#FF0000 Admin "..getPlayerName(thePlayer).."#FF0000IS NOW - OFF DUTY",root,255,255,255,true) setElementData(thePlayer, "blood",12000) end addCommandHandler("offduty", bloodback)
  4. addEvent ( "onaduty", true ) function aduty() if getElementData(getLocalPlayer( ),"aduty") == true then timer = setTimer ( function() setElementData(getLocalPlayer( ),"onaduty",true) local x, y, z = getElementPosition( getLocalPlayer( ) ) local playerName = getPlayerName( getLocalPlayer( ) ) local theText = dxDraw3DText( "Admin On duty [DONT SHOOT]", x, y, z+1,05,"default",255,0,0,200) setTimer ( function() destroyElement(theText) end, 59, 1) end, 60, 0 ) else if isTimer(timer) then killTimer(timer) end setElementData(getLocalPlayer( ),"aduty",true) end end addEventHandler ( "onaduty", getRootElement(), aduty) addCommandHandler("duty",aduty) Text.lua Here is problem. I see the text but another players don't! goduty.lua function aduty ( player ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then outputChatBox(" Administrator "..getPlayerName(player).." Is Now OnDuty!",getRootElement(),255,0,0) outputChatBox("",getRootElement(),255,0,0) outputServerLog(" Administrator "..getPlayerName(player).." Is Now OnDuty!") setElementData( player, "blood", 99999999999999999999999 ) heal = "9999999999999999999999999999" end end addCommandHandler("duty",aduty) function offaduty ( player ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then outputChatBox(" Administrator "..getPlayerName(player).." Is No Longer OnDuty!",getRootElement(),255,0,0) outputChatBox("",getRootElement(),255,0,0) outputServerLog(" Administrator "..getPlayerName(player).." Is No Longer OnDuty!") setElementData( player, "blood", 12000 ) end end addCommandHandler("offaduty",offaduty) function heal_func ( player ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then if heal == "an" then setElementData( player, "food", 250 ) setElementData( player, "thirst", 250 ) end end end setTimer(heal_func, 60000, 0) 3dtext.lua local fonts = { [ "default" ] = true, [ "default-bold" ] = true,[ "clear" ] = true,[ "arial" ] = true,[ "sans" ] = true, [ "pricedown" ] = true, [ "bankgothic" ] = true,[ "diploma" ] = true,[ "beckett" ] = true }; function dxDraw3DText( text, x, y, z, scale, font, r, g, b, maxDistance ) assert( type( text ) == "string", "Bad argument @ dxDraw3DText" ); assert( type( x ) == "number", "Bad argument @ dxDraw3DText" ); assert( type( y ) == "number", "Bad argument @ dxDraw3DText" ); assert( type( z ) == "number", "Bad argument @ dxDraw3DText" ); if not scale or type( scale ) ~= "number" or scale <= 0 then scale = 2 end if not font or type( font ) ~= "string" or not fonts[ font ] then font = "default" end if not r or type( r ) ~= "number" or r < 0 or r > 255 then r = 255 end if not g or type( g ) ~= "number" or g < 0 or g > 255 then g = 255 end if not b or type( b ) ~= "number" or b < 0 or b > 255 then b = 255 end if not maxDistance or type( maxDistance ) ~= "number" or maxDistance <= 1 then maxDistance = 12 end local textElement = createElement( "text" ); if textElement then setElementData( textElement, "text", text ); setElementData( textElement, "x", x ); setElementData( textElement, "y", y ); setElementData( textElement, "z", z ); setElementData( textElement, "scale", scale ); setElementData( textElement, "font", font ); setElementData( textElement, "rgba", { r, g, b, 255 } ); setElementData( textElement, "maxDistance", maxDistance ); return textElement end return false end addEventHandler( "onClientRender", root, function( ) local texts = getElementsByType( "text" ); if #texts > 0 then local pX, pY, pZ = getElementPosition( localPlayer ); for i = 1, #texts do local text = getElementData( texts[i], "text" ); local tX, tY, tZ = getElementData( texts[i], "x" ), getElementData( texts[i], "y" ), getElementData( texts[i], "z" ); local font = getElementData( texts[i], "font" ); local scale = getElementData( texts[i], "scale" ); local color = getElementData( texts[i], "rgba" ); local maxDistance = getElementData( texts[i], "maxDistance" ); if not text or not tX or not tY or not tZ then return end if not font then font = "default" end if not scale then scale = 2 end if not color or type( color ) ~= "table" then color = { 255, 255, 255, 255 }; end if not maxDistance then maxDistance = 12 end local distance = getDistanceBetweenPoints3D( pX, pY, pZ, tX, tY, tZ ); if distance <= maxDistance then local x, y = getScreenFromWorldPosition( tX, tY, tZ ); if x and y then dxDrawText( text, x, y, _, _, tocolor( color[1], color[2], color[3], color[4] ), scale, font, "center", "center" ); end end end end end ); NEED HELP!!
  5. Hello, i have an problem. http://imgur.com/a/yG3ng - that's the problem. Can someone help me in that error? PS. I did MTADiag analyse.
  6. I want to stop the gravity after 5 seconds Gravity changes to 0.0001 but does not return to 0.0008 --client side panel = false function test() dxDrawRectangle(414, 297, 109, 29, tocolor(0, 0, 0, 150), false) dxDrawText("TEST GRAVITY", 414, 297, 523, 326, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end function onClientClick (button,state) if parte1hab and button == "left" and state == "down" then if isCursorOnElement(414, 297, 109, 29) then triggerServerEvent ("Gravity-5s", getLocalPlayer()) end end end addEventHandler("onClientClick",root,onClientClick) function open() if panel == false then addEventHandler ("onClientRender", root, test) panel = true showCursor (true) else removeEventHandler ("onClientRender", root, test) panel = false showCursor (false) end end bindKey("F5", "down", open) --server side function Gravity () setPedGravity(source, 0.0001) setTimer(function() setPedGravity(source, 0.0008) end, 5000, 1) end addEvent("Gravity-5s",true) addEventHandler("Gravity-5s",getRootElement(),Gravity)
  7. Hi someone i know he's having problem with mta he's saying that if he open mta start for a few seconds and after that he's out and back to the desktop any way i have asked him to use mta diag and didn't help so i'm looking for someone give me a solution for that here's his mta diag link : https://pastebin.mtasa.com/751466372 Regards! @ccw @Jusonex @Dutchman101 @Anyone knows a solution for that would be great
  8. Hello any1 knows how to add more guns on server? I have dayz server and i would like to get some help. Just tell me here or contact me if you know how to script.
  9. Por favor pasenme paquete de RP para abrir un servidor de paquetes necesitan sus mods de ayuda lo que me ayuda a abrir un servidor
  10. Guys i scripted a command of disable warp its done but i need a idea how to add kaise kare f1 panel me kisko hata hai kya idea hai kisko ? Ye correct hai nah? function warpStatus(player,cmd) if player then if (getElementData(player,"warp.status") == false) then setElementData(player, "warp.status", true) outputChatBox("You have enabled your warping", player) else setElementData(player, "warp.status", false) outputChatBox("You have disabled warping", player) end end end addCommandHandler("warpstatus", warpStatus) function warpMe(targetPlayer) if (getElementData(targetPlayer,"warp.status") == false) then 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 local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end
  11. Well title says it all, check this GUIEditor = { gridlist = {}, window = {}, button = {} } GUIEditor.window[1] = guiCreateWindow(0.04, 0.22, 0.40, 0.71, "My Inventory", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(0.03, 0.07, 0.93, 0.82, true, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Item", 0.5) guiGridListAddColumn(GUIEditor.gridlist[1], "Amount", 0.5) GUIEditor.button[1] = guiCreateButton(0.03, 0.89, 0.31, 0.08, "Use", true, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(0.66, 0.89, 0.31, 0.08, "Drop", true, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") guiSetVisible (GUIEditor.window[1], false) PR = { label = {}, progressbar = {} } PR.progressbar[1] = guiCreateProgressBar(0.18, 0.47, 0.64, 0.06, true) PR.label[1] = guiCreateLabel((516 - 101) / 2, (34 - 16) / 2, 101, 16, "Using Repair Kit...", false, PR.progressbar[1]) guiSetFont(PR.label[1], "default-bold-small") guiLabelSetColor(PR.label[1], 1, 126, 253) guiProgressBarSetProgress(PR.progressbar[1], 0) guiSetVisible (PR.progressbar[1], false) function openGUI (result) if guiGetVisible (GUIEditor.window[1]) == true then guiSetVisible (GUIEditor.window[1], false) showCursor (false) guiGridListClear (GUIEditor.gridlist[1], true) outputChatBox ("Bag closed successfully !", 255,0,0) else guiSetVisible (GUIEditor.window[1], true) showCursor (true) guiGridListClear (GUIEditor.gridlist[1], true) outputChatBox ("Bag opened successfully !", 255,255,0) for k,v in ipairs (result) do local row1 = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], row1, 1, v["itemname"] , false, false) guiGridListSetItemText(GUIEditor.gridlist[1], row1, 2, v["amoun"] , false, false) end end end addEvent ("onOpenGUI", true) addEventHandler ("onOpenGUI", root, openGUI) function useObject () local item = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), 1) local amount = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), 2) if (source == GUIEditor.button[1]) then if item == "Medic Kits" then if tonumber(amount) > 0 then local pHp = getElementHealth (localPlayer) if tonumber (pHp) < 100 then guiSetVisible (PR.progressbar[1], true) guiSetText (PR.label[1], "Using Medic Kit...") guiProgressBarSetProgress(PR.progressbar[1], 0) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 20)end,500,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 40)end,1000,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 60)end,1500,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 80)end,2000,1) setTimer (function ()setElementHealth (localPlayer, pHp+30) guiProgressBarSetProgress (PR.progressbar[1],100) guiSetVisible (PR.progressbar[1], false)end,2500,1) triggerServerEvent ("onUse", localPlayer, item) outputChatBox ("You have taken 1 Medic Kit It will take effect in 5 seconds.", 255,255,255) guiSetVisible (GUIEditor.window[1], false) showCursor (false) else outputChatBox ("Your HP is full!", 255,0,0) end end elseif item == "Food" then if tonumber(amount) > 0 then local pHp = getElementHealth (localPlayer) if tonumber (getElementHealth (localPlayer)) < 100 then guiSetVisible (PR.progressbar[1], true) guiSetText (PR.label[1], "Eating some food...") guiProgressBarSetProgress(PR.progressbar[1], 0) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 20)end,500,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 40)end,1000,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 60)end,1500,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 80)end,2000,1) setTimer (function ()setElementHealth (localPlayer, pHp+10) guiProgressBarSetProgress (PR.progressbar[1],100) guiSetVisible (PR.progressbar[1], false)end,2500,1) triggerServerEvent ("onUse", localPlayer, item) outputChatBox ("You have taken some Food It will take effect in 5 seconds.", 255,255,255) guiSetVisible (GUIEditor.window[1], false) showCursor (false) else outputChatBox ("Your HP is full!", 255,0,0) end end elseif item == "Repair Kits" then if tonumber(amount) > 0 then local vehicle = getPedOccupiedVehicle (localPlayer) local vehHP = getElementHealth (vehicle) if (vehicle) then if tonumber (vehHP) < 1000 then guiSetVisible (PR.progressbar[1], true) setElementFrozen (localPlayer, true) guiProgressBarSetProgress(PR.progressbar[1], 0) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 20)end,500,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 40)end,1000,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 60)end,1500,1) setTimer (function () guiProgressBarSetProgress(PR.progressbar[1], 80)end,2000,1) setTimer (function () setElementHealth (vehicle, vehHP+250) guiProgressBarSetProgress (PR.progressbar[1],100) guiSetVisible (PR.progressbar[1], false) setElementFrozen (localPlayer, false)end,2500,1) triggerServerEvent ("onUse", localPlayer, item) outputChatBox ("You have taken 1 Repair Kit It will take effect in 5 seconds.", 255,255,255) guiSetVisible (GUIEditor.window[1], false) showCursor (false) else outputChatBox ("Your Vehicle's HP is full!", 255,0,0) end else outputChatBox ("You're not in a vehicle!",255,0,0) end end else outputChatBox ("You either can't use this item or you have 0 units of this item !" ,255,0,0) end end end addEventHandler ("onClientGUIClick", root, useObject) function dropItem () local item = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), 1) local x,y,z = getElementPosition (localPlayer) if (source == GUIEditor.button[2]) then if (item) then if item == "Medic Kits" then pickUp = createPickup ( x, y, z, 3, 1240 ) outputChatBox ("You have dropped a Medic Kit !",255,255,255) guiSetVisible(GUIEditor.window[1], false) showCursor(false) dropped = "Medic Kits" triggerServerEvent ("onUse", localPlayer, item) elseif item == "Repair Kits" then pickUp = createPickup ( x, y, z, 3, 1277 ) outputChatBox ("You have dropped a Repair Kit !",255,255,255) guiSetVisible(GUIEditor.window[1], false) showCursor(false) dropped = "Repair Kits" triggerServerEvent ("onUse", localPlayer, item) elseif item == "Food" then pickUp = createPickup ( x, y, z, 3, 2212 ) outputChatBox ("You have dropped some food !",255,255,255) guiSetVisible(GUIEditor.window[1], false) showCursor(false) dropped = "Food" triggerServerEvent ("onUse", localPlayer, item) elseif item == "Wood" then pickUp = createPickup ( x, y, z, 3, 1448 ) outputChatBox ("You have dropped wood !",255,255,255) guiSetVisible(GUIEditor.window[1], false) showCursor(false) dropped = "Wood" triggerServerEvent ("onUse", localPlayer, item) elseif item == "Oil" then pickUp = createPickup ( x, y, z, 3, 1217 ) outputChatBox ("You have dropped some Oil !",255,255,255) guiSetVisible(GUIEditor.window[1], false) showCursor(false) dropped = "Oil" triggerServerEvent ("onUse", localPlayer, item) else pickUp = createPickup ( x, y, z, 3, 1279 ) outputChatBox ("You have dropped a ".. item .." !",255,255,255) guiSetVisible(GUIEditor.window[1], false) showCursor(false) dropped = item triggerServerEvent ("onUse", localPlayer, item) end end end end addEventHandler ("onClientGUIClick", root, dropItem) function takeObject () triggerServerEvent ("onTakeObject", localPlayer, dropped) end addEventHandler ("onClientPickupHit", pickUp, takeObject)
  12. function onPlayerMoveItemOutOfInventory () if playerMovedInInventory then startRollMessage2("Inventory", "Abusing exploits will result in a ban!", 255, 22, 0 ) return end -- [ID:0000005 - Several grammar + spelling mistakes and typos] //L local itemName = guiGridListGetItemText ( gridlistItems["inventory"], guiGridListGetSelectedItem ( gridlistItems["inventory"] ), 1 ) if getElementData(getLocalPlayer(),itemName) and getElementData(getLocalPlayer(),itemName) >= 1 then if isPlayerInLoot() then local isVehicle = getElementData(isPlayerInLoot(),"vehicle") local isTent = getElementData(isPlayerInLoot(),"tent") if isVehicle and not isTent then local veh = getElementData(isPlayerInLoot(),"parent") local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh)) if itemName == "Tire" and (getElementData(isPlayerInLoot(),"Tire_inVehicle") or 0) < tires or itemName == "Engine" and (getElementData(isPlayerInLoot(),"Engine_inVehicle") or 0) < engine or itemName == "Tank Parts" and (getElementData(isPlayerInLoot(),"Parts_inVehicle") or 0) < parts then if itemName == "Tank Parts" then itemName = "Parts" end triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName.."_inVehicle",isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) elseif isToolbeltItem(itemName) then triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) elseif getLootCurrentSlots(getElementData(getLocalPlayer(),"currentCol")) + getItemSlots(itemName) <= getLootMaxAviableSlots(isPlayerInLoot()) then triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) else startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0 ) return end elseif isToolbeltItem(itemName) then triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) elseif getLootCurrentSlots(getElementData(getLocalPlayer(),"currentCol")) + getItemSlots(itemName) <= getLootMaxAviableSlots(isPlayerInLoot()) then triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) else startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0 ) return end else triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) end end local gearName = guiGetText(headline["loot"]) local col = getElementData(getLocalPlayer(),"currentCol") setTimer(refreshInventory,200,2) if isPlayerInLoot() then setTimer(refreshLoot,200,2,col,gearName) end end addEventHandler ( "onClientGUIClick", buttonItems["inventory"], onPlayerMoveItemOutOfInventory ) How i can chane it to drop all loot? Any scripts? function onPlayerMoveItemInInventory () local itemName = guiGridListGetItemText ( gridlistItems["loot"], guiGridListGetSelectedItem ( gridlistItems["loot"] ), 1 ) if isPlayerInLoot() then if getElementData(isPlayerInLoot(),itemName) and getElementData(isPlayerInLoot(),itemName) >= 1 then if not isToolbeltItem(itemName) then if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then if not playerMovedInInventory then triggerEvent("onPlayerMoveItemInInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) else startRollMessage2("Inventory", "Abusing exploits will result in a ban!", 255, 22, 0 ) return end else startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0 ) return end else playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) triggerEvent("onPlayerMoveItemInInventory",getLocalPlayer(),itemName,isPlayerInLoot()) end end if isPlayerInLoot() then local gearName = guiGetText(headline["loot"]) local col = getElementData(getLocalPlayer(),"currentCol") setTimer(refreshInventory,200,2) setTimer(refreshLoot,200,2,col,gearName) end end end addEventHandler ( "onClientGUIClick", buttonItems["loot"], onPlayerMoveItemInInventory ) How i can chane it to take all loot? Any scripts?
  13. Hello, I try make a special admin command that sends admin message (/aMSG <message to send>) but I have problems with this. I make it as a part of one .lua script file with rest of chat tags anyway the tags are work fine but when I send the command to the server for example "/aMSG Test" it shows me two WARNING and then one ERROR in console. Console error image This is the script: function onSpecialPlayerChat(amsg, commandName) local aAccount = getAccountName(getPlayerAccount(source)); local aName = getPlayerName(source); local aRoot = getRootElement(); if isObjectInACLGroup("user."..aAccount, aclGetGroup("Console")) then cancelEvent(); outputChatBox("*ADMIN* "..amsg.."/ "..aName.." /", aRoot, 255, 255, 255, true); outputServerLog("CHAT: [ADMIN]"..amsg.."/ "..aName.." /"); else outputChatBox("Nemáš prístup k tomuto príkazu", 255, 0, 0); end end addCommandHandler("aMSG", onSpecialPlayerChat); Thanks for all replies.
  14. local screenW, screenH = guiGetScreenSize() local GUIEditor = { button = {}, window = {}, edit = {} } GUIEditor.window[1] = guiCreateWindow(0.35, 0.40, 0.32, 0.12, "Event hírdető panel", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(0.04, 0.68, 0.78, 0.23, "Beírt szöveg kiírása", true, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(0.03, 0.21, 0.93, 0.38, "", true, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(0.84, 0.68, 0.14, 0.23, "Bezár", true, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) guiSetInputMode("no_binds_when_editing") function showGUI() guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end addEvent( "showguii", true ) addEventHandler( "showguii", localPlayer, showGUI ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) addEventHandler("onClientGUIClick", GUIEditor.button[1], function ( ) text1 = guiGetText ( GUIEditor.edit[1] ) --text2 = guiGetText ( valasz1 ) --text3 = guiGetText ( valasz2 ) if text1 ~= "" then triggerServerEvent( "server",localPlayer,text1 ) setTimer ( function( ) text1 = nil end,5000, 1 ) end end,false ) addEventHandler ( 'onClientRender',root, function ( ) dxDrawText(text1, (screenW * 0.2924) + 1, (screenH * 0.3778) + 1, (screenW * 0.7014) + 1, (screenH * 0.5400) + 1, tocolor(0, 0, 0, 255), 2.50, "default-bold", "left", "top", false, true, false, false, false) dxDrawText(text1, screenW * 0.2924, screenH * 0.3778, screenW * 0.7014, screenH * 0.5400, tocolor(0, 186, 255, 255), 2.50, "default-bold", "left", "top", false, true, false, false, false) end ) the dx text why not show on all players screen? o-O
  15. Hello Guys, I just want to write a camera system like in GTA 5. (The Camera is closer to the player, etc) So i can aim with any weapon, but not rotating the ped. Cannot look around, cannot look up, or down when aiming. Any Ideas? local camera = {} local currentCameraView = 1 local cameraView = {} cameraView[1] = 1.2 --SimpleControl cameraView[2] = 6.5 --InVehicle camera.dist = cameraView[currentCameraView] camera.speed = 4 camera.x = math.rad(60) camera.y = math.rad(60) camera.z = math.rad(15) camera.maxZ = math.rad(89) camera.minZ = math.rad(-45) addEventHandler("onClientPreRender", getRootElement(), function() x, y, z = getElementPosition(localPlayer) z = z + 0.2 local camDist = camera.dist local cosZ = math.cos(camera.z) camX = x + math.cos(camera.x)*camDist*cosZ camY = y + math.sin(camera.y)*camDist*cosZ camZ = z + math.sin(camera.z)*camDist setCameraMatrix(camX, camY, camZ + 0.2, x + 0.1, y + 0.1, z + 0.2) end) addEventHandler("onClientCursorMove", getRootElement(), function(curX, curY, absX, absY) local diffX = curX - 0.5 local diffY = curY - 0.5 local camX = camera.x - diffX*camera.speed local camY = camera.y - diffX*camera.speed local camZ = camera.z + (diffY*camera.speed)/math.pi if(camZ > camera.maxZ)then camZ = camera.maxZ end if(camZ < camera.minZ)then camZ = camera.minZ end camera.x = camX camera.y = camY camera.z = camZ end) function isItInVeh() isitin = isPedInVehicle(localPlayer) if isitin == true then currentCameraView = 2 else currentCameraView = 1 end camera.dist = cameraView[currentCameraView] end addEventHandler("onClientPreRender", getRootElement(), isItInVeh) bindKey("mouse_wheel_down", "down", function() cameraView[1] = cameraView[1] + 0.1 if(cameraView[1] >= 2.5)then cameraView[1] = 2.5 end camera.dist = cameraView[currentCameraView] end) bindKey("mouse_wheel_up", "down", function() cameraView[1] = cameraView[1] - 0.1 if(cameraView[1] <= 1.2)then cameraView[1] = 1.2 end camera.dist = cameraView[currentCameraView] end) bindKey("mouse_wheel_down", "down", function() cameraView[2] = cameraView[2] + 0.4 if(cameraView[2] >= 12.5)then cameraView[2] = 12.5 end camera.dist = cameraView[currentCameraView] end) bindKey("mouse_wheel_up", "down", function() cameraView[2] = cameraView[2] - 0.4 if(cameraView[2] <= 6)then cameraView[2] = 6 end camera.dist = cameraView[currentCameraView] end) addEventHandler("onClientRender", getRootElement(), function() if isCursorShowing() then camera.speed = 0 elseif isChatBoxInputActive() then camera.speed = 0 else camera.speed = 4 end end) -----------------------------The Aiming Magic bindKey("aim_weapon", "down", function() outputChatBox("Aiming") end) bindKey("aim_weapon", "up", function() outputChatBox("Not Aiming") end)
  16. Who recommended me a script for Halloween RPG server? Done plz
  17. Hello guys, i recently setuped up my own dayz server, but i need to add like more vehicles i have some vehicles.lua and there are cars adn ther x,y,z i guess its spawn how can i add more? or can some1 just give me some pre-scripted vehicles.lua so i dont have to type it or something? i want more cars on my server basicaly , which players can find and get
  18. Good come to know if there is a script or a function that allows me to give more speed to the cars of a team, any car using the user of that team have for example a 15% extra speed as the damage of weapons .
  19. Hello there. I created a theme some weeks ago, and the problem is that there is a white rectangle at the bottom of the screen. After some searching, I found out that a file called mta_filler was responsible for this. As you expected, I removed the file, but the rectangle was still there. Is there a way to remove this rectangle? Thanks.
  20. So hello. I started up my new server on Dayz i have mod & register/login + admin panel and global chat. But i dont know where to find models for zombies (since i have normal skins from GTA:SA) and how to change them, can you link me and tell me where to replace it? please? :))) + if you can link me even for cars (and i need to spawn somehow cars, like so people can repair it there is no car) and some script for like when i have the name i want before name some title like [VIP]USERNAME + i need some instructions for it. THANKS.
  21. So hello. I started up my new server on Dayz i have mod & register/login + admin panel and global chat. But i dont know where to find models for zombies (since i have normal skins from GTA:SA) and how to change them, can you link me and tell me where to replace it? please? :))) + if you can link me even for cars and some script for like when i have the name i want before name some title like [VIP]USERNAME + i need some instructions for it. THANKS.
  22. Hello, I am scripting a panel that will set people into diffrent dimensions. But i need the code for chaning the Dimension Only, Please Every Answer would be to help. function teleportPlayer() if(source == GUIEditor.button[1]) then local teleportX, teleportY, teleportZ = 1210.48621, 2358.32373, 8.01253 setElementPosition(getLocalPlayer(), teleportX, teleportY, teleportZ) outputChatBox("You Have Been Set To The Arabian Server") end end addEventHandler("onClientGUIClick", root, teleportPlayer) ------------------------- function teleportPlayer() if(source == GUIEditor.button[2]) then local teleportX, teleportY, teleportZ = 1923.0625, -1760.005859375, 13.546875 setElementPosition(getLocalPlayer(), teleportX, teleportY, teleportZ) outputChatBox("You Have Been Set To The English Server") end end addEventHandler("onClientGUIClick", root, teleportPlayer)
  23. I've been searching for a MySQL tips and noticed there is no such topics on this forum. So let's fix this little problem. I want to know more about optimising MySQL queries and how to interract with MySQL correctly, I am newbie in that. I learned that putting queries in the loop it's too performance-expensive, wrong, and very big chance it'll freeze your server for uncertain time. So if I want to get information from DB for a many players, better to make it using only 1 query. Example: "SELECT * FROM race_stats WHERE playerID IN(??)" Where "??" = table with logged in players. But, what if I want to update information for a many players at the same time? How such query should look like? For 1 player it looks like this: "UPDATE race_stats SET id1 = id1 + ?, id2 = id2 + ?, id3 = id3 + ?, id4 = id4 + ?, id5 = id5 + ? WHERE playerID = ?" But how to make the same for all players? Put query in the loop will be too performance-expensive I guess and will create laggs. P.S. Maybe for such thing as player stats better to learn MySQL procuderes and create procedure for this, I am newbie, just asking. Don't even know what is procedures exactly, just heard about it.
  24. Hello, I have a small problem with models that are on the ground old one works greate but it was old GTA SA models so I have to chang it to new one becouse of my server all works fine but when I for example drop some item to ground or make fireplace all models are small and I need it like old ones. What is the problem?! Please help me I try everithing and no changes. PS: I'm sorry if there are some mistakes but English is not so good. If you do not understand something just ask I'll try to explain.
  25. Hola soy nuevo en esta comunidad, espero que me puedan ayudar, bueno lo que quiero hacer es un auto respawn de autos que diga en el chat vehiculos restaurados en 10 segundos y todos los vehiculos han sido restaurados algo haci pues. Hi I am new to this community, I hope you can help me, well I want to do is a car auto respawn read in the car chat restored in 10 seconds and all vehicles have been restored as something. primero este script no es mio lo encontre en mta resources y queria modificarlo y eso pero no me funciona local rElement = getRootElement() function respawnVehicles(player, cmd, seconds) if tonumber(seconds) then if not hasObjectPermissionTo(player, "function.banPlayer") then outputChatBox("This command is only executeable for administrators", player, 255, 0, 0, false) return end outputChatBox("** All unoccupied vehicles will be respawned in " .. seconds .. " seconds **", rElement, 220, 220, 0, false) setTimer(function (player) local vehicles = getElementsByType ( "vehicle" ) outputChatBox("** All unoccupied vehicles respawned **", rElement, 220, 220, 0, false) outputDebugString(getPlayerName(player) .. " respawned vehicles.") for k, vehicle in ipairs ( vehicles ) do if isEmpty( vehicle ) then respawnVehicle ( vehicle ) end end end, seconds * 1000, 1, player) else outputChatBox("Syntax: /respawn ", player, 220, 220, 0, false) end end addCommandHandler("respawn",respawnVehicles) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end