Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2020-03-19, 01:20


Vander0832

Mapper/Grafik






Wiek: 28
Na forum: 3644 dni
Posty: 52
Nick w MP: Vanderek

Piwa: 1105

Respekt: 55,3

Siemanko, potrzebuje zmieni? bind na pasy, poniewa? koliduje si? on z Voice chatem. Jest to trudne poniewa? nie ma binda tylko pewna funkcja.

O to linijki, kt?re s? odpowiedzialne za pasy
Kod:

local noBelt = { [431] = true, [437] = true }
function seatbelt(thePlayer)
if getPedOccupiedVehicle(thePlayer) then
local theVehicle = getPedOccupiedVehicle(thePlayer)
if (getVehicleType(theVehicle) == "BMX" or getVehicleType(theVehicle) == "Bike") or (noBelt[getElementModel(theVehicle)] and getVehicleOccupant(theVehicle, 0) ~= thePlayer) then
outputChatBox("Ten pojazd nie ma pas?w!", thePlayer, 255, 0, 0)
else
if (getElementData(thePlayer, "seatbelt") == true) then
exports.anticheat:changeProtectedElementDataEx(thePlayer, "seatbelt", false, true)
outputChatBox("Odpinasz pasy.", thePlayer, 255, 0, 0)
exports.global:sendLocalMeAction(thePlayer, "odpina pasy.")
else
exports.anticheat:changeProtectedElementDataEx(thePlayer, "seatbelt", true, true)
outputChatBox("Zapinasz pasy.", thePlayer, 0, 255, 0)
exports.global:sendLocalMeAction(thePlayer, "zapina pasy.")
end
end
end
end
addCommandHandler("pasysamo", seatbelt)
addCommandHandler("pasy", seatbelt)
addEvent('realism:seatbelt:toggle', true)
addEventHandler('realism:seatbelt:toggle', root, seatbelt)

function removeSeatbelt(thePlayer)
if getElementData(thePlayer, "seatbelt") and not isPedInVehicle(thePlayer) then
exports.anticheat:changeProtectedElementDataEx(thePlayer, "seatbelt", false, true)
exports.global:sendLocalMeAction(thePlayer, "odpina pasy.")
end
end
addEventHandler("onVehicleExit", getRootElement(), removeSeatbelt)

function seatbeltFix()
local counter = 0
for _, thePlayer in ipairs(getElementsByType("player")) do
exports.anticheat:changeProtectedElementDataEx(thePlayer, "seatbelt", false, true)
counter = counter + 1
end
--outputDebugString("Fixed for " .. counter .. " players")
end
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), seatbeltFix)
--addCommandHandler("fixbelts", seatbeltFix, false, false)


Z tego co widz? to skrypt eksportuje co? ze skryptu anticheat, a dok?adnie funkcje changeProtectedElementDataEx. Ju? wysy?am linijki od Anticheata:
Kod:

function allowElementData(thePlayer, index)
setElementData(thePlayer, secretHandle.."p:"..index, false, false)
end

function protectElementData(thePlayer, index)
setElementData(thePlayer, secretHandle.."p:"..index, true, false)
end

function changeProtectedElementData(thePlayer, index, newvalue)
allowElementData(thePlayer, index)
setElementData(thePlayer, index, newvalue)
protectElementData(thePlayer, index)
end

function changeProtectedElementDataEx(thePlayer, index, newvalue, sync, nosyncatall)
if (thePlayer) and (index) then
if not newvalue then
newvalue = nil
end
if not nosyncatall then
nosyncatall = false
end

allowElementData(thePlayer, index)
setElementData(thePlayer, index, newvalue, sync)

if not sync then
if not nosyncatall then
if getElementType ( thePlayer ) == "player" then
triggerClientEvent(thePlayer, "edu", getRootElement(), thePlayer, index, newvalue)
end
end
end
protectElementData(thePlayer, index)
return true
end
return false
end

function changeEld(thePlayer, index, newvalue)
if source then thePlayer = thePlayer end
return changeProtectedElementData(thePlayer, index, newvalue)
end
addEvent("anticheat:changeEld", true)
addEventHandler("anticheat:changeEld", root, changeEld)

function setEld(thePlayer, index, newvalue, sync)
if source then thePlayer = thePlayer end
local sync2 = false
local nosyncatall = true
if sync == "one" then
sync2 = false
nosyncatall = false
elseif sync == "all" then
sync2 = true
nosyncatall = false
else
sync2 = false
nosyncatall = true
end
return changeProtectedElementDataEx(thePlayer, index, newvalue, sync2, nosyncatall)
end
addEvent("anticheat:setEld", true)
addEventHandler("anticheat:setEld", root, setEld)


function genHandle()
local hash = ''
for Loop = 1, math.random(5,16) do
hash = hash .. string.char(math.random(65, 122))
end
return hash
end

function fetchH()
return secretHandle
end

secretHandle = genHandle()


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 01:25


Adaskokieblasko







Wiek: 23
Na forum: 2954 dni
Posty: 101

Piwa: 18

Respekt: 100
Respekt: 100

W kodzie nie ma czego? takiego jak "bindKey"?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 01:33


Vander0832

Mapper/Grafik






Wiek: 28
Na forum: 3644 dni
Posty: 52
Nick w MP: Vanderek

Piwa: 1105

Respekt: 55,3

Nie ma w?a?nie, a po usuni?ciu tego pliku nie dzia?aj? pasy, nawet jak usuwam t? funkcj? ze skryptu lub wy??czaj?c anticheat te? nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 01:36


Adaskokieblasko







Wiek: 23
Na forum: 2954 dni
Posty: 101

Piwa: 18

Respekt: 100
Respekt: 100

"Vander0832" napisał/a:

Nie ma w?a?nie, a po usuni?ciu tego pliku nie dzia?aj? pasy, nawet jak usuwam t? funkcj? ze skryptu lub wy??czaj?c anticheat te? nie dzia?a

Logiczne ?e nie b?dzie to dzia?a? jak usuniesz ten plik
Je?eli masz notepada++ to polecam ci zrobi? co? takiego
CTRL+F Szukaj w plikach
Szukany tekst "bindKey"
?cie?ka - Folder na twoim komputerze gdzie znajduje si? ca?a paczka
I wtedy popatrz czy nie ma gdzie? tam wpisanej komendy "pasy" albo "pasysamo"

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Vander0832
Wysłany: 2020-03-19, 01:49


Vander0832

Mapper/Grafik






Wiek: 28
Na forum: 3644 dni
Posty: 52
Nick w MP: Vanderek

Piwa: 1105

Respekt: 55,3

Adaskokieblasko, Dobra dzi?ki masz piwko, po prostu w skrypcie hud przeoczy?em bindy bo by?y na 961 linijce. Masz piwko!

Postaw piwo autorowi tego posta
 

 
Tagi: zmiana :: klawiszu :: zapinania :: pasu :: owl :: gaming
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku