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

Wysłany: 2016-03-01, 14:21


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Witam pisz? skrypt na gie?d? i tu pada moje pytanie bo mam taki kawa?ek:


function gielda_buy1 carsIDbuy )
local idcars1 tonumber(carsIDBuy)
for idplayeritem in ipairs(getElementsByType("vehicle")) do
local sscar tonumber(getElementData(playeritem"rs"))
if idcars1 == sscar then
outputChatBox("gg."thePlayer)
else
end
end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )


carsIDbuy jest trigerowany. Licze na pomoc bo nw co tu jest ?le.
:piwo: :piwo:

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 15:25


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Jakie? b??dy db3?

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 15:39


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Powiem tak Brak jednak na serwerze mam 14 aut i na czacie 14 razy wysy?a si? gg a pownno tyle razy ile jest aut z id kt?re sprawdza if idcars1 == sscar then.

Kod:



gg.
gg.
gg.
gg.
gg.
gg.
gg.
gg.
gg.
gg.
gg.
gg.
gg.
gg.



Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 18:25


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

KineQ, powiedz co ci wyskakuje teraz na czacie:
function gielda_buy1 carsIDbuy )
local idcars1 tonumber(carsIDBuy)
    for idplayeritem in ipairs(getElementsByType("vehicle")) do
    local sscar tonumber(getElementData(playeritem"rs"))
        if idcars1 == sscar then
        outputChatBox("gg."sourceClient )
        outputChatBox("CarsIDBuy: "..tostring(carsIDBuy), sourceClient )
        outputChatBox("sscar: "..tostring(sscar), sourceClient )
        else
        end
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 20:25


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Podmieni?em na tw?j kod zrestartowa?em skrypt klikam kup i nic nie pisze. Bark b??d?w w DB3

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 20:32


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

function gielda_buy1 carsIDbuy )
local idcars1 tonumber(carsIDBuy)
    for idplayeritem in ipairs(getElementsByType("vehicle")) do
    local sscar tonumber(getElementData(playeritem"rs"))
        if idcars1 == sscar then
        outputChatBox("gg."thePlayer)
        outputChatBox("CarsIDBuy: "..tostring(carsIDBuy), thePlayer)
        outputChatBox("sscar: "..tostring(sscar), thePlayer)
        else
        end
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )
Zobacz

[ Dodano: 2016-03-01, 20:34 ]
Poprawka:
function gielda_buy1 carsIDbuy )
    if carsIDBuy then
        for idplayeritem in ipairs(getElementsByType("vehicle")) do
        local sscar getElementData(playeritem"rs")
            if tonumber(carsIDbuy) == tonumber(sscarthen
            outputChatBox("gg."thePlayer)
            outputChatBox("CarsIDBuy: "..tostring(carsIDBuy), thePlayer)
            outputChatBox("sscar: "..tostring(sscar), thePlayer)
            end
        end    
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 20:37


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Mam ten kod 0 b??d?w i 0 wiadomo?ci na czacie i nw czy nie wysy?a id czy co bo nw:

S: Tw?j Po poprawce.

function gielda_buy1 carsIDbuy )
    if carsIDBuy then
        for idplayeritem in ipairs(getElementsByType("vehicle")) do
        local sscar getElementData(playeritem"rs")
            if tonumber(carsIDbuy) == tonumber(sscarthen
            outputChatBox("gg."thePlayer)
            outputChatBox("CarsIDBuy: "..tostring(carsIDBuy), thePlayer)
            outputChatBox("sscar: "..tostring(sscar), thePlayer)
            end
        end    
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )



c:



function adds ()
        local columid guiGridListAddColumn(GUIEditor.gridlist[1], "ID"0.2)    
        local column guiGridListAddColumn(GUIEditor.gridlist[1], "Pojazd"0.2)    
        local columc guiGridListAddColumn(GUIEditor.gridlist[1], "Cena"0.2)
        local columo guiGridListAddColumn(GUIEditor.gridlist[1], "Sprzedaj?cy"0.3)
                for idplayeritem in ipairs(getElementsByType("vehicle")) do
                if getElementData(playeritem"GieldaSell") == true then
                        local row guiGridListAddRow GUIEditor.gridlist[1] )
                        local name getVehicleName (playeritem)
                        local cenas1 getElementData(playeritem"GieldaCena")
                        local cenas cenas1 .. "$"
                        local seller getElementData(playeritem"GieldaSeller")
                        local id getElementData(playeritem"ids")
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumididfalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumnnamefalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumccenasfalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumosellerfalsefalse )
                else
                end
                end
end
addEventHandler "onClientResourceStart"resourceRootadds )

function gielda_buy1 carsIDbuy )
local idcars1 tonumber(carsIDBuy)
    for idplayeritem in ipairs(getElementsByType("vehicle")) do
    local sscar tonumber(getElementData(playeritem"rs"))
        if idcars1 == sscar then
        outputChatBox("gg."sourceClient )
        outputChatBox("CarsIDBuy: "..tostring(carsIDBuy), sourceClient )
        outputChatBox("sscar: "..tostring(sscar), sourceClient )
        else
        end
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )




@ W?a?nie widze ?e po stronie clienta mam to samo wkeljone :| Zaraz naprawie i dam zna?.

w c.lua



function kup_gielda()
local carsIDbuy guiGridListGetItemText GUIEditor.gridlist[1], guiGridListGetSelectedItem GUIEditor.gridlist[1] ), )
for idplayeritem in ipairs(getElementsByType("vehicle")) do
if getElementData(playeritem"GieldaSell") == true then
triggerServerEvent "gielda_kup_id"getRootElement(), carsIDbuy)
else
end
end
end
addEventHandler"onClientGUIClick"GUIEditor.button[1], kup_gieldafalse)

function adds ()
        local columid guiGridListAddColumn(GUIEditor.gridlist[1], "ID"0.2)    
        local column guiGridListAddColumn(GUIEditor.gridlist[1], "Pojazd"0.2)    
        local columc guiGridListAddColumn(GUIEditor.gridlist[1], "Cena"0.2)
        local columo guiGridListAddColumn(GUIEditor.gridlist[1], "Sprzedaj?cy"0.3)
                for idplayeritem in ipairs(getElementsByType("vehicle")) do
                if getElementData(playeritem"GieldaSell") == true then
                        local row guiGridListAddRow GUIEditor.gridlist[1] )
                        local name getVehicleName (playeritem)
                        local cenas1 getElementData(playeritem"GieldaCena")
                        local cenas cenas1 .. "$"
                        local seller getElementData(playeritem"GieldaSeller")
                        local id getElementData(playeritem"ids")
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumididfalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumnnamefalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumccenasfalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumosellerfalsefalse )
                else
                end
                end
end
addEventHandler "onClientResourceStart"resourceRootadds )

@ Brak DB3 i Reakcji na czacie jakby id nie by?y r?wne i si? nie zgadza?o.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 20:48


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

KineQ,
function gielda_buy1 carsIDbuy )
    if carsIDBuy then
        for idplayeritem in ipairs(getElementsByType("vehicle")) do
        local sscar getElementData(playeritem"rs")
            if tonumber(carsIDbuy) == tonumber(sscarthen
            outputChatBox("gg."client)
            outputChatBox("CarsIDBuy: "..tostring(carsIDBuy), client)
            outputChatBox("sscar: "..tostring(sscar), client)
            else
            outputChatBox("nie poprawne!"client)
            end
        end    
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 20:51


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Dziwne DB3 czyste na czacie brak ?adnej reakcji nic si? nie wy?wietla.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 21:01


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

KineQ, zobacz czy teraz co? wyskoczy:
function kup_gielda()
local carsIDbuy guiGridListGetItemText GUIEditor.gridlist[1], guiGridListGetSelectedItem GUIEditor.gridlist[1] ), )
for idplayeritem in ipairs(getElementsByType("vehicle")) do
if getElementData(playeritem"GieldaSell") == true then
triggerServerEvent "gielda_kup_id"getRootElement(), carsIDbuy)
outputChatBox("Sprawdz")
else
end
end
end
addEventHandler"onClientGUIClick"GUIEditor.button[1], kup_gieldafalse)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 21:09


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Na czacie wy?wietla si? sprawd?.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-02, 13:21


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

function kup_gielda()
local carsIDbuy guiGridListGetItemText GUIEditor.gridlist[1], guiGridListGetSelectedItem GUIEditor.gridlist[1] ), )
for idplayeritem in ipairs(getElementsByType("vehicle")) do
if getElementData(playeritem"GieldaSell") == true then
triggerServerEvent "gielda_kup_id"getRootElement(), carsIDbuy)
else
end
end
end
addEventHandler"onClientGUIClick"GUIEditor.button[1], kup_gieldafalse)

function gielda_buy1 carsIDbuy )
    if carsIDBuy then
    outputChatBox("CarsIDBuy: "..tostring(carsIDBuy), client)
        for idplayeritem in ipairs(getElementsByType("vehicle")) do
        local sscar getElementData(playeritem"rs")
            outputChatBox("sscar: "..tostring(sscar), client)
            if tonumber(carsIDbuy) == tonumber(sscarthen
            outputChatBox("gg."client)
            else
            outputChatBox("nie poprawne!"client)
            end
        end    
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )

Pokaz jak wyg?ada u ciebie panel.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-02, 14:52


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Wygl?d w grze :
http://scr.hu/3xh1/gqrza



C

GUIEditor = {
    gridlist = {},
    window = {},
    button = {},
    label = {}
}
local screenWscreenH guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow((screenW 563) / 2, (screenH 483) / 2563483"KQ-RPG Gie?da"false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.95)

GUIEditor.gridlist[1] = guiCreateGridList(1031293442falseGUIEditor.window[1])
guiGridListAddRow(GUIEditor.gridlist[1])
guiGridListSetItemText(GUIEditor.gridlist[1], 01"-"falsefalse)
guiGridListSetItemText(GUIEditor.gridlist[1], 02"-"falsefalse)
guiGridListSetItemText(GUIEditor.gridlist[1], 03"-"falsefalse)
GUIEditor.label[1] = guiCreateLabel(31440239319"ssssssss\nssssssss\nsssssssss\nssssssssss\nssssssss\nssssssss\nsssssssss\nssssssss\nsssssssss\nsss\nssssss\nssssss\nssssssss\nsssssssss\nssssss\nsssssssss\nsssssssssss\nsssssssssss\nsssssssss\nssssssssss\nssssssssss"falseGUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[1], "center"false)
guiLabelSetVerticalAlign(GUIEditor.label[1], "center")
GUIEditor.button[1] = guiCreateButton(32036922346"Kup"falseGUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(32042522346"Zamknij"falseGUIEditor.window[1])

showCursor(true)
function zamknija_gielda()
guiSetVisible GUIEditor.window[1], false )
showCursor(false)
end
addEventHandler"onClientGUIClick"GUIEditor.button[2], zamknija_gielda)



function kup_gielda()
local carsIDbuy guiGridListGetItemText GUIEditor.gridlist[1], guiGridListGetSelectedItem GUIEditor.gridlist[1] ), )
for idplayeritem in ipairs(getElementsByType("vehicle")) do
if getElementData(playeritem"GieldaSell") == true then
triggerServerEvent "gielda_kup_id"getRootElement(), carsIDbuy)
outputChatBox("Sprawdz")
else
end
end
end
addEventHandler"onClientGUIClick"GUIEditor.button[1], kup_gieldafalse)

function adds ()
        local columid guiGridListAddColumn(GUIEditor.gridlist[1], "ID"0.2)    
        local column guiGridListAddColumn(GUIEditor.gridlist[1], "Pojazd"0.2)    
        local columc guiGridListAddColumn(GUIEditor.gridlist[1], "Cena"0.2)
        local columo guiGridListAddColumn(GUIEditor.gridlist[1], "Sprzedaj?cy"0.3)
                for idplayeritem in ipairs(getElementsByType("vehicle")) do
                if getElementData(playeritem"GieldaSell") == true then
                        local row guiGridListAddRow GUIEditor.gridlist[1] )
                        local name getVehicleName (playeritem)
                        local cenas1 getElementData(playeritem"GieldaCena")
                        local cenas cenas1 .. "$"
                        local seller getElementData(playeritem"GieldaSeller")
                        local id getElementData(playeritem"ids")
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumididfalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumnnamefalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumccenasfalsefalse )
                        guiGridListSetItemText GUIEditor.gridlist[1], rowcolumosellerfalsefalse )
                else
                end
                end
end
addEventHandler "onClientResourceStart"resourceRootadds )

