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

Wysłany: 2012-12-07, 22:40


pidbulxd







Wiek: 28
Na forum: 5230 dni
Posty: 135
Nick w MP: Word

Piwa: 540

Respekt: 60

Witajcie, dzisiaj zrobi?em panel aby da? fix, flip i nitro. Ale wla?nie, tutaj problem.

B??d?w w debugu zero.

Client:
function dajnitro () 
    if (source == nitrotnthen 
    triggerServerEvent("buyNitro"getRootElement())
end 
end
addEventHandler("onClientGUIClick"nitrobtndajfix) 

function dajfix () 
    if (source == fixbtnthen 
    triggerServerEvent("buyRepair"getRootElement())
end 
end
addEventHandler("onClientGUIClick"fixbtndajfix)

function dajflipa () 
    if (source == flipbtnthen 
    triggerServerEvent("buyFlip"getRootElement())
end 
end
addEventHandler("onClientGUIClick"fliptndajflipa 


Server:
addEvent("buyNitro"true)
addEventHandler("buyNitro"rootElement,
  function()
    if isPedInVehicle(sourcethen
      if ( getPlayerMoney (source) >= 7000 then
        takePlayerMoney(source7000)
        addVehicleUpgrade(getPedOccupiedVehicle(source),1010)
        outputChatBox("Nitro dodano"source2552550true)
      else
        outputChatBox("Nie masz tyle kasy."source25500true)
      end     
    else
      outputChatBox("Nie jestes w aucie"source25500true)
    end
  end
)

addEvent("buyRepair"true)
addEventHandler("buyRepair"rootElement,
  function()
    if isPedInVehicle(sourcethen
      if ( getPlayerMoney (source) >= 40 then
        takePlayerMoney(source40)
        fixVehicle(getPedOccupiedVehicle(source))
        outputChatBox("Auto zosta?o naprawione"source2552550true)
      else
        outputChatBox("Nie masz tyle kasy."source25500true)
      end     
    else
      outputChatBox("Nie jeste? w aucie"source25500true)
    end
  end
)

addEvent("buyFlip"true)
addEventHandler("buyFlip"rootElement,
  function()
    if isPedInVehicle(sourcethen
      if ( getPlayerMoney (source) >= then
        takePlayerMoney(source0)
        rxryrz getVehicleRotation (getPedOccupiedVehicle(source))        
        setVehicleRotation (getPedOccupiedVehicle(source), rx +180ryrz +180)
      else
        outputChatBox(""source25500true)
      end     
    end
  end
)



EDIT:@

B?edy w debugu, wykazuj? ?e nie s? dodane po stronie servera buyFix i buyFlip. A jak wida? s?. Je?eli mog?, prosz? o pomoc.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-07, 23:43


Brzysiek

Skrypter pralek






Wiek: 27
Na forum: 5198 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360

Zamiast rootElement daj getRootElement(), mo?e to pomo?e.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-07, 23:54


pidbulxd







Wiek: 28
Na forum: 5230 dni
Posty: 135
Nick w MP: Word

Piwa: 540

Respekt: 60

Brzysiek, dalej to samo.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-08, 16:53


Oski

LUA Scripter






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

Piwa: 56

Respekt: 75,1

Zobacz:

Kod:


function dajnitro ()
local player = getLocalPlayer()
if (source == nitrotn) then
triggerServerEvent("buyNitro", getRootElement(),player )
end
end
addEventHandler("onClientGUIClick", nitrobtn, dajfix)



Kod:


addEvent("buyNitro", true)
addEventHandler("buyNitro", rootElement,
function(player)
if isPedInVehicle(player) then
if ( getPlayerMoney (player) >= 7000 ) then
takePlayerMoney(player, 7000)
addVehicleUpgrade(getPedOccupiedVehicle(player),1010)
outputChatBox("Nitro dodano", player, 255, 255, 0, true)
else
outputChatBox("Nie masz tyle kasy.", player, 255, 0, 0, true)
end
else
outputChatBox("Nie jestes w aucie", player, 255, 0, 0, true)
end
end
)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-08, 20:49


pidbulxd







Wiek: 28
Na forum: 5230 dni
Posty: 135
Nick w MP: Word

Piwa: 540

Respekt: 60

Dalej nic ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-08, 21:27


Oski

LUA Scripter






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

Piwa: 56

Respekt: 75,1

poka? meta.xml

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-08, 21:29


pidbulxd







Wiek: 28
Na forum: 5230 dni
Posty: 135
Nick w MP: Word

Piwa: 540

Respekt: 60

<meta>
     <info author="WorD" version="1.1" type="script" name="Panel Drifter?w" description="--" />
     <script src="p_s.lua" type="server" />
     <script src="p_c.lua" type="client" />
     <file src="obrazki/fix.png" />
     <file src="obrazki/nitro.png" />
     <file src="obrazki/team.png" />
     <file src="obrazki/panel.png" />
</meta>


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-08, 21:33


Oski

LUA Scripter






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

Piwa: 56

Respekt: 75,1

I wyci?g z debuga podczas restartowania skryptu

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: fix :: itp.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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