Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Andrew75t's Achievements


Civilian (7/54)



  1. 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
  2. Hello all, tell me please. How i can replace default paint jobs on the customs?
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. it is perfectly. Thanks a lot to everyone who answered. You helped me a lot.
  8. 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?
  9. Investor, please, tell me how i can to do it right?
  10. 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)
  11. 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?
  12. 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!
  13. 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
  • Create New...