function giedainfocar ()
local carsmodel guiGridListGetItemText GUIEditor.gridlist[1], guiGridListGetSelectedItem GUIEditor.gridlist[1] ), guiSetText GUIEditor.label[1], "Model: " .. carsmodel .. "\nssssssss\nsssssssss\nssssssssss\nssssssss\nssssssss\nsssssssss\nssssssss\nsssssssss\nsss\nssssss\nssssss\nssssssss\nsssssssss\nssssss\nsssssssss\nsssssssssss\nsssssssssss\nsssssssss\nssssssssss\nssssssssss" )
end
addEventHandler "onClientGUIClick"GUIEditor.gridlist[1], giedainfocarfalse )


S

GieldaLS createColCuboid(1608.3475, -1146.651122.34200171.5106.7510.25)

function GieldaSell(thePlayercmdcenasell)
local ads getPedOccupiedVehicle (thePlayer)
local driver getPedOccupiedVehicleSeat(thePlayer)
local A1 getElementData(ads,"GieldaCenaMa")
local OW getElementData(ads,"Owner1")
local PLS getAccountName(getPlayerAccount(thePlayer))
local ows getPlayerName(thePlayer)
local model getVehicleName (ads)
if isElementWithinColShape(adsGieldaLSthen 
    if driver == 0 then 
        if OW == PLS then
            if tonumber(cenasellthen 
                if A1 == true then 
                    outputChatBox("Ten pojazd zosta? ju? wystawiony na spzeda?."thePlayer)
                else
                    local cena math.floor(tonumber(cenasell))
                    local przeb math.floor(getElementData(ads,"przebieg"))
                    setElementData(ads"GieldaCenaMa",true)
                    setElementData(ads"GieldaCena",cena)
                    setElementData(ads"GieldaSell",true)
                    setElementData(ads"GieldaSeller",ows)
                    setElementData(ads"message","Model: " ..model .. "\n W?a?ciciel: " ..PLS.. " \n Cena: " .. cena .. $\n Przebieg: " .. przeb .. " KM")
                end
            else
            outputChatBox("Aby Sprzeda? Pojazd U?yj Komendy /sprzedaj <cena>"thePlayer)
            end
        else
            outputChatBox("Nie jeste? w?a?cicielem tego pojazdu."thePlayer)
        end
    else return end
else return end
end
addCommandHandler("sprzedaj",GieldaSell,thePlayer)

function gielda_buy1 carsIDbuy )
    if carsIDBuy then
        for idplayeritem in ipairs(getElementsByType("vehicle")) do
        local sscar getElementData(playeritem"rs")
            if tonumber(carsIDbuy) == tonumber(sscarthen
            outputChatBox("gg.")
            outputChatBox("CarsIDBuy: "..tostring(carsIDBuy))
            outputChatBox("sscar: "..tostring(sscar))
            else
            outputChatBox("nie poprawne!")
            end
        end    
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )


function GieldaExit(source)
local ads source
setElementData(ads"message",false)
setElementData(ads"GieldaSell",false)
setElementData(ads"GieldaCenaMa",false)
setElementData(ads"GieldaCena",false)
end
addEventHandler ("onColShapeLeave"GieldaLSGieldaExit)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-02, 15:48


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4261 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
KineQ, Co Ci tu nie dzia?a ?

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-02, 17:04


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Jak z C side do S side trigerowane jest id pobrane z auta zaznaczonego to w kodzie :



function gielda_buy1 carsIDbuy )
    if carsIDBuy then
        for idplayeritem in ipairs(getElementsByType("vehicle")) do
        local sscar getElementData(playeritem"rs")
            if tonumber(carsIDbuy) == tonumber(sscarthen
            outputChatBox("gg.")
            outputChatBox("CarsIDBuy: "..tostring(carsIDBuy))
            outputChatBox("sscar: "..tostring(sscar))
            else
            outputChatBox("nie poprawne!")
            end
        end    
    end
end
addEvent"gielda_kup_id"true )
addEventHandler"gielda_kup_id"getRootElement(), gielda_buy1 )



nie dzia?a if tonumber(carsIDbuy) == tonumber(sscar) then jakby id si? nie r?wna?y sobie a s? r?wne.

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: nie :: działający :: warunek
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