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

Wysłany: 2019-05-30, 20:18


Jodla

Majster






Wiek: 22
Na forum: 3126 dni
Posty: 41
Nick w MP: Stajl

Piwa: 817

Respekt: 20,5

Witam tutaj jest takie co? ?e jest kamera przed graczem (PSSM) i chcia? bym to przenie?? na -1857.92, -13.94, 18.93, tylko nie mam poj?cia gdzie jest to od kamery.
Kod:

-- Original script by G&T Mapping (c) 12.Dec.2014
-- Feel free to edit and redistribute this script.

femaleSkins = {9, 10, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55, 56, 63, 64, 69, 75, 76, 77, 85, 87, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 139, 140, 141, 145, 148, 150, 151, 152, 157, 169, 172, 178, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 205, 207, 211, 214, 215, 216, 218, 219, 224, 225, 226, 231, 232, 233, 237, 238, 243, 244, 245, 246, 251, 256, 257, 263, 298, 304}

maleSkins = {62,70,266,264,265,276,256,267,301,271,38,39}
local ped = createPed(0,-1857.88, -15.09, 18.93, 90)

setElementDimension(ped,0)
--------**--------
-------//\\-------
------// \\------
-----// \\-----
----// \\----
---// \\---
--// \\--
--\\ Settings //--
local defaultSex = "male" -- Set the default sex (Can be "male" or "female")
-- Please note that any of the timers below are in milliseconds (ms)
local skinCamTimer = 100 -- Timer to switch the camera to the selected skin (Change to a higher value if the camera doesn't switch to the Ped Selection Screen)
local playerCamTimer = 100 -- Timer to switch the camera back to the player (Change to a higher value if the camera doesn't switch back to the player)
local setSkinTimer = 50 -- Timer to override any skin change done by other scripts (Change to a higher value if the player's skin doesn't change)
-- Scroll settings
local autoScrollStart = 200 -- Set the time it takes in ms to enable auto scroll when holding down your arrow keys (cannot be lower than 50)
local autoScrollSpeed = 80 -- Set the time it takes in ms to switch between skins when holding down your arrow keys (cannot be lower than 50)
--// \\--
--\\ //--
---\\ //---
----\\ //----
-----\\ //-----
------\\ //------
-------\\//-------
--------**--------

local sWidth,sHeight = guiGetScreenSize()
local origWidth,origHeight = 1280,960
local isScreenVisible = false
local skinRequested = false
function text(text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(text, x/origWidth*sWidth+1.5, y/origHeight*sHeight+1.5, w/origWidth*sWidth+1.5, h/origHeight*sHeight+1.5, tocolor(0,0,0,255), scale/origWidth*sWidth, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(text, x/origWidth*sWidth, y/origHeight*sHeight, w/origWidth*sWidth, h/origHeight*sHeight, color, scale/origWidth*sWidth, font, alignX, alignY, clip, wordBreak, postGUI)
end
function image(x, y, w, h, image, rotation, rotationCenterOffsetX, rotationCenterOffsetY, color, postGUI)
dxDrawImage(x/origWidth*sWidth, y/origHeight*sHeight, w/origWidth*sWidth, h/origHeight*sHeight, image, rotation, rotationCenterOffsetX, rotationCenterOffsetY, color, postGUI)
end
function mainScreen()
dxDrawImage(0,0,sWidth,sHeight,":wyborskinaSAPD/img/bg.png",0,0,0,tocolor(255,255,255,255),true)
text("Wyb?r Skina", 74, 35, 610, 136, tocolor(255, 255, 255, 255), 5.00, "default", "left", "top", false, false, true, false, false)
text("Skin: "..selectedSkin.."/"..totalSkins, 290, 198, 440, 249, tocolor(255, 255, 255, 255), 2.50, "default", "left", "top", false, false, true, false, false)
text("U?yj strza?ek aby zmieni? skin. Naci?nij [Enter] aby wybra?.", 322, 837, 1042, 875, tocolor(255, 255, 255, 255), 2.00, "default", "center", "center", false, false, true, false, false)
image(403, 419, 96, 140, ":wyborskinaSAPD/img/arrow.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
image(767.75, 419, 96, 140, ":wyborskinaSAPD/img/arrow.png", 180, 0, 0, tocolor(255, 255, 255, 255), true)
image(72, 207, 130, 131, ":wyborskinaSAPD/img/male.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
--image(55, 380, 130, 131, "img/female.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end
function prevArrowBlink()
image(403, 419, 96, 140, ":wyborskinaSAPD/img/arrow-blink.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end
function nextArrowBlink()
image(767.75, 419, 96, 140, ":wyborskinaSAPD/img/arrow-blink.png", 180, 0, 0, tocolor(255, 255, 255, 255), true)
end

function maleActivated()
image(54, 187, 169, 174, ":wyborskinaSAPD/img/male-active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end
--[[
function femaleActivated()
image(45, 363, 155, 170, "img/female-active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end]]

local prevButtonClickable = guiCreateStaticImage(0.36, 0.44, 0.08, 0.15, ":wyborskinaSAPD/img/transparent.png", true)
local nextButtonClickable = guiCreateStaticImage(0.62, 0.44, 0.07, 0.15, ":wyborskinaSAPD/img/transparent.png", true)
local maleButtonClickable = guiCreateStaticImage(0.06, 0.21, 0.10, 0.14, ":wyborskinaSAPD/img/transparent.png", true)
local femaleButtonClickable = guiCreateStaticImage(0.06, 0.40, 0.07, 0.14, ":wyborskinaSAPD/img/transparent.png", true)
function showClickables(isScreenVisible)
guiSetVisible(prevButtonClickable,isScreenVisible)
guiSetVisible(nextButtonClickable,isScreenVisible)
guiSetVisible(maleButtonClickable,isScreenVisible)
guiSetVisible(femaleButtonClickable,isScreenVisible)
end
showClickables(isScreenVisible)

function toggleScreen()
if isScreenVisible then
closeScreen()
else
addEventHandler("onClientRender",root,mainScreen)
if defaultSex == "male" then
addEventHandler("onClientRender",root,maleActivated)
--elseif defaultSex == "female" then
-- addEventHandler("onClientRender",root,femaleActivated)
end
isScreenVisible = true
showClickables(isScreenVisible)
showCursor(true)
setTimer(function()showChat(false)end,200,1)
setPlayerHudComponentVisible("all",false)
bindKey("enter","down",changePlayerSkin)
end
end

function closeScreen()
skinRequested = false
firstTime = false
setTimer(function()setCameraTarget(localPlayer)end,playerCamTimer,1)
triggerServerEvent("setElemDimen",localPlayer,localPlayer,698)
removeEventHandler("onClientRender",root,mainScreen)
--removeEventHandler("onClientRender",root,femaleActivated)
removeEventHandler("onClientRender",root,maleActivated)
isScreenVisible = false
showClickables(isScreenVisible)
showCursor(false)
setTimer(function()showChat(true)end,200,1)
setPlayerHudComponentVisible("all",false)
setPlayerHudComponentVisible("radar",true)
setPlayerHudComponentVisible("crosshair",true)
setPlayerHudComponentVisible("breath",true)
setPlayerHudComponentVisible ("area_name", false)
setPlayerHudComponentVisible ("radio", false)
setElementData(localPlayer,"hud:wloczony",true)
unbindKey("enter","down",changePlayerSkin)
end

local t=createElement("text")
setElementData(t,"name","Wyb?r Skina")
setElementInterior(t,0)
setElementDimension(t,0)
setElementPosition(t,-1860.01, -14.92, 18.93)
local strzalka = createMarker(-1860.01, -14.92, 18.93-4.50,"arrow",1,76,153,0)
setElementDimension(strzalka,0)

local marker = createMarker ( -1860.01, -14.92, 18.93, "cylinder", 1.5, 255, 255, 0, 0 )
setElementDimension(marker,0)
addEventHandler("onClientMarkerHit",resourceRoot,function(e)
if e==localPlayer then
if getElementData(e,"player:duty") == "SAMC" then
if skinRequested == false then
skinRequested = true
setElementDimension(ped,0)
triggerServerEvent("setElemDimen",localPlayer,localPlayer,698)
triggerServerEvent("setElemFrozen",localPlayer,localPlayer,true)
setTimer(function()setCameraMatrix(1399.01, 1544.62, 15.02, 1402.98, 1544.52, 15.02)end,skinCamTimer,1)
addEventHandler("onClientRender",root,mainScreen)
if defaultSex == "male" then
addEventHandler("onClientRender",root,maleActivated)
elseif defaultSex == "female" then
addEventHandler("onClientRender",root,femaleActivated)
end
isScreenVisible = true
showClickables(isScreenVisible)
showCursor(true)
setTimer(function()showChat(false)end,200,1)
setPlayerHudComponentVisible("all",false)
setElementData(localPlayer,"hud:wloczony",false)
bindKey("enter","down",changePlayerSkin)
end
end
end
end)

--addEventHandler("onClientMarkerHit",resourceRoot,marker)


function changePlayerSkin()
toggleScreen()
setPlayerTheirSkin()
skinChosen = true
triggerServerEvent("setElemFrozen",localPlayer,localPlayer,false)
end


local tune = playSFX3D("radio","Ambience",11,960.05999755859, -1265.2800292969, 21.440000534058,true)
setSoundVolume(tune,1)
setSoundMaxDistance(tune,50)
setElementDimension(tune,124)

function getSelectedSkinID()
local ID = skinTable[selectedSkin]
return ID
end

function setMenuPedSkin()
local ID = getSelectedSkinID()
setElementModel(ped,ID)
end

function changeSex(sex)
if source == maleButtonClickable or sex == "male" then
defaultSex = "male"
setPedAnimation(ped,"DANCING","dnce_M_c",_,_,false,false,_)
skinTable = maleSkins
totalSkins = #skinTable
selectedSkin = 1
setMenuPedSkin()
if isScreenVisible then
--removeEventHandler("onClientRender",root,femaleActivated)
--addEventHandler("onClientRender",root,maleActivated)
end
--[[elseif source == femaleButtonClickable or sex == "female" then
defaultSex = "female"
setPedAnimation(ped,"STRIP","STR_Loop_A",_,_,false,false,_)
skinTable = femaleSkins
totalSkins = #skinTable
selectedSkin = 1
setMenuPedSkin()
if isScreenVisible then
removeEventHandler("onClientRender",root,maleActivated)
addEventHandler("onClientRender",root,femaleActivated)
end
]]
end
end
addEventHandler("onClientGUIClick",resourceRoot,changeSex)
changeSex(defaultSex)

function selectNextSkin()
if selectedSkin == totalSkins then
selectedSkin = 1
else
selectedSkin = selectedSkin+1
end
end

function selectPrevSkin()
if selectedSkin == 1 then
selectedSkin = totalSkins
else
selectedSkin = selectedSkin-1
end
end

function setPlayerTheirSkin()
local ID = getSelectedSkinID()
setTimer(function()triggerServerEvent("changePlayerSkin",localPlayer,ID,selectedSkin)end,setSkinTimer,1)
setElementDimension(ped,0)
end

-- Button prev <
local renderprev = true
function prevPedButton()
if isScreenVisible then
playSound(":wyborskinaSAPD/scroll.mp3")
if renderprev == true then addEventHandler("onClientRender",root,prevArrowBlink) renderprev = false end
setTimer(function()removeEventHandler("onClientRender",root,prevArrowBlink) renderprev = true end,50,1)
selectPrevSkin()
setMenuPedSkin()
end
end
addEventHandler("onClientGUIClick",prevButtonClickable,prevPedButton,false)
bindKey("arrow_l","down",prevPedButton)

-- Button next >
local rendernext = true
function nextPedButton()
if isScreenVisible then
playSound(":wyborskinaSAPD/scroll.mp3")
if rendernext == true then addEventHandler("onClientRender",root,nextArrowBlink) rendernext = false end
setTimer(function()removeEventHandler("onClientRender",root,nextArrowBlink) rendernext = true end,50,1)
selectNextSkin()
setMenuPedSkin()
end
end
addEventHandler("onClientGUIClick",nextButtonClickable,nextPedButton,false)
bindKey("arrow_r","down",nextPedButton)

-- Scroll functions
function nextPed_scroll()
timernext = setTimer(
function()
timernext2 = setTimer(
function()
nextPedButton()
end
,autoScrollSpeed,0)
end
,autoScrollStart,1)
end
bindKey("arrow_r","down",nextPed_scroll)

function prevPed_scroll()
timerprev = setTimer(
function()
timerprev2 = setTimer(
function()
prevPedButton()
end
,autoScrollSpeed,0)
end
,autoScrollStart,1)
end
bindKey("arrow_l","down",prevPed_scroll)

function killAutoScroll_next()
if isTimer(timerprev) then
killTimer(timerprev)
elseif isTimer(timerprev2) then
killTimer(timerprev2)
end
end
bindKey("arrow_l","up",killAutoScroll_next)

function killAutoScroll_prev()
if isTimer(timernext) then
killTimer(timernext)
elseif isTimer(timernext2) then
killTimer(timernext2)
end
end
bindKey("arrow_r","up",killAutoScroll_prev)
[/code]

Podpis
znam jakieś tam podstawy

==
Skrypt wojsko ACL -
https://gtao.pl/skrypt-wojsko-acl-vt134899.htm#833500
--
Skrypt Whitelista -
https://gtao.pl/skrypt-whitelista-vt135327.htm#835548
===
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-31, 07:43


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Funkcja

Więcej informacji znajdziesz w Wikipedii MTA:

setCameraMatrix

odpowiada za zmian? pozycji kamery gracza.

U siebie znajdziesz j? w timerze.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-08-21, 12:20


Jodla

Majster






Wiek: 22
Na forum: 3126 dni
Posty: 41
Nick w MP: Stajl

Piwa: 817

Respekt: 20,5

"Wilq" napisał/a:

Funkcja

Więcej informacji znajdziesz w Wikipedii MTA:

setCameraMatrix

odpowiada za zmian? pozycji kamery gracza.

U siebie znajdziesz j? w timerze.


a jak sprawdzi? jaka jest camera tam gdzie stoj? na przyk?ad?

Podpis
znam jakieś tam podstawy

==
Skrypt wojsko ACL -
https://gtao.pl/skrypt-wojsko-acl-vt134899.htm#833500
--
Skrypt Whitelista -
https://gtao.pl/skrypt-whitelista-vt135327.htm#835548
===
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-08-21, 14:43


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8


Więcej informacji znajdziesz w Wikipedii MTA:

getCameraMatrix


Postaw piwo autorowi tego posta
 

 
Tagi: jak :: zrobić :: inny :: podgląd
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » jak zrobić inny podgląd Odpowiedz do tematu

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