Jump to content

Machine

Members
  • Posts

    248
  • Joined

  • Last visited

Everything posted by Machine

  1. Thanks alot its what i want
  2. it gives lots of bugs man can you just make simple code that when you click on button tigger to server side thats all i want
  3. i tried it didnt work server side addEvent("c_playSound",true) addEventHandler("c_playSound",root, function(google.mp3) triggerClientEvent("c_playSound",root,google.mp3) -- trigger it for everyone end ) Client Side aTab7 = {} aTab7.Tab = guiCreateTab ( "Radio", aTabPanel ) aTab1.Radio = guiCreateButton ( 0.40, 0.0, 0.20, 0.10, "Warning Sound", true, aTab7.Tab, "playSound" ) if ( source == aTab1.Radio ) then triggerServerEvent("c_playSound",localPlayer,google.mp3) addEvent("c_playSound",true) addEventHandler("c_playSound",root, function(google.mp3) playSound(google.mp3) -- now its played for everyone. end )
  4. how to fix? i need it server
  5. hello whats error in this codes Server Side triggerClientEvent( 'playSound',root ) addEvent( 'playSound',true ) addEventHandler( 'playSound',root, function( ) playSound( "google.mp3" ) end ) Client aTab = {} aTab.Tab = guiCreateTab ( "Radio", aTabPanel ) aTab1.Radio = guiCreateButton ( 0.40, 0.0, 0.20, 0.10, "Warning Sound", true, aTab.Tab, "playSound" ) if ( source == aTab1.Radio ) then triggerServerEvent ( playSound ) its just used to make button that when you click on it it trigger to server side and server side make sound i only used that to make sound for all players
  6. Machine

    need help

    how can i defined it can give me the code
  7. Machine

    need help

    function createswatrope() if isPedInVehicle(player) then local myVehicle = getPedOccupiedVehicle(player) if getVehicleName(myVehicle) == "Police Maverick" then local x,y,z = getElementPosition(myVehicle) createSWATRope(x, y, z, 10000) else outputChatBox("Enter Police Maverick!", player, 255, 0, 0) end else outputChatBox("Enter Police Maverick!", player, 255, 0, 0) end end addCommandHandler(machine, createswatrope)
  8. Machine

    Help

    why this code dont work it must when you click u blackbubble come out and say what you said in local Server chat_range=100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","Local") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","Local") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(Local) "..nick..": "..msg,v,r,g,b,true) end end end addCommandHandler("Local",onChat) -------------------------------------------------------------------- local showtime = tonumber(get("chatbubbles.DefaultTime")) local characteraddition = tonumber(get("chatbubbles.PerCharacterAddition")) local maxbubbles = get("chatbubbles.MaxBubbles") if maxbubbles == "false" then maxbubbles = false else maxbubbles = tonumber(maxbubbles) end local hideown = get("chatbubbles.HideOwn") if hideown == "true" then hideown = true else hideown = false end function sendMessageToClient(message,messagetype) if not wasEventCancelled() then if messagetype == 0 or messagetype == 2 then triggerClientEvent("Local",source,message,messagetype) end end end function returnSettings() local settings = { showtime, characteraddition, maxbubbles, hideown } triggerClientEvent(source,"onBubbleSettingsReturn",getRootElement(),settings) end addEventHandler("onPlayerChat",getRootElement(),sendMessageToClient) addEvent("onAskForBubbleSettings",true) addEventHandler("onAskForBubbleSettings",getRootElement(),returnSettings) client local textsToDraw = {} local hideown local showtime local characteraddition local maxbubbles local showthebubbles = true local showthebubbles = true function income(message,messagetype) if source ~= getLocalPlayer() or not hideown then if messagetype == 2 then if getPlayerTeam(source) == getPlayerTeam(getLocalPlayer()) then addText(source,message,messagetype) end else addText(source,message,messagetype) end end end function addText(source,message,messagetype) local notfirst = false for i,v in ipairs(textsToDraw) do if v[1] == source then v[4] = v[4] + 1 notfirst = true end end local infotable = {source,message,messagetype,0} table.insert(textsToDraw,infotable) if not notfirst then setTimer(removeText,showtime + (#message * characteraddition),1,infotable) end end function removeText(infotable) for i,v in ipairs(textsToDraw) do if v[1] == infotable[1] and v[2] == infotable[2] then for i2,v2 in ipairs(textsToDraw) do if v2[1] == v[1] and v[4] - v2[4] == 1 then setTimer(removeText,showtime + (#v2[2] * characteraddition),1,v2) end end table.remove(textsToDraw,i) break end end end function getTextsToRemove() for i,v in ipairs(textsToDraw) do if v[1] == source then removeText(v) end end end function handleDisplay() if showthebubbles then for i,v in ipairs(textsToDraw) do if isElement(v[1]) then if getElementHealth(v[1]) > 0 then local camPosXl, camPosYl, camPosZl = getPedBonePosition (v[1], 6) local camPosXr, camPosYr, camPosZr = getPedBonePosition (v[1], 7) local x,y,z = (camPosXl + camPosXr) / 2, (camPosYl + camPosYr) / 2, (camPosZl + camPosZr) / 2 --local posx,posy = getScreenFromWorldPosition(x,y,z+0.25) local cx,cy,cz = getCameraMatrix() local px,py,pz = getElementPosition(v[1]) local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) local posx,posy = getScreenFromWorldPosition(x,y,z+0.020*distance+0.10) local elementtoignore1 = getPedOccupiedVehicle(getLocalPlayer()) or getLocalPlayer() local elementtoignore2 = getPedOccupiedVehicle(v[1]) or v[1] if posx and distance <= 45 and ( isLineOfSightClear(cx,cy,cz,px,py,pz,true,true,false,true,false,true,true,elementtoignore1) or isLineOfSightClear(cx,cy,cz,px,py,pz,true,true,false,true,false,true,true,elementtoignore2) ) and ( not maxbubbles or v[4] < maxbubbles ) then -- change this when multiple ignored elements can be specified local width = dxGetTextWidth(v[2],1,"default") dxDrawRectangle(posx - (3 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 5,19,tocolor(0,0,0,255)) dxDrawRectangle(posx - (6 + (0.5 * width)),posy - (2 + (v[4] * 20)),width + 11,19,tocolor(0,0,0,40)) dxDrawRectangle(posx - (8 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 15,17,tocolor(0,0,0,255)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (1 + (v[4] * 20)),width + 19,17,tocolor(0,0,0,40)) dxDrawRectangle(posx - (10 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 19,13,tocolor(0,0,0,255)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 1,width + 23,13,tocolor(0,0,0,40)) dxDrawRectangle(posx - (12 + (0.5 * width)),posy - (v[4] * 20) + 4,width + 23,7,tocolor(0,0,0,255)) local r,g,b = 255,255,255 if v[3] == 2 then r,g,b = getTeamColor(getPlayerTeam(v[1])) end dxDrawText(v[2],posx - (0.5 * width),posy - (v[4] * 20),posx - (0.5 * width),posy - (v[4] * 20),tocolor(r,g,b,255),1,"default","left","top",false,false,false) end end end end end end function getServerSettings() triggerServerEvent("onAskForBubbleSettings",getLocalPlayer()) end function saveSettings(settings) showtime = settings[1] characteraddition = settings[2] maxbubbles = settings[3] hideown = settings[4] addEvent("Local",true) addEventHandler("Local",getRootElement(),income) end function toggleBubblesOnOff() showthebubbles = not showthebubbles outputChatBox("Toggled chatbubbles " ..( not showthebubbles and "#FF0000off#FFFFFF." or "#00FF00on#FFFFFF." ),255,255,255,true) end addEventHandler("onClientPlayerQuit",getRootElement(),getTextsToRemove) addEventHandler("onClientRender",getRootElement(),handleDisplay) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),getServerSettings) addEvent("onBubbleSettingsReturn",true) addEventHandler("onBubbleSettingsReturn",getRootElement(),saveSettings) addCommandHandler("chatbubbles",toggleBubblesOnOff)
  9. Machine

    Help

    i make this gate gate1 = createObject(980,-2085.8994140625,-213,37.099998474121,0,0,0) function closedoor() moveObject (gate1, 4000, -2085.8999023438, -213, 29.10000038147 ) end addCommandHandler("move", closedoor) function opendoor() moveObject (gate1, 4000, -2085.8999023438, -213, 37.099998474121 ) end addCommandHandler("move", opendoor) problem is i wanna the 2 function with 1 command only how can i do that cous when i do like this gate dont even move
  10. Thanks Alot to everybody!
  11. it didnt change anthing
  12. Dont Work lol i have 4 files meta.xml image.png client_anim.lua client.lua and client_anim.lua contain Animation.createAndPlay(GUIEditor_Image[1], Animation.presets.guiMove(x, y, time)) but dont work too do i have change this x, y, time pls test it in your pc then send me
  13. didnt work image is created but dont move
  14. GUIEditor_Image[1] = guiCreateStaticImage(389,709,250,57,"image.png",false) Animation.createAndPlay(GUIEditor_Image[1], Animation.presets.guiMove(300, 600, 1000)) addEventHandler ( "onResourceStart", getRootElement(), GUIEditor_Window ) heres new code but didnt work
  15. i wanna make my gui slide to up in slow speed
  16. i used timer didnt work
  17. I wanna make my gui or image slide up but this code dont work GUIEditor_Window = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(235,690,567,78,"",false) guiSetAlpha(GUIEditor_Window[1],0) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Window[2] = guiCreateWindow(699,768,96,48,"",false) GUIEditor_Image[1] = guiCreateStaticImage(389,709,250,57,"image.png",false) guiSetPosition ( GUIEditor_Window[1], 300, 700, false ) addEventHandler ( "onResourceStart", getRootElement(), GUIEditor_Window ) it only set gui position , how to make it slide up help pls
  18. local marker3 = createMarker(2487.1975097656, -1667.08984375, 13.34375, 'cylinder', 2.0, 255, 0, 0, 150) function markerHitLV (hitPlayer) if ( hitPlayer == localPlayer ) then fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end end addEventHandler ("onClientMarkerHit", marker3, markerHitLV) why this code dont work? how to fix
  19. Machine i already know that problem is when you start thats and cous its client only the player who prees button can hear it but i must make it server so everyone can hear it and of cours the player who started it
  20. hey i have created gui but theres something nor working in it Client addEventHandler("onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then triggerServerEvent ( "lol", getLocalPlayer() ) server addEvent( "lol", true ) addEventHandler ( "lol", getRootElement(), song ) function lol ( song ) song = playSound3D("song.mp3", -471.60000610352, -547.79998779297, 24.39999961853, false) end
  21. well i ask you to help me i ask you i made gui with button . i wanna when you prees that button your voice can be hear in Specific places Dont tell me to search in wiki cous i did it 100 times so pls help me
  22. hello all i just wanna say something im looking for some pro scripter to learn me lua and mta scripting Full 100% with of cours sql im ready to pay money for that too
  23. Привет всем Я просто хочу спросить можно ли создать сценарий, который позволит вам записать свой голос и сохранить его в формате mp3 в игре! и я бы очень просим, если его можно сделать голосовой чат, что только можно говорить, нажав кнопку в графическом интерфейсе, что возможно и звук игрок голос может быть в определенных местах Я знаю, моя просьба трудно, но PLS помочь
  24. Hallo, ich möchte nur fragen, ist es möglich, ein Skript, mit dem Sie Ihre Stimme aufzeichnen und speichern Sie sie als MP3 im Spiel erlauben zu erstellen! und ich würde wirklich möglich, wenn seine bitten, Voice-Chat machen, dass nur einer sprechen kann durch Anklicken einer Schaltfläche in einer GUI ist das möglich und der Klang der Stimme Spieler können an bestimmten Orten sein Ich weiß, mein Wunsch ist hart, aber pls help
×
×
  • Create New...