Wysłany: 2019-09-01, 21:14
drzewo1902
Wiek: 28 Na forum: 2806 dni Posty: 21
Nick w MP: Draczekk
Siemka, pisz? skrypt kt?ry po klikni?ciu na peda ma wysy?a? losowe wiadomo?ci, z tym ?e nie dzia?a a pedy kt?re mam wy?ej w skrypcie si? usuwaj?. Pomo?ecie?
Kod: local messages = { "F*** off, Punk!", "You're not welcome.", "I'm not selling you anything.", "Find someone else to harrass.", "Get Lost." }
function clickPed(button, state, absX, absY, wx, wy, wz, element)
if getElementData(getLocalPlayer(), "exclusiveGUI") then
return
end
if element and getElementType(element) == "ped" and state=="down" and getElementData(element,"Lucasx2") then
local x, y, z = getElementPosition(getLocalPlayer())
if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=4 then
if true then
triggerServerEvent("onClientClick", element)
else
outputChatBox('[Bot m?wi]: ' .. messages[math.random(1, #messages)
end
end
end
end
addEventHandler("onClientClick", getRootElement(), clickPed, true)
Ostatnio zmieniony przez drzewo1902 2019-09-01, 22:03, w całości zmieniany 4 razy
Wysłany: 2019-09-01, 21:53
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Kilka pyta?:
- czy posidasz elementDat? "exclusiveGUI"
- czy bot posiada elementDat? "Lucasx2"
- czy wiesz, ?e triggerujesz event "onClientClick" (bo tak masz skonstruowany warunek sprawdzaj?cy)
- funkcja outputChatBox nie jest zamkni?ta
Przed wys?aniem tutaj w?tku, sprawdzaj b??dy /debugscript 3 i ewentualnie je tutaj do??czaj.
local messages = { "F*** off, Punk!" , "You're not welcome." , "I'm not selling you anything." , "Find someone else to harrass." , "Get Lost." }
function clickPed ( button , state , absX , absY , wx , wy , wz , element )
if ( getElementData ( getLocalPlayer (), "exclusiveGUI" )) then
return
end
if ( element ) and ( getElementType ( element ) == "ped" ) and ( state == "down" ) and ( getElementData ( element , "Lucasx2" )) then
local x , y , z = getElementPosition ( getLocalPlayer ())
if ( getDistanceBetweenPoints3D ( x , y , z , wx , wy , wz ) <= 4 ) then
outputChatBox ( "Bot m?wi]: " .. messages [ math . random ( #messages)])
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), clickPed , true )
Staraj si? korzysta? tak?e z BBCode: [.lua] [./lua]
Więcej szczegółów
Wystawiono 1 piw(a):drzewo1902
Wysłany: 2019-09-01, 21:59
drzewo1902
Wiek: 28 Na forum: 2806 dni Posty: 21
Nick w MP: Draczekk
Kod: local Lucasx1 = createPed( 25, -1178.75, -291.8232421875, 14.354700088501 )
setPedRotation( Lucasx1, -50 )
setElementDimension( Lucasx1, 550 )
setElementInterior( Lucasx1 , 44 )
setElementData( Lucasx1, "talk", 1, false )
setElementData( Lucasx1, "name", "Lucas West", false )
setPedAnimation ( Lucasx1, "dealer", "dealer_deal", -1, true, false, false )
setElementFrozen(Lucasx1, true)
local Lucasx2 = createPed( 104, -1177.7399902344, -291.01599121094, 14.354700088501 )
setPedRotation( Lucasx2, 122 )
setElementDimension( Lucasx2, 550 )
setElementInterior( Lucasx2 , 44 )
setElementData( Lucasx2, "talk", 1, false )
setElementData( Lucasx2, "name", "Lucas Lewis", false )
setPedAnimation ( Lucasx2, "dealer", "dealer_deal", -1, true, false, false )
setElementFrozen(Lucasx2, true)
local messages = { "F*** off, Punk!", "You're not welcome.", "I'm not selling you anything.", "Find someone else to harrass.", "Get Lost." }
function clickPed(button, state, absX, absY, wx, wy, wz, element)
if getElementData(getLocalPlayer(), "exclusiveGUI") then
return
end
if element and getElementType(element) == "ped" and state=="down" and getElementData(element,"Lucasx2") then
local x, y, z = getElementPosition(getLocalPlayer())
if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=4 then
if true then
triggerServerEvent("onClientClick", element)
else
outputChatBox('[Bot m?wi]: ' .. messages[math.random(1, #messages)
end
end
end
end
addEventHandler("onClientClick", getRootElement(), clickPed, true)
tu jest ca?y kod, mo?esz go jako? przerobi? czy co??
Wysłany: 2019-09-01, 22:03
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Dzi?ki, ?e odpowiedzia?e? na kluczowe pytania dzi?ki kt?rym mo?emy szybko i bezproblemowo rozwi?za? problem.
Fajnie r?wnie?, ?e zobaczy?e? i przetestowa?e? przyk?ad kodu, kt?ry na pewno b?dzie dzia?a?.
Mi?o mi r?wnie?, ?e wykorzysta?e? odpowiednie BBCode (code -> lua).
Przy??? si? chocia? troch? jak ju? sam sobie nie jeste? w stanie poradzi? z takim do?? prostym problemem.
Podmie? ten event, na jedno pytanie ju? sobie odpowiedzia?em sam.
function clickPed ( button , state , absX , absY , wx , wy , wz , element )
if ( element ) and ( getElementType ( element ) == "ped" ) and ( state == "down" ) and ( element == Lucasx2 ) then
local x , y , z = getElementPosition ( getLocalPlayer ())
if ( getDistanceBetweenPoints3D ( x , y , z , wx , wy , wz ) <= 4 ) then
outputChatBox ( "Bot m?wi]: " .. messages [ math . random ( #messages)])
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), clickPed , true )
Więcej szczegółów
Wystawiono 1 piw(a):drzewo1902
Wysłany: 2019-09-01, 22:10
drzewo1902
Wiek: 28 Na forum: 2806 dni Posty: 21
Nick w MP: Draczekk
Dzi?ki wielkie <3, tak wiem, ?e jestem ameb? xD poradzi?e? sobie bez moich odpwiedzi na kt?re nie mia?em poj?cia jak odpowiedzie? XD jeszcze raz dzi?kuje
Tagi: kliknięcie :: peda
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: