Wysłany: 2018-08-24, 18:22
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3988 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
function DeveloperMode ()
if getElementData ( localPlayer , "player:admin" ) == false then
outputChatBox ( "* Nie posiadasz uprawnie?." , 255 , 0 , 0 )
return
end
if getDevelopmentMode () == false then
setDevelopmentMode ( true )
else
setDevelopmentMode ( false )
end
end
addCommandHandler ( "devmode" , DeveloperMode )
addCommandHandler ( "showmode" , DeveloperMode )
local sx , sy = guiGetScreenSize ()
function putPlayerInPosition ( timeslice )
local cx , cy , cz , ctx , cty , ctz = getCameraMatrix ()
ctx , cty = ctx - cx , cty - cy
timeslice = timeslice * 0.1
local tx , ty , tz = getWorldFromScreenPosition ( sx / 2 , sy / 2 , 10 )
if isChatBoxInputActive () or isConsoleActive () or isMainMenuActive () or isTransferBoxActive () then return end
if getKeyState ( "lctrl" ) then timeslice = timeslice * 4 end
if getKeyState ( "lalt" ) then timeslice = timeslice * 0.25 end
local mult = timeslice / math . sqrt ( ctx * ctx + cty * cty )
ctx , cty = ctx * mult , cty * mult
if getKeyState ( "2" ) then abx , aby = abx + ctx , aby + cty end
if getKeyState ( "w" ) then abx , aby = abx + ctx , aby + cty end
if getKeyState ( "s" ) then abx , aby = abx - ctx , aby - cty end
if getKeyState ( "a" ) then abx , aby = abx - cty , aby + ctx end
if getKeyState ( "d" ) then abx , aby = abx + cty , aby - ctx end
if getKeyState ( "space" ) then abz = abz + timeslice end
if getKeyState ( "lshift" ) then abz = abz - timeslice end
local x , y = 100 , 200
dxDrawText ( "Pozycja: " .. abx .. ", " .. aby .. " ," .. abz , x , y )
if isPedInVehicle ( getLocalPlayer ( ) ) then
local vehicle = getPedOccupiedVehicle ( getLocalPlayer ( ) )
local angle = getPedCameraRotation ( getLocalPlayer ( ))
setElementPosition ( vehicle , abx , aby , abz )
setElementRotation ( vehicle , 0 , 0 ,- angle )
else
local angle = getPedCameraRotation ( getLocalPlayer ( ))
setElementRotation ( getLocalPlayer ( ), 0 , 0 , angle )
setElementPosition ( getLocalPlayer ( ), abx , aby , abz )
end
end
function toggleAirBrakec ()
if getElementData ( localPlayer , "Ryjek" ) then toggleAirBrake () return end
if ( not getElementData ( localPlayer , "player:level" )) then return end
local levele = getElementData ( localPlayer , "player:level" )
if levele then
if type ( levele ) == "number" then
if levele < 3 then
outputChatBox ( "* Nie posiadasz uprawnie?." , 255 , 0 , 0 )
return end
elseif type ( levele ) == "table" then
if levele [ 1 ] < 3 then
outputChatBox ( "* Nie posiadasz uprawnie?." , 255 , 0 , 0 )
return end
end
toggleAirBrake ()
end
end
function toggleAirBrake ()
air_brake = not air_brake or nil
if air_brake then
if isPedInVehicle ( getLocalPlayer ( ) ) then
local vehicle = getPedOccupiedVehicle ( getLocalPlayer ( ) )
abx , aby , abz = getElementPosition ( vehicle )
Speed , AlingSpeedX , AlingSpeedY = 0 , 1 , 1
OldX , OldY , OldZ = 0
setElementCollisionsEnabled ( vehicle , false )
setElementFrozen ( vehicle , true )
setElementAlpha ( getLocalPlayer (), 0 )
addEventHandler ( "onClientPreRender" , root , putPlayerInPosition )
else
abx , aby , abz = getElementPosition ( localPlayer )
Speed , AlingSpeedX , AlingSpeedY = 0 , 1 , 1
OldX , OldY , OldZ = 0
setElementCollisionsEnabled ( localPlayer , false )
addEventHandler ( "onClientPreRender" , root , putPlayerInPosition )
end
else
if isPedInVehicle ( getLocalPlayer ( ) ) then
local vehicle = getPedOccupiedVehicle ( getLocalPlayer ( ) )
abx , aby , abz = nil
setElementFrozen ( vehicle , false )
setElementCollisionsEnabled ( vehicle , true )
setElementAlpha ( getLocalPlayer (), 255 )
removeEventHandler ( "onClientPreRender" , root , putPlayerInPosition )
else
abx , aby , abz = nil
setElementCollisionsEnabled ( localPlayer , true )
removeEventHandler ( "onClientPreRender" , root , putPlayerInPosition )
end
end
end
bindKey ( "0" , "down" , toggleAirBrakec )
bindKey ( "num_0" , "down" , toggleAirBrakec )
Pomo?e kto? pod ACL? Pr?bowa?em, ale non stop jaki? b??d, i si? wkurzy?em, i nie mam pomys?u. Podejrzewam, ?e ale jestem takim ju? dzisiaj je?opem i nie my?l? co robi?.
Wysłany: 2018-08-24, 18:44
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Strona skryptu to client .
A funkcja dzia?a tylko po stronie servera, a Tw?j skrypt jest po stronie client.
Pierwsze rozwi?zanie to jest po zalogowaniu na konto ACL sprawdzasz instrukcj? warunkow? (if) czy gracz jest w jakiej? tam grupie ACL i wtedy nadaje jak?? element-dat?. Dopisujesz warunek poprzez sprawdzenie czy posiada element-dat? w systemie airbrake.
Drugim rozwi?zaniem jest u?ycie funkcji w celu sprawdzenia nicku, na kt?rym b?dzie dzia?a? ten system, tutaj znowu trzeba stworzy? instrukcj? warunkow? (if) kt?ra b?dzie sprawdza?a czy nick zgadza si?.
Wysłany: 2018-08-24, 19:24
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3988 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
function DeveloperMode ()
if getElementData ( plr , "ACL" ) then
end
if getDevelopmentMode () == false then
setDevelopmentMode ( true )
else
setDevelopmentMode ( false )
end
end
addCommandHandler ( "devmode" , DeveloperMode )
addCommandHandler ( "showmode" , DeveloperMode )
local sx , sy = guiGetScreenSize ()
function putPlayerInPosition ( timeslice )
local cx , cy , cz , ctx , cty , ctz = getCameraMatrix ()
ctx , cty = ctx - cx , cty - cy
timeslice = timeslice * 0.1
local tx , ty , tz = getWorldFromScreenPosition ( sx / 2 , sy / 2 , 10 )
if isChatBoxInputActive () or isConsoleActive () or isMainMenuActive () or isTransferBoxActive () then return end
if getKeyState ( "lctrl" ) then timeslice = timeslice * 4 end
if getKeyState ( "lalt" ) then timeslice = timeslice * 0.25 end
local mult = timeslice / math . sqrt ( ctx * ctx + cty * cty )
ctx , cty = ctx * mult , cty * mult
if getKeyState ( "2" ) then abx , aby = abx + ctx , aby + cty end
if getKeyState ( "w" ) then abx , aby = abx + ctx , aby + cty end
if getKeyState ( "s" ) then abx , aby = abx - ctx , aby - cty end
if getKeyState ( "a" ) then abx , aby = abx - cty , aby + ctx end
if getKeyState ( "d" ) then abx , aby = abx + cty , aby - ctx end
if getKeyState ( "space" ) then abz = abz + timeslice end
if getKeyState ( "lshift" ) then abz = abz - timeslice end
local x , y = 100 , 200
dxDrawText ( "Pozycja: " .. abx .. ", " .. aby .. " ," .. abz , x , y )
if isPedInVehicle ( getLocalPlayer ( ) ) then
local vehicle = getPedOccupiedVehicle ( getLocalPlayer ( ) )
local angle = getPedCameraRotation ( getLocalPlayer ( ))
setElementPosition ( vehicle , abx , aby , abz )
setElementRotation ( vehicle , 0 , 0 ,- angle )
else
local angle = getPedCameraRotation ( getLocalPlayer ( ))
setElementRotation ( getLocalPlayer ( ), 0 , 0 , angle )
setElementPosition ( getLocalPlayer ( ), abx , aby , abz )
end
end
function toggleAirBrakec ()
if getElementData ( plr , "ACL" ) then
end
end
function toggleAirBrake ()
air_brake = not air_brake or nil
if air_brake then
if isPedInVehicle ( getLocalPlayer ( ) ) then
local vehicle = getPedOccupiedVehicle ( getLocalPlayer ( ) )
abx , aby , abz = getElementPosition ( vehicle )
Speed , AlingSpeedX , AlingSpeedY = 0 , 1 , 1
OldX , OldY , OldZ = 0
setElementCollisionsEnabled ( vehicle , false )
setElementFrozen ( vehicle , true )
setElementAlpha ( getLocalPlayer (), 0 )
addEventHandler ( "onClientPreRender" , root , putPlayerInPosition )
else
abx , aby , abz = getElementPosition ( localPlayer )
Speed , AlingSpeedX , AlingSpeedY = 0 , 1 , 1
OldX , OldY , OldZ = 0
setElementCollisionsEnabled ( localPlayer , false )
addEventHandler ( "onClientPreRender" , root , putPlayerInPosition )
end
else
if isPedInVehicle ( getLocalPlayer ( ) ) then
local vehicle = getPedOccupiedVehicle ( getLocalPlayer ( ) )
abx , aby , abz = nil
setElementFrozen ( vehicle , false )
setElementCollisionsEnabled ( vehicle , true )
setElementAlpha ( getLocalPlayer (), 255 )
removeEventHandler ( "onClientPreRender" , root , putPlayerInPosition )
else
abx , aby , abz = nil
setElementCollisionsEnabled ( localPlayer , true )
removeEventHandler ( "onClientPreRender" , root , putPlayerInPosition )
end
end
end
bindKey ( "0" , "down" , toggleAirBrakec )
bindKey ( "num_0" , "down" , toggleAirBrakec )
Takie co??
Tylko nie dzia?a
[ Dodano : 2018-08-24, 20:04 ]
attempt to call global 'guiGetScreenSize' (a nil value) Takie co? debug
Wysłany: 2018-08-24, 21:34
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Jak ustawi?e? stron? skryptu na server to nie dzia?a (nie wiem dlaczego), bo guiGetScreenSize dzia?a tylko po stronie client.
Wysłany: 2018-08-24, 21:55
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3988 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
tak jet po c-side
b??d db3: Bad argument @'getElemnetData; Expecete elementdata argument 1, s gottring 0
linijka
Ca?a funkcja:
function toggleAirBrakec ( plr )
if getElementData ( plr , "ACL" ) then
end
ta linijka z Elemnent dat? , co? z ni? ?le
Wysłany: 2018-08-24, 22:02
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
function toggleAirBrakec ()
if getElementData ( localPlayer , "ACL" ) then
end
Wysłany: 2018-08-24, 22:40
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3988 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
Nadal nie dzia?a, a gdyby tak?
function toggleAirBrakec ()
if isObjectInACLGroup ( "user." .. accName , aclGetGroup ( "Admin" ) ) then
end
end
Wysłany: 2018-08-24, 22:54
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Przecie? Ci ju? pisa?em, ?e isObjectInACLGroup dzia?a tylko po stronie SERVERA , nie mo?esz tego u?ywa? po stronie clienta bo nie b?dzie dzia?a? i b?dzie wyrzuca? b??d.
[ Dodano : 2018-08-24, 22:55 ]
PS. Masz w og?le nadan? element-dat? ACL?
Wysłany: 2018-08-29, 20:52
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3988 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
Kalizman , Jest c-side i nic ?adnego b??du nie ma, ale te? nie dzia?a jak wciskam zbindowane klawisze. Nie wiem gdzie le?y problem.
Wysłany: 2018-08-29, 21:01
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Czy ten warunek si? spe?nia?
if getElementData ( localPlayer , "ACL" ) then
Nadajesz gdzie? t? element-dat??
[ Dodano : 2018-08-29, 21:03 ]
hmm, sprawd? to:
function DeveloperMode ()
if getElementData ( localPlayer , "ACL" ) then
if getDevelopmentMode () == false then
setDevelopmentMode ( true )
else
setDevelopmentMode ( false )
end
else
outputChatBox ( "nie posiadasz element-daty ACL" )
end
end
Wysłany: 2018-08-29, 21:18
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3988 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
Ani b??d?w, ani nic nie pisze, albo kurde cud i wy**banie na skale ?wiatow?, ju? nie wiem
Wysłany: 2018-08-30, 10:24
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Zamie? function toggleAirBrakec ()
if getElementData ( plr , "ACL" ) then
end
end na function toggleAirBrakec ()
if getElementData ( localPlayer , "ACL" ) then
toggleAirBrake ()
end
end
Dodam, ?e kod jest strasznie pochrzaniony, brakuje w nim resztek kodu...
Więcej szczegółów
Wystawiono 1 piw(a):Norbert1234
Wysłany: 2018-08-30, 11:06
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3988 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
Kalizman , Dzi?ki o?wieci?o mnie, by?a ?le inna linijka napisana, ale ta twoja te? pewnie si? przyda?a, ale po za ni? jest jeszcze jedna funkcja, dzi?kuje, ju? nie raz mi pomog?e? @LOCK i res
Tagi: airbrake :: pod :: acl
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: