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

Wysłany: 2016-07-28, 22:30


FaydenFX.







Wiek: 27
Na forum: 4197 dni
Posty: 246
Nick w MP: faydn

Piwa: 11

Respekt: 45,3

witam, nie dzia?a mi ta linijka:

bindKey(localPlayer, "b", "down", function(el, md)

w db3 pisze - (bad argument expected player argument ;/)

prosz? o naprowadzenie, nie o gotowiec.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 22:36


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

FaydenFX., localPlayer nie ma po stronie server.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 22:37


FaydenFX.







Wiek: 27
Na forum: 4197 dni
Posty: 246
Nick w MP: faydn

Piwa: 11

Respekt: 45,3

Z innymi te? nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 22:42


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

FaydenFX., podaj kod gdzie to u?ywasz to ci powiem co jest nie tak.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 22:44


FaydenFX.







Wiek: 27
Na forum: 4197 dni
Posty: 246
Nick w MP: faydn

Piwa: 11

Respekt: 45,3

bindKey("space","down", function(el, md)
    if isElementWithinMarker(el, m1) then
    if getElementData(el, "zrespilGracz") then
        return
    end
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
    local x,y,z = getElementPosition(el)
    fadeCamera(el,false)
    setTimer(function()
    fadeCamera(el,true)
    local mower = createVehicle(572, 736.50,-1262.93,13.66,0.0, 360.0, 269.9)
    local mocuj = 40.0
    setVehicleHandling(mower, "engineAcceleration", mocuj)
    setVehicleHandling(mower, "maxVelocity", 80.0)
    setElementData(mower, "zrespilGracz", el)
    setElementData(mower, "paliwo", 100)
    addVehicleUpgrade(mower, 1025)
    setElementData(mower, "opis","Praca dorywcza")
    warpPedIntoVehicle(el, mower)
    removePreviousVehicles(el)
    triggerClientEvent(el, "startKoszenie", resourceRoot, mower)
    vehs[el] = mower
    end, 1900, 1)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 22:51


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

FaydenFX., serwer ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 22:53


FaydenFX.







Wiek: 27
Na forum: 4197 dni
Posty: 246
Nick w MP: faydn

Piwa: 11

Respekt: 45,3

ta

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 22:59


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

FaydenFX., a wi?c tak funkcja bindKey zwraca:
function functionName ( player keyPresser, string key, string keyState, [ var arguments, ... ] )

a nie jakie? plr, md
local marker = ...
function BindKeys ( plr, key, keyState)
    if isElementWithinMarker(plr, marker) then
    if getElementData(plr, "zrespilGracz") then
        return
    end
    if not md or getElementType(plr) ~= "player" or getPedOccupiedVehicle(plr) then return end
    local x,y,z = getElementPosition(plr)
    fadeCamera(plr,false)
    setTimer(function()
    fadeCamera(plr,true)
    local mower = createVehicle(572, 736.50,-1262.93,13.66,0.0, 360.0, 269.9)
    local mocuj = 40.0
    setVehicleHandling(mower, "engineAcceleration", mocuj)
    setVehicleHandling(mower, "maxVelocity", 80.0)
    setElementData(mower, "zrespilGracz", plr)
    setElementData(mower, "paliwo", 100)
    addVehicleUpgrade(mower, 1025)
    setElementData(mower, "opis","Praca dorywcza")
    warpPedIntoVehicle(plr, mower)
    removePreviousVehicles(plr)
    triggerClientEvent(plr, "startKoszenie", resourceRoot, mower)
    vehs[plr] = mower
    end, 1900, 1)
    end
end
bindKey("space","down", BindKeys )

resourceRoot = getResourceRootElement(getThisResource()) 
addEventHandler ( "onResourceStart", resourceRoot,
    function ()
        for i, v in ipairs(getElementsByType("player")) do
        bindKey( v, "space","down", BindKeys )
        end
    end
)

addEventHandler ( "onPlayerJoin", getRootElement(), 
    function ()
        bindKey( source, "space","down", BindKeys )
    end
 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 23:05


FaydenFX.







Wiek: 27
Na forum: 4197 dni
Posty: 246
Nick w MP: faydn

Piwa: 11

Respekt: 45,3

to nie ma r??nicy, bo i tak nie dzia?a

Postaw piwo autorowi tego posta
 

 
Tagi: bindkey :: sside
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » bindKey sside 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