-
Posts
605 -
Joined
-
Last visited
-
Days Won
1
Everything posted by JeViCo
-
Hi everyone! I can't understand at least one thing here: When player press button "0" his weapon slot switch to fist. I almost made it. I don't know how to import slot number from client side I made like this pressedkey = weap_slot and then setPedWeaponSlot(source,button) // variable button is undefined and then i triggered client event. I have no ideas. If i trigger client, engine looks like client(setPedWeaponSlot)->server(call client slot variable)->client(returns)->server(execute)->client or i can do it in eazier way?
-
Hi, i have such problem as car definition client-side. Here my spawn part on server-side: function creatVehicleFromPlayerData (model,x,y,z,rx,ry,rz) vehicle = createVehicle(model,x,y,z,rx,ry,rz) if colorR and colorG and colorB then setVehicleColor(vehicle,colorR,colorG,colorB) end end I can't find how can i point at car when it spawns. client-side part: local player = getLocalPlayer ( ) -- get a local player local x, y, z = getElementPosition ( player ) -- retrive the player's position triggerServerEvent("creatVehicleFromPlayerData",getRootElement(),434,x,y,z,rx,ry,rz) setElementVelocity(vehicle,0,0,0) warpPedIntoVehicle(player,vehicle) end SetElementVelocity and warpPedIntoVehicle got nil. Tried to figure it out through admin script, but got nothing. I'm newbie so.... hope for your reply\
-
BUMP!! i opened txd and it works, but not in-game. No conflicts( i use gta sa car models. Half of them works - other have white textures.
-
no i meaned i replace default paintjobs - not add new one( supratxd = engineLoadTXD("jester/jester.txd") engineImportTXD(supratxd, 559) supradff = engineLoadDFF("jester/jester.dff", 559) engineReplaceModel(supradff, 559) supra - toyota supra model(i have 20+ cars in code)
-
Here is 2 problems. 1 - when i change this car, vehicle interior is white(like no textures but txd loaded)// 2 - when i change car paintjobs - changes only spoiler color. Tried to find other models - same thing car paintjob replace paintjob1 = engineLoadTXD ( "jester/jester1.txd" ) engineImportTXD ( paintjob1, 559 ) paintjob2 = engineLoadTXD ( "jester/jester2.txd" ) engineImportTXD ( paintjob2, 559 ) paintjob3 = engineLoadTXD ( "jester/jester3.txd" ) engineImportTXD ( paintjob3, 559 ) paintjob4 = engineLoadTXD ( "jester/jester4.txd" ) engineImportTXD ( paintjob4, 559 )
-
tnx u both so much, i just needed some functions at least . By the way i have a problem with creating dx gui. Dx gui shows after pressed binded key(two times pressed) after that enough to press key 1 time to show/hide gui. What makes it do like that? (sry for poor english knowledge ) full code local screenW, screenH = guiGetScreenSize() local x,y,z = getElementPosition ( getLocalPlayer ( ) ) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function togglePanel() if (dxVisible == false) then dxVisible = true showCursor ( true ) else dxVisible = false showCursor ( false ) end end bindKey("i","down",togglePanel) addEventHandler("onClientRender", root, function () if (dxVisible == true) then -- rectagle + img drawing code end end ) function onClick(button, state) if (dxVisible == true) and (button == "left") and (state == "up") then -- check if dx-rectangle is showing here if isMouseInPosition( 490, 284, 116, 47 ) then --button1 -- change player skin elseif isMouseInPosition( 737, 284, 116, 47 ) then --button2 -- creating vehicle here end end end addEventHandler( "onClientClick", root, onClick )
-
Could somebody give me an example of skin changing with triggering server event? I found only with command\\
-
I want to change player skin(not model). I know functions but need some client,server-sided examples
-
found simple solution. added in client-side triggerServerEvent("creatVehicleFromPlayerData",getRootElement(),562,x,y,z,rx,ry,rz) --562 elegy model server-side script function creatVehicleFromPlayerData (model,x,y,z,rx,ry,rz,number) vehicle = createVehicle(model,x,y,z,rx,ry,rz,number) if colorR and colorG and colorB then setVehicleColor(vehicle,colorR,colorG,colorB) end end addEvent("creatVehicleFromPlayerData",true) addEventHandler("creatVehicleFromPlayerData",getRootElement(),creatVehicleFromPlayerData)
-
i have some client side code which activates on button click. outputChatBox ( "Машина заспавнена!" ) --car spawn createVehicle(434,x,y,z) y = y + 5 playervehicle = getPlayerOccupiedVehicle ( thePlayer ) i want that player will be in car after clicking a button. Also i have no idea what to write on server-side script
-
bump. Now i this button activates even when dx window closed. i think if (button == "left") and (state == "up") then should check it but nope\\\ Full code below local screenW, screenH = guiGetScreenSize() local x,y,z = getElementPosition ( getLocalPlayer ( ) ) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function togglePanel() if (dxVisible == false) then dxVisible = true showCursor ( true ) else dxVisible = false showCursor ( false ) end end bindKey("i","down",togglePanel) addEventHandler("onClientRender", root, function () if (dxVisible == true) then dxDrawImage((screenW - 389) / 2, (screenH - 450) / 2, 389, 450, ":u_panel/sinin_art.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Скин", 489 - 1, 288 - 1, 605 - 1, 327 - 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "center", "top", false, false, false, false, false) dxDrawText("Скин", 489 + 1, 288 - 1, 605 + 1, 327 - 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "center", "top", false, false, false, false, false) dxDrawText("Скин", 489 - 1, 288 + 1, 605 - 1, 327 + 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "center", "top", false, false, false, false, false) dxDrawText("Скин", 489 + 1, 288 + 1, 605 + 1, 327 + 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "center", "top", false, false, false, false, false) dxDrawText("Скин", 489, 288, 605, 327, tocolor(2, 218, 7, 255), 1.20, "bankgothic", "center", "top", false, false, false, false, false) dxDrawText("Панель Управления", 538 + 1, 163 + 1, 817 + 1, 199 + 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Панель Управления", 538, 163, 817, 199, tocolor(0, 221, 15, 255), 1.20, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Авто", 762 - 1, 289 - 1, 878 - 1, 327 - 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Авто", 762 + 1, 289 - 1, 878 + 1, 327 - 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Авто", 762 - 1, 289 + 1, 878 - 1, 327 + 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Авто", 762 + 1, 289 + 1, 878 + 1, 327 + 1, tocolor(0, 0, 0, 255), 1.20, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Авто", 762, 289, 878, 327, tocolor(2, 218, 7, 255), 1.20, "bankgothic", "left", "top", false, false, false, false, false) end end ) function onClick(button, state) if (button == "left") and (state == "up") then -- check if dx-rectangle is showing here if isMouseInPosition( 490, 284, 116, 47 ) then outputChatBox ( "Машина заспавнена!" ) --car spawn createVehicle(434,x,y,z) y = y + 5 elseif isMouseInPosition( 737, 284, 116, 47 ) then outputChatBox ( "Вы сменили скин!" ) --skin change setElementModel ( player, 25) end end end addEventHandler( "onClientClick", root, onClick ) also i have problem with car spawn(car locked and i can't get it) and skin. I don't know how to change it(
-
i just want to show and hide button after it clicked it'd appear with dx window(binded on key) and hide with dx window(also on pressed button) i have function to open/close dx window i just need button/// thing
-
уже бесплатно)) погугли еще кастомные мапы, к ним обычно прилагаются такие
-
My code at the end contains button variables but it defines in 2 cases: 1 - as button1 variable 2 - creates button button1 = guiCreateButton(747, 286, 102, 40, "", false) button2 = guiCreateButton(498, 286, 102, 40, "", false) how can i replace it or prevent creation? i just want make button open and close on pressed key. 1 button changes player skin/2 gives player a car
-
i am looking for example of dx button (rectangle/text). I tried to find info at forum/wiki but nothing understood(( Example (some code show/hide dx window+img+rectangle+text using key "i") --have it (code that spawns car/changes skin on clicked dx rectangle/text --Nothing of it(( local rectangleData = { x = 0, y = 0, width = 100, height = 20 } addEventHandler ( "onClientRender", root, function ( ) dxDrawRectangle ( rectangleData.x, rectangleData.y, rectangleData.width, rectangleData.height, tocolor ( 0, 0, 0, 120 ) ) end ) addEventHandler ( "onClientClick", root, function ( _, _, x, y ) if ( x >= rectangleData.x and x <= rectangleData.x + rectangleData.width and y >= rectangleData.y and y <= rectangleData.y + rectangleData.height ) then outputChatBox ( "On rectangle click!" ) end end ) I found this code but it is long and execute twice in game (noob lvl of lua + russian=poor english+stupid questions sry :3 )
-
Thank you so much!!!it rly works!
-
For example i have dx gui. How can i make it open with pressed button? if i add addEventHandler("onClientRender",dx) it appears and stay on player join. When i add addCommandHandler("dx",dx) it appears on half of second( i don't even know how to combine 2 handlers(scripting level - newbie-noob) sry for poor eng(russia)
-
на мтаресурсе есть в продаже
-
https://i.imgur.com/fGHUHmJ.png ---screenshot of map
- 1 reply
-
- replacement
- map
-
(and 3 more)
Tagged with: