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: argumentow
1. triggerServerEvent przesylanie argumentow
Siema, mam takie cos:

addEventHandler
("onClientGUIClick"getRootElement(), 
    function()
        if(
source == GUIEditor.button[2]) then
            triggerServerEvent
("addAccount"resourceRootguiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2]))
        
end
end
)


a po serwerze:

addEvent
("addAccount"true)
function 
register(playerusernamepassword)
    
outputChatBox(username..passwordgetRootElement())
    
exports["db_connect"]:query("INSERT INTO Users(UserName, Password, Level) VALUES('"..username.."',"..password..", 0)"false)
end
addEventHandler
("addAccount"resourceRootregister)

I generarlnie to wysy?a sie warto?? UserName, ale Password ju? nie.
attempt to concatenate local 'password' a nil value
2. Nie umiem używać argumentów
Witam,
Jako osoba kt?ra chce si? czego? nauczy? a nie prosi? o pomoc, mam pewien problem, ci?gle robie te same b??dy z argumentami, chcia?bym dopyta? gdzie mog? ogarn?c to wszystko.
Zrobie przyk?ad wczoraj bardzo chcia?em zrobi? funkcje oddawania ?mieci do markeru lecz mam b??dy z argumentami, nie chodzi mi o rozwiazanie problemu lecz powiedzenie dlaczego tak jest co i gdzie zwraca jak tego unikn?? to przyk?adowy kod kt?ry mam ?le zrobiony:
[lua]
markerwysypisko = createMarker(-1870.60547, -1718.31750, 21.7500-0.9, "cylinder", 4, 0, 0, 255, 25)
function wysypisko(hitel, dm)
local x = getElementType(hitel)
local p = getElementRotation(hitel)
local pieniadze1 = math.random(300,500)
local pieniadze2 = math.random(450,600)
local pieniadde3 = math.random(600,800)
if getElementData(hitel, "pojazd:trash") then
if getElementData(hitel, "liczba:koszy") == 15 then
triggerClientEvent(hitel, "efekty", hitel)
outputChatBox("Wysypujesz smieci ze ?mieciarki oraz dostajesz swoje wynagrodzenie!", hitel)
if getElementData(hitel, "ogolne:kosze") >= 0 then
givePlayerMoney(hitel, pieniadze1)
elseif getElementData(hitel, "ogolne:kosze") >= 75 then
givePlayerMoney(hitel, pieniadze2)
elseif getElementData(hitel, "ogolne:kosze") >= 150 then
givePlayerMoney(hitel...
3. Przenoszenie argumentow
Witam mam jeden problem, mianowicie nie wiem jak przenie?? argument z jednej funkcji do drugiej
function onVehClick(button,state,x,y,wx,wy,wz,celement)
if 
celement then
local elementtype 
getElementType(celement)
if 
elementtype == "vehicle" then
guiSetVisible
(destroy,true)
guiSetVisible(wejdz,true)
guiSetVisible(napraw,true)
celement veh
end
end
end

addEventHandler
("onClientClick",getRootElement(),onVehClick)

function 
onDestroy(button)
destroyElement(veh)
end

addEventHandler
("onClientGUIClick",destroy,onZniszcz)

Chcia?bym wiedzie? jak przenie?? z pierwszej funkcji argument "celement" do drugiej, bardzo prosze o pomoc.
4. createColPolygon i różna ilość argumentów
Witam, my?l? ?e osoby pomagaj?ce na tym forum znaj? dzia?anie funkcji a je?li nie to potrafi? sprawdzi? je na wiki.
Chodzi o to, aby wpisane w wielowymiarow? tablic? warto?ci tworzy?y automatycznie Polygon z r??n? liczb? ?cian (k?t?w?, bok?w? jak zwa? tak zwa?).

Pozycja przyk?adowa, p?tla praktycznie pusta bo niezbyt wiem jak okre?li? (a nast?pnie doda?) r??n? ilo?? argument?w do funkcji createColPolygon


local protzones 
= {
    {
        [
'id'] = 1,
        [
'teams'] = {'Team1''Team2'}, -- TEAMY Z DOST?PEM DO DANEGO REGIONU,
        [
'cords'] = {
                {-
17342637},
                {-
16993087},
                {-
16483547},
                {-
15984057},
                {-
15764357},
                {-
15614577},
                {-
15474817},
                {-
15004817},
                {-
15004597},
                {-
15254617},
                {-
15263577},
                {-
16103597},
                {-
16103167},
                {-
15633177},
                {-
15642827},
                {-
15572827},
                {-
15582617},
                {-
17232607},
                {-
17342637},
        }
    
    }
}

addEventHandler('onResourceStart'resourceRoot
function ()
    
local crds = {}
    for 
iz in ipairs(protzones) do

        
end
    end
end
)


Jakie? sugestie? Nakierowania?
Nie chcia?bym gotowego kodu, a raczej ma?e wskaz?wki :)