-
Posts
31 -
Joined
-
Last visited
Everything posted by Andrew75t
-
Hello all. help me please to implement the rotation of the minigun by 40 degrees. I want the minigun to look forward and can to turn 20 degrees to the left and 20 degrees to the right. Now it can rotate the minigun 180 degrees around its axis, but I'm not sure what is right, help me to limit the rotation of the machine gun. this is the part of the code for rotate the minigun 180 degrees: local aimSensitivity = 30; function rotateGun_Handler(cX, cY, aX, aY, wX, wY, wZ) local oX, oY, oZ, oRX, oRY, oRZ = getElementRotation (weapon); if (oRZ-((cX-0.5)*aimSensitivity) > 30 or oRZ-((cX-0.5)*aimSensitivity) < 80) then oRZ = oRZ-((cX-0.5)*aimSensitivity); end setCameraTarget(weapon,localPlayer) setElementAttachedOffsets(weapon, oX, oY, oZ, oRX, oRY, oRZ); setCursorPosition(screenW/2, screenH/2); end addEventHandler( "onClientCursorMove", getRootElement( ), rotateGun_Handler)
-
Hello all. Please tell me, how i can make a clothing system with the help of shaders? Please explain the principle itself and if possible,show me just an example with the replacement of an element of clothing.
-
on the one server I saw a character with this animations. How can i do this?
-
@Tut, Please tell me, in which section i can post this information?
-
Hello to all. My name is Andrei, I have been working with raster and vector graphics for many years. I am looking for a peoples to whom I could help in develop of project. I can work with textures, the design of the server and pages in social networks - to give a unique look to the project, in general, I can take over everything related to graphics. If someone needs such a person for a team, I am ready to work with you. I'm waiting your messages in private messages
-
Доброго времени суток всем. Меня зовут Андрей, я работаю с растровой и векторной графикой много лет. Я ищу коллектив, которому я смог бы помогать развивать проект. Я могу работать с текстурами, оформлением сервера и страниц в соц сетях - придать уникальный вид проекту, в общем все что связанно с графикой я могу взять на себя. Если кому то требуется такой человек в команду я готов работать с вами. Жду сообщений в лс
-
Доброго времени суток любителям гта. Подскажите пожалуйста есть ли какая нибудь информация по мультиплееру для GTA:SA Definitive Edition ? Сможем ли мы поиграть в обновленную гта са по интернету на своих серверах или это будет исключительно синглплеер ?
-
yes, with a shader. I have a model for the sultan, and paint work for it (sultan1.txd). I want to apply this paint job. but I don't know how to replace the default paint job. @DNL291
-
Hello all, tell me please. How i can replace default paint jobs on the customs?
-
I have a script-chec k, if the player has a sniper rifle in his hands and he is aiming, then a message is displayed in the chat. In the sight I see the model of the object (id 321) that I replaced and attached using bone_attach. I want it to become transparent in aiming mode. How do I apply setElementAlpha to this object? I made a transparent texture for the default rifle (id 34). And with the help of bone_attach, I attached the object (id 321), which I replaced with the new SVD model. When I am in aiming mode I see the SVD model, I need to make it transparent (invisible) Client side: function aimAction (key, state) if (getPedWeapon (localPlayer) ~= 34) then return end outputChatBox ("You are aiming now", 255, 0, 0) for control in pairs (getBoundControls(key)) do setPedControlState (control, false) end end bindKey ("mouse2", "down", aimAction) Server side: function attachSVD (thePlayer) local x, y, z = getElementPosition (thePlayer) local objPick = createObject (321, x, y, z) setTimer (function (thePlayer) giveWeapon ( thePlayer, 34, 200, true ) exports.bone_attach:attachElementToBone (objPick, thePlayer, 12, 0, 0, 0, 0, -90, 0) end, 1000, 1, thePlayer) end addCommandHandler ("svd", attachSVD) Repale models: function replaceWeapon() -- Invisible defolt sniper riflle txd = engineLoadTXD ( "mdls/weapons/sniper_rifle/sniper.txd" ) engineImportTXD ( txd, 358) -- SVD model -- txd = engineLoadTXD ( "mdls/weapons/sniper_rifle/svd.txd" ) engineImportTXD ( txd, 321) dff = engineLoadDFF ( "mdls/weapons/sniper_rifle/svd.dff") engineReplaceModel ( dff, 321) end addEventHandler ( "onClientResourceStart", resourceRoot, replaceWeapon)
-
Thank you.Everything works for me, but I think there are errors in the code. What do you advise? I read the wiki, looked at examples and this is what came out for me: Client: local function BuyPistol() triggerServerEvent("Pistol",getLocalPlayer()) end addEventHandler("onClientGUIClick", button_weapon_shop_PISTOL, BuyPistol, false) Server: addEvent("Pistol", true) addEventHandler("Pistol",root, function() local PlayerMoney = getPlayerMoney(source) if ( PlayerMoney >= 2000) then takePlayerMoney(source,2000) giveWeapon ( source , 22, 30, true ) outputChatBox ( "#00FF00* [ "..getPlayerName(source) .." #00FF00] Has Bought Pistol ", source, 255, 0, 0, true ) else outputChatBox("need more money.", source, 255, 0, 0, true ) end end)
-
Hello all. I made a dialog box and made a "BUY WEAPON" button in it. But I don’t know how to buy a weapon when the button is pressed -- WEAPON WHOP GUI-- local window_weapon_shop = guiCreateWindow(0.225, 0.225, 0.60, 0.60, "Weapon Shop", true) guiWindowSetSizable(window_weapon_shop, false) guiSetVisible(window_weapon_shop,false) -- buttons -- local button_weapon_shop_PISTOL = guiCreateButton(0.040, 0.355, 0.20, 0.060, "450$ BUY GUN", true, window_weapon_shop) -- CLOSE WINDOW-- local button_weapon_shop_close = guiCreateButton(0.37, 0.875, 0.25, 0.075, "Close window", true, window_weapon_shop) addEvent("showGUI",true) addEventHandler("showGUI",getRootElement(), function () if ( guiGetVisible(window_weapon_shop) == false ) then guiSetVisible(window_weapon_shop,true) showCursor(true) end end) local function click() guiSetVisible(window_weapon_shop, false) showCursor(false, false) end addEventHandler("onClientGUIClick", button_weapon_shop_close, click, false)
-
Thanks, you are helped me a lot.
-
I created a gui, it opens when the player logs into the server. How do I make the window open when the player steps on the marker? Client function createWSWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 WSWindow = guiCreateWindow(X, Y, Width, Height, "WEAPONSHOP", true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createWSWindow() end ) function createWSWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 WSWindow = guiCreateWindow(X, Y, Width, Height, "WEAPONSHOP", true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createWSWindow() end ) Server local WeaponShopMarker = createMarker(1790.7, -1699.3, 12.6, "cylinder", 2.5, 0, 0, 0, 50) addEventHandler("onMarkerHit", WeaponShopMarker, function(ThePlayer) addPedClothes ( ThePlayer, "tshirtzipcrm", "tshirt", 0 ) end)
-
it is perfectly. Thanks a lot to everyone who answered. You helped me a lot.
-
I managed to set bone_attach. I was able to set the model in the hands of the character as I needed. But in aiming mode, I see the attached weapon model. How can you remove it in aiming mode?
-
Investor, please, tell me how i can to do it right?
-
Hey. Do I must attach objects to weapon or to the player's hands? When I try to attach an object to a player, I get the ERROR. I made the standard rifle model invisible. But I don't know how to attach object to this sniper rifle exports error: Call to non-running server resource (bone_attach) [string "?"] im use this code function attachCash (thePlayer) local x, y, z = getElementPosition (thePlayer) setPedAnimation (thePlayer, "ROB_BANK", "CAT_Safe_Rob", -1, true, false, false) local objPick = createObject (1550, x, y, z) setTimer (function (thePlayer) setPedAnimation (thePlayer, nil) exports.bone_attach:attachElementToBone (objPick, thePlayer, 4, -0.3, 0.2, 0, -125, 0, 0) end, 1000, 1, thePlayer) end addCommandHandler ("getbag", attachCash)
-
ok, thanks for the recommendations.
-
Hello all. question about replacing models. I want to replace the standard sniper rifle model, there will be three models to choose from. If i choose one model, and if another player chooses the second one. Will I see only the model that I have chosen or will I see both mine and his? is it possible to implement it on the server?
-
Thanks for the answer. I found a solution: I had to go to phpmyadmin and give the user all rights in the Users tab. The error was that the user lacked rights. Because of this, I was unable to connect to the database. Have a nice day and fewer bugs in the code!
-
Please tell me why can't I connect to the database? Using local Denver server Starting loginPanel [2020-08-11 23:38:55] WARNING: loginPanel\server.lua:15: Bad usage @ 'dbConnect' [Access denied for user 'username'@'localhost' (using password: YES)] [2020-08-11 23:38:55] INFO: Connection with database couldn't be established. [2020-08-11 23:38:55] start: Resource 'loginPanel' started
-
SpecT, I did what was needed, everything works. but i noticed when i log into the server for the first time after starting the server i see a black screen. but if I go to the server without restarting the server itself, then everything works correctly, the camera is directed where the authorization system appears. Therefore, when I indicated the coordinates I needed and saw a black screen, I thought that I had made a mistake somewhere. I think mta does not have time to download everything and I see only a black screen. what do you think it might be connected with?
-
Hello all. Please tell me, why I see only a black screen if I change coordinates in setCameraMatrix ? local window addEvent('login-menu:open', true) addEventHandler('login-menu:open', root, function () -- fade their camera in setCameraMatrix (0, 0, 100, 0, 100, 50) fadeCamera(true) -- initialize the cursor showCursor(true, true) guiSetInputMode('no_binds') -- open our menu local x, y, width, height = getWindowPosition(400, 230) window = guiCreateWindow(x, y, width, height, 'Login to Our Server', false) guiWindowSetMovable(window, false) guiWindowSetSizable(window, false) local usernameLabel = guiCreateLabel(15, 30, width - 30, 20, 'Username:', false, window) local usernameErrorLabel = guiCreateLabel(width - 130, 30, 140, 20, 'Username is required', false, window) guiLabelSetColor(usernameErrorLabel, 255, 100, 100) guiSetVisible(usernameErrorLabel, false) local usernameInput = guiCreateEdit(10, 50, width - 20, 30, '', false, window) local passwordLabel = guiCreateLabel(15, 90, width - 30, 20, 'Password:', false, window) local passwordErrorLabel = guiCreateLabel(width - 125, 90, 140, 20, 'Password is required', false, window) guiLabelSetColor(passwordErrorLabel, 255, 100, 100) guiSetVisible(passwordErrorLabel, false) local passwordInput = guiCreateEdit(10, 110, width - 20, 30, '', false, window) guiEditSetMasked(passwordInput, true) local loginButton = guiCreateButton(10, 150, width - 20, 30, 'Login', false, window) addEventHandler('onClientGUIClick', loginButton, function (button, state) if button ~= 'left' or state ~= 'up' then return end local username = guiGetText(usernameInput) local password = guiGetText(passwordInput) local inputValid = true if not isUsernameValid(username) then guiSetVisible(usernameErrorLabel, true) inputValid = false else guiSetVisible(usernameErrorLabel, false) end if not isPasswordValid(password) then guiSetVisible(passwordErrorLabel, true) inputValid = false else guiSetVisible(passwordErrorLabel, false) end if not inputValid then return end triggerServerEvent('auth:login-attempt', localPlayer, username, password) end, false) local registerButton = guiCreateButton(10, 190, width / 2 - 15, 30, 'Sign Up', false, window) addEventHandler('onClientGUIClick', registerButton, function () triggerEvent('login-menu:close', localPlayer) triggerEvent('register-menu:open', localPlayer) end, false) local forgotPasswordButton = guiCreateButton(width / 2 + 5, 190, width / 2 - 15, 30, 'Forgot Password', false, window) addEventHandler('onClientGUIClick', forgotPasswordButton, function () outputChatBox('Coming soon.', 100, 100, 255) end, false) end, true) addEvent('login-menu:close', true) addEventHandler('login-menu:close', root, function () destroyElement(window) showCursor(false) guiSetInputMode('allow_binds') end)