Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: bind
1. no bind key in edtibox
Witam, jest spos?b, gdy edytuje sobie w editboxie to np chc? napisa? tata,a ju? przy literce "T" w??cza mi si? czat. Chcia?bym zrobi?, ?eby to globalnie by?o.
2. bind
Siemka, ot?? mam taki problem, ?e mam skrypt kt?ry otwiera gui po klikni?ciu U a nie mam poj?cia, kt?ry to skrypt. Jest jaka? mo?liwo?? zablokowa? to, ?e je?li klikn? ten guzik na klawiaturze to nic si? nie stanie, dodatkowo nie usuwaj?c tamtego skryptu?
Za pomoc daje respekt
3. GUI pod bind
Siemanko, mam problem mianowicie z GUI, mianowicie mam pod bind je i jest to moje pierwsze gui pod bind. Do podpi?cia buttona z funkcja u?y?em handlera "onClientGUIClick", mianowicie po klikniecia przycisku i wy??czenia GUI wy?wietla b??d "already handled". Zrobi?em te GUI wy??cznie pod testy. Liczy?bym na popraw? mojego b??du o ile co? ?le zrobi?em.

O to kod clienta.

[code]
GUIEditor = {
tab = {},
tabpanel = {},
label = {},
button = {},
window = {}
}
local screenW, screenH = guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow((screenW - 727) / 2, (screenH - 414) / 2, 727, 414, "VIP Panel", false)
guiSetVisible(GUIEditor.window[1], false)
guiWindowSetMovable(GUIEditor.window[1], false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFF7F92F")

GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 21, 708, 383, false, GUIEditor.window[1])
guiSetProperty(GUIEditor.tabpanel[1], "Text", "General")

GUIEditor.tab[1] = guiCreateTab("General", GUIEditor.tabpanel[1])

GUIEditor.button[1] = guiCreateButton(574, 15, 114, 51, "Heal", false, GUIEditor.tab[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFC2E2E")
buttonarmor = guiCreateButton(574, 76, 114, 51, "Armour", false, GU...
4. bind pod komende chatu
Siema wszystkim, zawsze pomaga?em a teraz ja potrzebuje pomocy. Czy kto? z was pami?ta jak zrobi? taki motyw, ?e pod bindem jakim? mam sw?j typ chatu? O co mi chodzi ju? t?umacz? - przyk?adowo chat OOC pod bindem B, klikaj?c bind B pokazywa?o nam pole "OOC : ". Kiedy? to robi?em jednak czas zrobi? swoje i wylecia?o mi kompletnie z g?owy.
5. bind
Witam ma problem bo nie wiem jak zrobi? bind na to :

[lua]
--[[-------------------------------------------------
Notes:

> This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running.
To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there.
--]]-------------------------------------------------

local name = getPlayerName(localPlayer)
local hajs = getElementData(localPlayer,"pieniadze")

function dashboard()
dxDrawRectangle(0, 0, 259, 768, tocolor(43, 43, 43, 255), false)
dxDrawRectangle(0, 0, 1366, 158, tocolor(43, 43, 43, 255), false)
dxDrawText(name , 97, 20, 283, 60, tocolor(255, 255, 255, 255), 1.30, "pricedown", "left", "top", false, false, false, false, false)
dxDrawText(hajs, 97, 70, 293, 108, tocolor(255,255,255, 255), 1.20, "pricedown", "left", "top", false, false, false, false, false)
dxDrawText("Euro", 230, 70, 293, 108, tocolor(68, 195, 0, 255), 1.20, "pricedown", "left", "top", false, false, false, false, false)
dxDrawImage(0, 10, 82, 76, ":srpg-avatars/grafiki/avatar.png", 0, 0, 0, tocolor(255,255,255, 255), false)
--dxDrawImage(1099, 6, 400,170, ":np-logowanie/logo4.png", 0, 0, 0, tocolor(255,255,255, 255)...
6. bind na horna
Siema,posiadam skrypt na horna lecz jest z nim problem.Wszystko dzia?a opr?cz tego ?e gdy w??cz? horna to s?ysz? go tylko ja.Jak zrobi? aby s?ysza? to ka?dy gracz?Prosz? o pomoc.Z g?ry dzi?kuje.Oczywi?cie za pomoc piwko i rep.Poni?ej wklejam kawa?ek kodu:

function bindHoronkeykeyState )
    if 
isPedInVehiclelocalPlayer then 
        
if ( keyState == 'down' then 
            sound 
playSound3D'Audio/sapd_horn.ogg'getElementPositionlocalPlayer ) ) 
            
setSoundVolume(sound100.0)
        
setSoundSpeed sound1.0 )
            
attachElementssoundgetPedOccupiedVehiclelocalPlayer ) ) 
        elseif ( 
keyState == 'up' then 
            
if isElementsound then  
                stopSound
sound )  
            
end 
        end 
    end 
end 
bindKey
'lalt''down'bindHoron 
bindKey'lalt''up'bindHoron 
7. Bind do komeny
Jak zrobi? binda kt?ry wywo?uje komend?.
8. Jak dodać bind pod F6 dla serwera
addCommandHandler("panel.organizacji",function (plr,cmd,...)
    
local uid=getElementData(plr,"player:sid")
    if 
not uid then return end
    local code
=getElementData(plr,"player:organization")
    if 
not code then return end
    local result
=exports["pystories-db"]:dbGet("SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;"codeuid) -- pobieramy tylko JEDEN rekord
    
if result and #result > 0 then
        
if result[1].rank <= 2 then outputChatBox("* Brak uprawnie? do panelu organizacji !",plr) return end
    local resulted
=exports["pystories-db"]:dbGet("SELECT * FROM ms_organizacje WHERE code=?"code)
        
triggerClientEvent(plr"lidero:showGUI"resourceRoot,coderesulted)
        
bindKey("F6","down")
    
end
end
)


Pr?bowa?em co? takiego ale nie chce dzia?a? jak to ja za pomoc leci :piwo:
9. Bind klawisza
Jak zbindowa? klawisz, aby tylko po jednym klikni?ciu unbindowa?o go na 10 sek?
10. Bind
Witaaam!

Mam problem, jak zrobi? aby bind by? jakbym wpisywa? /swiatla 1 pod klawisz H?
A przyk?adowo /swiatla 2 pod klawisz J?
[lua]
-- Simple Police-Lights by MuLTi!

p_lights = {}
p_timer = {}
p_lvar = {}
p_pvar = {}
p_lvar2 = {}
p_lvar3 = {}
p_lvar4 = {}



function toggleLights(thePlayer, cmd, level)
local level = tonumber(level)
if not(level) then outputChatBox("", thePlayer, 255, 255, 255, true) return end
if(level < 1) or (level > 2) then return end
local veh = getPedOccupiedVehicle(thePlayer)
local id = getElementModel(veh)
if (id == 596) or (id == 426) or (id == 560) or (id == 459) or (id == 407) or (id == 599) or (id == 578) then
if(level == 1) then
if(p_lights[veh] == 0) or(p_lights[veh] == nil) then
p_pvar[veh] = 1
p_lights[veh] = 1
outputChatBox("", thePlayer, 0, 200, 100, true)
setVehicleOverrideLights ( veh, 2 )
p_timer[veh] = setTimer(
function()
if(p_lvar[veh] == 0) or (p_lvar[veh] == nil) then
p_lvar[veh] = 1
setVehicleLightState ( veh, 1, 0)
setVehicleLightState ( veh, 2, 0)
setVehicleLightState ( veh, 0, 1)
setVehicleLightState ( veh, 3, 1)
setVehicleHeadLightColor(veh, 255, 255, 255)
...
11. Dx na bind
Witam, mam pytanie jak podpi?? DXDraw pod bind ? Generalnie jak podpi?? onClientRender pod bindKey ? Prosz? o wyt?umaczenie :/
12. bind key włączanie wyłączanie pod bindem
cze??, podobnie jak w temacie, w jaki spos?b wykona? by okno otwiera?o si? po klikni?ciu "x" ale r?wnie? zamyka?o. Mam pomys?, ale troch? nie kompletny wi?c prosz? o wskaz?wk?
13. Jak dodać bind
Jak doda? do tego kodu bind z mp3 mam ju? pobrane g?osy syren tylko chce doda? do tego auta bind pod 1 2 3 ?eby puszcza? dzwi?k syren Daje kod:

 
function radiowozy()
local Turismo1 createVehicle(451, -1639.5390625686.2822265625, -5.480090)
removeVehicleSirens(Turismo1)
addVehicleSirens(Turismo162truefalsefalsefalse)
setVehicleSirens(Turismo110.32.5000255198.9198.9)
setVehicleSirens(Turismo12, -0.32.5000255198.9198.9)
setVehicleSirens(Turismo130.40.80.400255255255)
setVehicleSirens(Turismo140.40.80.400255255255)
setVehicleSirens(Turismo150.8, -2.7025500255255)
setVehicleSirens(Turismo16, -0.8, -2.7025500255255
local velocity 690.00 -- (Predkosc maksymalna )
local acceleration 39.0 -- (Przyspieszenie )
local slock 45.0 -- (Promien
local trac 1.40
setVehicleHandling
(Turismo1"tractionMultiplier"trac)
setVehicleHandling(Turismo1"steeringLock"slock)
setVehicleHandling(Turismo1"maxVelocity"velocity)
setVehicleHandling(Turismo1"engineAcceleration"acceleration)
setElementFrozen(Turismo1true)
addVehicleUpgrade(Turismo11025)
setVehicleColor(Turismo1000)
setVehiclePlateText(Turismo1"SAPD#01")
end
addEventHandler
('onResourceStart',getResourceRootElement(getThisResource())

Stosuj znaczniki lua/code //Emm
14. Bind dzialajacy w blipie
Witam, chce zrobic zeby komenda "elo" byla zbindowana pod mouse_wheel_down i zeby tylko dzialala w blipie(cylinder) tylko nie wiem jak to zrobic xd
Nie dawajcie mi funkcji z wiki bo i tak nie bede wiedziec jak to zrobic.
15. IsElementWithMarker - Bind
Witam mam pewien problem bo wywala mi b??d z IsElementWithMarker jak klikne po za nim dany bind.
Kod:

function WybieramZamowienie ()
if isElementWithinMarker(getLocalPlayer(), markerzamowienie) then
if not getElementData(localPlayer, "zamowienie_gracza") then
setElementData(localPlayer, "zamowienie_gracza", true)
setElementFrozen(getLocalPlayer(), true)
setTimer(function()
triggerServerEvent("dajzamowienie", localPlayer)
setElementFrozen(getLocalPlayer(), false)
toggleControl("enter_exit", false)
toggleControl("sprint", false)
toggleControl("jump", false)
toggleControl("fire", false)
pokazMarkerDostawy()
end, 4000,1 )
else
outputChatBox("test")
end
end
end
bindKey("1", "down", WybieramZamowienie)
addEventHandler("WybieramZamowienie", getRootElement(), WybieramZamowienie)



Kto? ma pomys? jak wyelimnowa? b??d?
Kod:

Bad argument @'isElementWithinMarker' [Expected marker at argument2, got nil]
[/code]
16. Bind dla kierowcy
Witam. Tak jak w temacie. Przypomnicie mi jak si? robi?o aby danego binda m?g? u?y? kierowca?

Jak komu? si? chce to mo?e mi zrobi? :P


addEventHandler
("onPlayerVehicleEnter"root, function(pojazd)
    if 
auta[getElementModel(pojazd)] then
    bindKey
(source"1""down"dzwieksource)
    
end
end
)

17. Bind pod Gui DX
Witam. Stworzy?em sobie panel interakcji. Wchodz?c w gr?, odpalaj?c skrypt - wywala same errory. Oco chodzi?
Za pomoc piwsko.

[lua]bindKey ( "1", "down", function()
if guiGetVisible(papieros) == false then
guiSetVisible ( papieros,true)
guiSetVisible ( machaj,true)
guiSetVisible ( sikaj,true)
guiSetVisible ( lez,true)
guiSetVisible ( rece,true)
guiSetVisible ( wal,true)
guiSetVisible ( pij,true)
guiSetVisible ( gangsta,true)
guiSetVisible ( cop,true)
guiSetVisible ( infolist,true)
showCursor ( true )
addEventHandler ( "onClientRender", root, paneltlo )
else
guiSetVisible ( papieros,false)
guiSetVisible ( machaj,false)
guiSetVisible ( sikaj,false)
guiSetVisible ( lez,false)
guiSetVisible ( rece,false)
guiSetVisible ( wal,false)
guiSetVisible ( pij,false)
guiSetVisible ( gangsta,false)
guiSetVisible ( cop,false)
guiSetVisible ( infolist,true)
showCursor (false)
removeEventHandler ( "onClientRender", root, paneltlo )
end
end)

papieros = guiCreateButton(383, 194, 151, 40, "ZAPAL PAPIEROSA", false)
guiSetProperty(papieros, "NormalTextColour", "DEFFFFFF")
---------------------------------------------------------
machaj = guiCreateButton(567, 194, 151, 40, "POMACHAJ", false)
guiSetProperty(machaj, "NormalTextColour", "DEFFFFFF")
---------------------------------------------------------
sikaj = guiCreateButton(749, 194, 151, 40, "SIKAJ"...
18. Bind key, nie wiem o co chodzi....
Witam serdecznie. Nie wiem czemu ale mam problem z bind key. Chodzi o to ?e mam 2 skrypty. Jeden na panel auta a drugi panel info. Panel auta jest pod bindem LSFIHT a panel info jest pod F1. I sprawa jest taka, ?e jak robie bind do panelu info tym kodem:

function info()
    if (
guiGetVisible(info)) then
        showCursor
(false)
        
guiSetVisible(info,false)
    else
        if 
isCursorShowing() then return end
        showCursor
(true)
        
guiSetVisible(info,true)
    
end
end
bindKey
("F1","down"info)

Wtedy nie dzia?a w pe?ni skrypt na panel auta, a dok?adnie to dzia?a tylko window, a buttony si? nie wy?wietlaj?. A jak usun? ten bind z panelu info to skrypt na panel auta dzia?a normalnie. Pomo?e kto?? Oczywi?cie piwo za pomoc.
19. Gui, bind
Witam. Mam problem. Nie wiem jak zrobi? bind key, ?eby wy?wietla?o si? moje gui. Ju? daje kawa?ek kodu:

Chcia?bym, ?eby to okno si? wy?wietli?o, ale ?eby bind dzia?a? tylko w poje?dzie jako kierowca. Czy m?g?by mi kto? pom?c?
Window, kt?ry ma si? wy?wietli?:

okno 
guiCreateWindow(467290637286"Panel pojazdu - ByDawirzo"false)
20. Bind
Witam, zosta? mi podany taki kod we wcze?niejszym po?cie, ale czy kto? potrafi wy?apa? co jest ?le? Skrypt si? odpala, ale nie dzia?a, w sensie, serwer go wyszukuje, uruchamia, ale po klikni?ciu 1 w poje?dzie o ID 433 bind nie dzia?a. Prosz? o pomoc.

C-side:
[lua]
auta = { [433] = true }

addEventHandler ( "onPlayerVehicleEnter", root, function( pojazd )
if auta[getElementModel(pojazd)] then
bindKey ( source, "1", "down", dzwiek )
end
end)


function dzwiek ()
sound = playSound ( "syrenaosp.mp3" )
setSoundMaxDistance ( sound, 30 )
end

addEvent("playClientSound",true)

function startSirens()
local veh = getPedOccupiedVehicle(root)
triggerServerEvent("onPlaySound3D",root,veh)
end

addEventHandler("playClientSound", root, function(veh)
local snd = playSound3D ("plik dzwiekowy",x,y,z,false)
setSoundMaxDistance(snd, 20)
attachElements(snd,veh)
end)
[/lua]
S-Side:
[lua]
addEvent("onPlaySound3D",true)
addEventHandler("onPlaySound3D",root,function(veh)
for _, player in ipairs(getElementsByType("player")) do
triggerClientEvent(player, "playClientSound", root,veh)
end
end
)
[/lua]

[ Dodano : 2014-08-03, 01:41 ]
Za pomoc oczywi?cie :piwo: oraz reputacja +10

[ Dodano : 2014-08-03, 01:42 ]
PS: osob?, kt?rym taki skrypt jest potrzebny zabrania si? kopiowania i pobierania st?d kodu !...
21. Bind do gui
Jak doda? tu bind?
[lua]

GUIEditor = {
label = {},
progressbar = {},
gridlist = {},
radiobutton = {},
button = {},
window = {},
scrollbar = {},
combobox = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(115, 70, 815, 627, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.gridlist[1] = guiCreateGridList(20, 31, 274, 579, false, GUIEditor.window[1])

GUIEditor.label[1] = guiCreateLabel(107, -4, 153, 15, "Gracze:", false, GUIEditor.gridlist[1])
guiSetFont(GUIEditor.label[1], "default-bold-small")

GUIEditor.button[1] = guiCreateButton(314, 194, 167, 77, "Dodaj do listy poszukiwanych", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[2] = guiCreateButton(577, 194, 167, 77, "Usu? z listy poszukiwanych", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
GUIEditor.radiobutton[1] = guiCreateRadioButton(314, 51, 142, 15, "Niski", false, GUIEditor.window[1])
guiRadioButtonSetSelected(GUIEditor.radiobutton[1], true)
GUIEditor.radiobutton[2] = guiCreateRadioButton(456, 51, 142, 15, "Wysoki", false, GUIEditor.window[1])
...
22. Gui na Bind
Cze??, po raz drugi. Mam problem, ?w kiedy daj? aby gui otwiera?o si? po klikni?ciu klawisza END, to niby dzia?a. Ale odrazu po wej?ciu na serwer gui si? pojawia, jak zrobi? aby si? pojawi?o po klikni?ciu END, a nie po wej?ciu. Oczywi?cie gui mo?na chowa? i pokazywa?, lecz po wej?ciu na serwer si? pokazuje, a chcia?bym aby pokaza?o si? po klikni?ciu END.
Kod do zbindowania:
bindKey "end""down", function()
if 
guiGetVisible(Ekwipunek.window[1]) == false then
guiSetVisible 
Ekwipunek.window[1], true )
showCursor true )
else
guiSetVisible Ekwipunek.window[1],false)
showCursor (false)
end
end
)

Naturalnie, za pomoc ch?odne :piwo: ;)
23. Gui, jak ustawić bind na f1?
Witam, postanowi?em zrobi? gui pomocy dla mojego serwera - zrobi?em gui w "guieditor" i mam ten ca?y kod z lua, tylko mam problem, bo nie wiem jak ustawi?, aby to okno otwiera?o si? pod klawiszem F1, prosz? o pomoc.

Oto kod, je?li mo?ecie to dopiszcie reszt? kodu, aby wy?wietla?o si? gui pod wybranym klawiszem:


GUIEditor = {
tab = {},
window = {},
tabpanel = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(634, 289, 1024, 677, "Panel Pomocy - Polish Real Life - By Bolek 2014", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.tabpanel[1] = guiCreateTabPanel(40, 60, 940, 578, false, GUIEditor.window[1])

GUIEditor.tab[1] = guiCreateTab("Serwer", GUIEditor.tabpanel[1])
GUIEditor.tab[2] = guiCreateTab("Administraca", GUIEditor.tabpanel[1])
GUIEditor.tab[3] = guiCreateTab("Regulamin", GUIEditor.tabpanel[1])
GUIEditor.tab[4] = guiCreateTab("Aktualizacje", GUIEditor.tabpanel[1])
GUIEditor.tab[5] = guiCreateTab("Postanowienia ", GUIEditor.tabpanel[1])
end
)
24. bind pod auto
Witajcie.

Jak zrobi? aby tego binda mogli u?ywa? tylko ludzie siedz?cy w tych autach :

id - 431 i 437



function busStartBind(thePlayer)
    
local theVehicle getPedOccupiedVehicle (thePlayer)
    
local id getElementModel(theVehicle)
    if 
id == 431 or id == 437 then
        bindKey
(thePlayer"2""down"busJob)
        
outputChatBox("Aby zaczac prace kierowcy autobusu, wcisnij '2' a nastepnie jedz za znacznikami."thePlayer2552550)
        
outputChatBox("Pieniadze otrzymasz po wyjsciu z autobusu."thePlayer25500)
    
end
end
addEventHandler
("onVehicleEnter",rootElement,busStartBind)



Bo ten kod co? szwankuje. A dok?adniej to mo?na u?y? tego keybinda w ka?dym aucie.

Pozdrawiam :)

Kod:


Piorun usun?? poprzedni temat przez pomy?k?.
25. Bind się nie tworzy.
Witam, mam problem, ot?? bindy tworz? si? po restarcie skryptu, a po wej?ciu gracza na serwer nie. Oto kod:
function bindKeys()
    for 
kgracze in ipairs(getElementsByType("player")) do
        if 
not(isKeyBound(gracze"F3""down"funkcja)) then
            bindKey
(gracze"F3""down"funkcja)
        
end
    end
end

function bindKeysPlayerJoin()
    
bindKey(source"F3""down"funkcja)
end

addEventHandler
("onPlayerJoin"getRootElement(), bindKeysPlayerJoin)
addEventHandler("onResourceStart"getResourceRootElement(), bindKeys)
26. Bind i naprawa pojazdu
Cze??.
M?j problem polega na tym, ?e po naci?ni?ciu klawisza 2 samoch?d jest naprawiany, ale wiadomo?? na czacie powtarza si? 2 razy. Komenda /napraw dzia?a normalnie.
Kod :

function repairVehicle(gracztheVehicle)
if 
isElement(gracz) and getElementType(gracz) == "player" then
    
if isPedInVehicle(graczthen
        local theVehicle 
getPedOccupiedVehicle(gracz)
            if 
theVehicle then
                outputChatBox
("* Pojazd naprawiony!"gracz2202200)
                
fixVehicle(theVehicle)
                
playSoundFrontEnd(gracz46)
            
end
        
else
            
outputChatBox("* Musisz by? w poje?dzie!"gracz2202200)
        
end
    end
end
addCommandHandler
("napraw"repairVehicle)

function 
bind()
for 
k,v in ipairs(getElementsByType("player")) do
bindKey(v"2""down"repairVehicle)
end
end
addEventHandler
("onResourceStart"rootbind)

Prosz? o pomoc, pozdrawiam.
27. Bind ?
Witam zn?w
Moje pytanie jest nast?puj?ce, jak zrobi? ( czego u?y? ) aby dana funkcj? wywo?a? np. klawiszem "L" . Przyk?adowo chc? mie? ?wiat?a pod klawiszem "L", nie chc? robi? tam binda samodzielnie ( je?eli skrypt to zrobi to ok ).