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

Wysłany: 2016-07-11, 18:22


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam, robi? frakcj? Venturas News lecz mam taki pewien problem, gdy wpisz? /vnews <text> wywala mi db3:



Kod:

C-SIDE:

local screenWscreenH guiGetScreenSize()
addEvent("oglos",true)

addEventHandler("oglos",root,
    function (reason)
        addEventHandler("onClientRender",root,info)
    end
)

function info (reason)
    dxDrawText(""..reason..""screenW 0.3536screenH 0.0111screenW 0.6391screenH 0.0648tocolor(255254254254), 1.20"default-bold""center""top"falsefalsetruefalsefalse)
end

function infor ()
removeEventHandler("onClientRender",root,info)
end
setTimer(infor,15000,1)


S-SIDE:

local pojazdy = {
{983.91,1720.12,8.71,360,0,90},
{983.91,1725.12,8.71,360,0,90},
{983.91,1730.12,8.71,360,0,90},
{983.91,1735.12,8.71,360,0,90},
{983.91,1740.12,8.71,360,0,90},
}

for i,v in ipairs(pojazdy) do
local v createVehicle(582,v[1],v[2],v[3],v[4],v[5],v[6])
setElementData(v,"pojazd_opis","Venturas News")
setElementData(v,"pojazd_paliwo",100)
setVehicleFrozen(v,true)
end

addEventHandler("onVehicleStartEnter",resourceRoot,
    function (player)
        local acc getAccountName(getPlayerAccount(player))
        if not isObjectInACLGroup("user."..accaclGetGroup("LVNews")) then
        cancelEvent(true)
        outputChatBox("Nie jeste? pracownikiem Las Venturas News!",player)
        else return
        end        
    end
)

addCommandHandler("vnews",
    function (playercmdreason, ...)
    local acc getAccountName(getPlayerAccount(player))
        if isObjectInACLGroup("user."..accaclGetGroup("LVNews")) then    
            local reason table.concat( {...}, "")
            triggerClientEvent(getRootElement(), "oglos"root"reason")
        else
            outputChatBox("Nie jeste? pracownikiem Las Venturas News!",player)
        end
    end
)


Za pomoc :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 18:25


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Sk?d funkcja info pobiera argument reason? Z tego co widz? to znik?d. W evencie oglos dodaj zmienn? "x" do kt?rej przypiszesz ten reason i w dxDrawText wy?wietl ten "x".

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 18:46


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Mo?esz pokaza? przyk?ad? Bo niezbyt rozumiem.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 18:48


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3


local screenWscreenH guiGetScreenSize()
addEvent("oglos",true)

addEventHandler("oglos",root,
    function (reason)
        reason
        addEventHandler("onClientRender",root,info)
    end
)

function info ()
    dxDrawText(""..x..""screenW 0.3536screenH 0.0111screenW 0.6391screenH 0.0648tocolor(255254254254), 1.20"default-bold""center""top"falsefalsetruefalsefalse)
end

function infor ()
removeEventHandler("onClientRender",root,info)
end
setTimer(infor,15000,1)


Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 18:57


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Tak my?la?em ?eby to zrobi?, ale nie by?em przekonany. :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 18:58


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Tylko, ?e zamiast wpisanego tekstu wy?wietla si? "reason".

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 19:01


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Dlatego, ?e triggerujesz tekst "reason", a nie zmienn? reason.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 19:19


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Nie wiem jak mam to zrobi? ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 19:36


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

triggerClientEvent(getRootElement(), "oglos"rootreason)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 19:40


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Ok tylko, ?e teraz nie pokazuje pierwszego wyrazu a potem pokazuje all ale bez spacji

np: /vnews elo test skryptu

pokazuje: testskryptu

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 19:44


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

local reason table.concat ( { ... }, " " )


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 19:49


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Tyle, ?e jak tak mam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 19:51


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Przypatrz si?, ?e nie dok?adnie. Sprawd? i przetestuj.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 19:51


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Da?em twoje i nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 22:31


dudeks







Wiek: 31
Na forum: 6576 dni
Posty: 171

Piwa: 89

Respekt: 105,3
Respekt: 105,3

 function (playercmdreason, ...)


usun tu reason

Postaw piwo autorowi tego posta
 

 
Tagi: venturas :: news
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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