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

Wysłany: 2012-03-20, 16:43


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

mam problem tylko z serwer Oto kod:

Kod:

addEvent("nitro", true)
addEventHandler("nitro", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
addVehicleUpgrade ( car, 1010 )
outputChatBox("Do twojego auto zosta?o zainstalowane nitro.", player)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-20, 17:06


Adrian1545







Wiek: 30
Na forum: 5646 dni
Posty: 78
Nick w MP: [sXc]Lexon

Piwa: 125

Respekt: 55

Fajnie... A to co jest w client to sie kazdy ma domyslec ? Moze kilka s??w o tym ? Co ten skrypt ma robic ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-20, 17:19


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

brak opisu problemu.
My wr??ki jeste?my ? Czy mam sobie sam napisa? client side i wgra? u siebie na server i testowa? dla ciebie ? Bo si? nie chcia?o opisac b??d?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-20, 17:28


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Tak ten skrypt jak napisa?em
Kod:

mam problem tylko z serwer Oto kod:

Serwer to jest i chce ?eby ten skrypt dawa? nitro na 10x

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-20, 18:29


Paweł509







Wiek: 29
Na forum: 5215 dni
Posty: 11



Respekt: 50

ej pomocy te? mam to nie wiem co mam wybra?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-20, 20:04


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Chce ?eby kase dawa?o
Kod:

addEvent("fix", true)
addEventHandler("fix", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
fixVehicle (car)
outputChatBox("Twoje auto zosta?o naprawione.", player)
end)

addEvent("nitro", true)
addEventHandler("nitro", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
addVehicleUpgrade ( car, 1010 )
outputChatBox("Do twojego auto zosta?o zainstalowane nitro.", player)
end)





I czemu na pocz?tku wejdzie np.ja i mam panel bez listy tylko butoony dzia?aj?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-20, 21:12


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

Jakie masz b??dy w /debugscript 3?

Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-21, 07:40


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

zero

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-21, 11:35


Adrian1545







Wiek: 30
Na forum: 5646 dni
Posty: 78
Nick w MP: [sXc]Lexon

Piwa: 125

Respekt: 55

Je?li chcesz to tutaj mam taki panel w gui.
to jest client
Kod:

Window = {}
Button = {}
stateengine = {}

function changeState()
if guiGetVisible(Window[1]) then
guiSetVisible(Window[1],false)
showCursor(false)
else
Window[1] = guiCreateWindow(73,173,162,242,"Vehicle Control Panel",false)
Button[1] = guiCreateButton(0.061728395521641,0.10330578684807,0.85185188055038,0.10743801295757,"Fix/Repair",true,Window[1])
Button[2] = guiCreateButton(0.061728395521641,0.23553718626499,0.85185188055038,0.10743801295757,"10x Nitro",true,Window[1])
Button[3] = guiCreateButton(0.061728395521641,0.37190082669258,0.85185188055038,0.10743801295757,"Engine On/Off",true,Window[1])
Button[4] = guiCreateButton(0.061728395521641,0.50413221120834,0.85185188055038,0.10743801295757,"Lock/Unlock",true,Window[1])
Button[5] = guiCreateButton(0.061728395521641,0.63636362552643,0.85185188055038,0.10743801295757,"Lights On/Off",true,Window[1])
Button[6] = guiCreateButton(0.055555555969477,0.77272725105286,0.85802471637726,0.16528925299644,"Close Panel",true,Window[1])
guiWindowSetSizable ( Window[1], false )
addEventHandler ( "onClientGUIClick", Button[1], fix )
addEventHandler ( "onClientGUIClick", Button[2], nitro )
addEventHandler ( "onClientGUIClick", Button[3], engine )
addEventHandler ( "onClientGUIClick", Button[4], lock )
addEventHandler ( "onClientGUIClick", Button[5], lights )
addEventHandler ( "onClientGUIClick", Button[6], close )
guiSetVisible(Window[1],true)
showCursor(true)
end
end
addCommandHandler("cp",changeState)

function onStart()
bindKey ("z", "down", changeState )
end
addEventHandler("onClientResourceStart",getRootElement(),onStart)

function fix(button,state) --- BUTTON 1
if button == "left" and state == "down" then
local clientPlayer = getLocalPlayer()
if isPlayerInVehicle(clientPlayer) == true then
local Vehicle = getPlayerOccupiedVehicle ( clientPlayer)
fixVehicle(Vehicle)
outputChatBox("Vehicle Successfully Fixed/Repaired",255,255,0,true)
else
outputChatBox("You are not in a vehicle",255,0,0,true)
end
end
end
--- --- --- --- ---
function nitro(button,state) --- BUTTON 2
if button == "left" and state == "down" then
local clientPlayer = getLocalPlayer()
if isPlayerInVehicle(clientPlayer) == true then
local Vehicle = getPlayerOccupiedVehicle ( clientPlayer)
id = getVehicleID ( Vehicle )
if (id==592) or (id==577 ) or (id==511 ) or (id==548 ) or (id==512 ) or (id==593 ) or (id==425 ) or (id==520 ) or (id==417 ) or (id==487 ) or (id==553 ) or (id==488 ) or (id==497 ) or (id==563 ) or (id==476 ) or (id==447 ) or (id==519 ) or (id==460 ) or (id==469 ) or (id==513--[[END OF AIRCRAFTS]] ) or (id==581 ) or (id==509 ) or (id==481 ) or (id==462 ) or (id==521 ) or (id==463 ) or (id==510 ) or (id==522 ) or (id==461 ) or (id==448 ) or (id==468 ) or (id==486 --[[END OF BIKES]] ) or (id==472 ) or (id==473 ) or (id==493 ) or (id==595 ) or (id==484 ) or (id==430 ) or (id==453 ) or (id==452 ) or (id==446 ) or (id==454 --[[END OF BOATS]]) or (id==537 ) or (id==538 ) or (id==569 ) or (id==590 --[[END OF RCs]]) or (id==606 ) or (id==607 ) or (id==610 ) or (id==590 ) or (id==569 ) or (id==611 ) or (id==584 ) or (id==608 ) or (id==435 ) or (id==450 ) or (id==591--[[END OF TRAILERS]]) then
outputChatBox("Nitro can not be installed on this Vehicle",255,0,0,true)
else
addVehicleUpgrade(Vehicle,1010)
outputChatBox("10x Nitro was successfully added to your Vehicle.",255,255,0,true)
end
else
outputChatBox("You are not in a vehicle",255,0,0,true)
end
end
end
--- --- --- --- ---
function engine(button,state) --- BUTTON 3
if button == "left" and state == "down" then
local clientPlayer = getLocalPlayer()
if isPlayerInVehicle(clientPlayer) == true then
local Vehicle = getPlayerOccupiedVehicle ( clientPlayer)
if stateengine[clientPlayer] == 1 then
setVehicleEngineState ( Vehicle, false )
stateengine[clientPlayer] = 0
setVehicleOverrideLights ( Vehicle, 1 )
outputChatBox("Vehicle Engine State changed to 'Off'",255,0,0,true)
else
setVehicleEngineState ( Vehicle, true )
stateengine[clientPlayer] = 1
outputChatBox("Vehicle Engine State changed to 'On'",255,255,0,true)
end
else
outputChatBox("You are not in a vehicle",255,0,0,true)
end
end
end
--- --- --- --- ---
function lock(button,state) --- BUTTON 4
if button == "left" and state == "down" then
local clientPlayer = getLocalPlayer()
if isPlayerInVehicle(clientPlayer) == true then
local playerVehicle = getPlayerOccupiedVehicle ( clientPlayer)
if isVehicleLocked ( playerVehicle ) then -- and if the vehicle is already locked
setVehicleLocked ( playerVehicle, false ) -- unlock it
outputChatBox("Vehicle Successfully Unlocked",255,255,0)
else -- otherwise (if it isn't locked)
setVehicleLocked ( playerVehicle, true ) -- lock it
outputChatBox("Vehicle Successfully Locked",255,0,0)
end
else
outputChatBox("You are not in a vehicle",255,0,0,true)
end
end
end
--- --- --- --- ---
function lights(button,state) --- BUTTON 5
if button == "left" and state == "down" then
local clientPlayer = getLocalPlayer()
if isPlayerInVehicle(clientPlayer) == true then
local playerVehicle = getPlayerOccupiedVehicle ( clientPlayer)
if ( getVehicleOverrideLights ( playerVehicle ) ~= 2 ) then -- if the current state isn't 'force on'
setVehicleOverrideLights ( playerVehicle, 2 ) -- force the lights on
outputChatBox("Vehicle Lights Turned 'On'",255,255,0,true)
else
setVehicleOverrideLights ( playerVehicle, 1 ) -- otherwise, force the lights off
outputChatBox("Vehicle Lights Turned 'Off'",255,0,0,true)
end
else
outputChatBox("You are not in a vehicle",255,0,0,true)
end
end
end
--- --- --- --- ---
function close(button,state) --- BUTTON 6
if button == "left" and state == "down" then
if guiGetVisible(Window[1]) then
guiSetVisible(Window[1],false)
showCursor(false)
end
end
end
--- --- --- --- ---



---------------------------------------- Changing engine[source] as player leaves and enter a vehicle
function enterVehicleEvent()
local localPlayer = getLocalPlayer()
stateengine[localPlayer] = 1
end
addEventHandler("onPlayerVehicleEnter",getRootElement(),enterVehicleEvent)
function exitVehicleEvent()
local localPlayer = getLocalPlayer()
stateengine[localPlayer] = 0
end
addEventHandler("onPlayerVehicleExit",getRootElement(),exitVehicleEvent)
function wastedPlayerEvent()
local localPlayer = getLocalPlayer()
stateengine[localPlayer] = 0
end
addEventHandler("onPlayerWasted",getRootElement(),wastedPlayerEvent)
--------------------
--------------------
-- Quit
function quitPlayerEvent ( reason )
guiSetVisible(Window[1],false) -- just in case
stateengine[source] = 0
end
addEventHandler ( "onClientPlayerQuit", getRootElement(), quitPlayerEvent )
-- Join
function joinPlayerEvent ()
stateengine[source] = 0
guiSetVisible(Window[1],false)
end
addEventHandler ( "onClientPlayerJoin", getRootElement(), joinPlayerEvent )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-21, 15:14


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Nie nic mi si? nie przyda z tego.
Potrzebuje fukcji na kase "kod" i jaki? mam b??d Pioruniasty, Oski,Jacob Pomocy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-21, 16:07


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

luki123luki123, a kiedy ma si? takowa "kasa" dawa?? Jbc funkcja to
Kod:

givePlayerMoney

lub do odebrania
Kod:

takePlayerMoney


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-21, 17:54


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Jacob, zrobi?em takie co? :
Kod:

addEvent("fix", true)
addEventHandler("fix", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
takePlayerMoney ( thePlayer, oddaj(amount) )
givePlayerMoney ( thePlayer, daj(amount)
fixVehicle (car)
outputChatBox("Twoje auto zosta?o naprawione.", player)
end)


Ale mam b??dy pomocy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-21, 17:56


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

Kod:


addEvent("fix", true)
addEventHandler("fix", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
local amount = 300
takePlayerMoney ( thePlayer, amount )
givePlayerMoney ( thePlayer, amount )
fixVehicle (car)
outputChatBox("Twoje auto zosta?o naprawione.", player)
end)

Tylko po co zabiera? i dawa? temu samemu graczowi pieni?dze Oo?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-21, 17:59


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

gdzie sie zmienia kwot?

[ Dodano: 2012-03-21, 18:00 ]
jak temu samemu a ty zmieni?e?

[ Dodano: 2012-03-21, 18:03 ]
b??d argumentu kod:
Kod:

addEvent("fix", true)
addEventHandler("fix", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
local amount = 300
takePlayerMoney ( thePlayer, amount )
givePlayerMoney ( thePlayer, amount )
fixVehicle (car)
outputChatBox("Twoje auto zosta?o naprawione.", player)
end)

addEvent("nitro", true)
addEventHandler("nitro", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
local amount = 300
takePlayerMoney ( thePlayer, amount )
givePlayerMoney ( thePlayer, amount )
addVehicleUpgrade ( car, 1010 )
outputChatBox("Do twojego auto zosta?o zainstalowane nitro.", player)
end)




Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-03-21, 20:29


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

Kod:

addEvent("fix", true)
addEventHandler("fix", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
takePlayerMoney ( who, 300 )
givePlayerMoney ( source, 300 )
fixVehicle (car)
outputChatBox("Twoje auto zosta?o naprawione.", player)
end)

addEvent("nitro", true)
addEventHandler("nitro", getRootElement(), function(player)
local who = getPlayerFromName ( player )
local car = getPedOccupiedVehicle(who)
takePlayerMoney ( who, 300 )
givePlayerMoney ( source, 300 )
addVehicleUpgrade ( car, 1010 )
outputChatBox("Do twojego auto zosta?o zainstalowane nitro.", player)
end)


Postaw piwo autorowi tego posta
 

 
Tagi: panel
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