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

Wysłany: 2017-02-28, 19:29


vicuuus







Wiek: 25
Na forum: 4006 dni
Posty: 63

Piwa: 11

Respekt: 70,3

Witam mam tutaj taki panel wyboru dru?yny:

Ale chcia?by doda? tutaj zamiast tego gui co? takiego.

+ wybieranie skina dla danego gangu i ?eby posta? sta?a tak jak tu i kamera si? wok?? niej przesuwa?a. Licze na pomoc. Jestem troch? zielony w temacie LUA wi?c... KOD: S
Kod:

addEvent("Military", true)
addEvent("Citizens", true)
addEvent("Police", true)
function onPlayerLoginPlayer()
triggerClientEvent(source, "onJoinPlayer", source)
end
addEventHandler("onPlayerLogin", root, onPlayerLoginPlayer)

function onMilitaryClick()
spawnPlayer(source, 2494.87939, -1669.23352, 13.33595)
setElementModel(source, 287)
giveWeapon(source, 24, 200)
giveWeapon(source, 31, 200)
outputChatBox("Do??czy?e? do dru?yny Grove Street!", source, 0, 255, 0)
fadeCamera(source, true)
setCameraTarget(source, source)
local team = getTeamFromName("Grove Street")
setPlayerTeam(source, team)
setPlayerNametagColor(source, 0, 300, 0)
end
addEventHandler("Military", root, onMilitaryClick)

function onCitizensClick()
spawnPlayer(source, 2001.8236083984, -1230.5457763672, 20.921688079834)
setElementModel(source, math.random(1, 279))
giveWeapon(source, 22, 100)
outputChatBox("Do??czy?e? do dru?yny Vagos!", source, 0, 255, 0)
fadeCamera(source, true)
setCameraTarget(source, source)
local team = getTeamFromName("Vagos")
setPlayerTeam(source, team)
setPlayerNametagColor(source, 255, 255, 255)
end
addEventHandler("Citizens", root, onCitizensClick)

function onPoliceClick()
spawnPlayer(source, 1598.5307617188, -1707.4188232422, 5.890625)
setElementModel(source, 280)
giveWeapon(source, 24, 200)
giveWeapon(source, 30, 200)
outputChatBox("Do??czy?e? do dru?yny Policji!", source, 0, 255, 0)
fadeCamera(source, true)
setCameraTarget(source, source)
local team = getTeamFromName("Policja")
setPlayerTeam(source, team)
setPlayerNametagColor(source, 0, 0, 255)
end
addEventHandler("Police", root, onPoliceClick)

function onWasted()
if getPlayerTeam(source, getTeamFromName("Grove Street")) then
spawnPlayer(source, 2494.87939, -1669.23352, 13.33595)
setElementModel(source, 287)
giveWeapon(source, 24, 200)
giveWeapon(source, 30, 200)
end
end
addEventHandler("onPlayerWasted", root, onWasted)

function onWasteda()
if getPlayerTeam(source, getTeamFromName("Vagos")) then
spawnPlayer(source, 2001.8236083984, -1230.5457763672, 20.921688079834)
setElementModel(source, math.random(1, 279))
giveWeapon(source, 22, 100)
end
end
addEventHandler("onPlayerWasted", root, onWasteda)

function onWastedb()
if getPlayerTeam(source, getTeamFromName("Policja")) then
spawnPlayer(source, 1598.5307617188, -1707.4188232422, 5.890625)
setElementModel(source, 280)
giveWeapon(source, 24, 200)
giveWeapon(source, 30, 200)
end
end
addEventHandler("onPlayerWasted", root, onWasted)

C
Kod:

GUIEditor = {
button = {},
window = {},
label = {},
memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(428, 229, 537, 333, "Wybierz Dr??yne", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.memo[1] = guiCreateMemo(9, 24, 421, 298, "TEKST", false, GUIEditor.window[1])
guiMemoSetReadOnly(GUIEditor.memo[1], true)
GUIEditor.label[1] = guiCreateLabel(438, 31, 87, 20, "Grove Street", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[1], "default-bold-small")
GUIEditor.button[1] = guiCreateButton(438, 61, 87, 30, "Do??cz", false, GUIEditor.window[1])
GUIEditor.label[2] = guiCreateLabel(438, 101, 85, 24, "Vagos", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[2], "default-bold-small")
GUIEditor.button[2] = guiCreateButton(437, 126, 88, 29, "Do??cz", false, GUIEditor.window[1])
GUIEditor.label[3] = guiCreateLabel(438, 165, 89, 23, "Policja", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[3], "default-bold-small")
GUIEditor.button[3] = guiCreateButton(436, 189, 91, 28, "Do??cz", false, GUIEditor.window[1])
guiSetVisible(GUIEditor.window[1], false)
end
)

function onJoin()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addEvent("onJoinPlayer", true)
addEventHandler("onJoinPlayer", root, onJoin)

function onGuiClick ()
if (source == GUIEditor.button[1]) then
triggerServerEvent("Military", getLocalPlayer())
showCursor ( false )
guiSetVisible(GUIEditor.window[1], false)
end
if (source == GUIEditor.button[2]) then
triggerServerEvent ("Citizens", getLocalPlayer())
showCursor(false)
guiSetVisible(GUIEditor.window[1], false)
end
if (source == GUIEditor.button[3]) then
triggerServerEvent("Police", getLocalPlayer())
showCursor(false)
guiSetVisible(GUIEditor.window[1], false)
end
end
addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick)


Pomoc wynagrodz? :piwo: i R*

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
PolicjaIntro
Wysłany: 2017-02-28, 19:38


mlodasnygo







Wiek: 16
Na forum: 3972 dni
Posty: 205

Piwa: 518

Respekt: 161,8
Respekt: 161,8Respekt: 161,8

Pobaw si? troch? w guieditorze i zr?b takie gui jak na tym co chcesz osi?gn??, nast?pnie zamie? to w pliku C i gitara, w razie problem?w pytaj :)

Podpis
600 dni - 10 marca 2017
:piwo: 500 piw :piwo: - 10 marca 2017
Postaw piwo autorowi tego posta
 

 
Tagi: wybór :: teamu :: skina
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