Wysłany: 2012-12-07, 22:40
pidbulxd
Wiek: 28 Na forum: 5230 dni Posty: 135
Nick w MP: Word
Piwa : 540
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 == nitrotn ) then
triggerServerEvent ( "buyNitro" , getRootElement ())
end
end
addEventHandler ( "onClientGUIClick" , nitrobtn , dajfix )
function dajfix ()
if ( source == fixbtn ) then
triggerServerEvent ( "buyRepair" , getRootElement ())
end
end
addEventHandler ( "onClientGUIClick" , fixbtn , dajfix )
function dajflipa ()
if ( source == flipbtn ) then
triggerServerEvent ( "buyFlip" , getRootElement ())
end
end
addEventHandler ( "onClientGUIClick" , fliptn , dajflipa
Server:
addEvent ( "buyNitro" , true )
addEventHandler ( "buyNitro" , rootElement ,
function()
if isPedInVehicle ( source ) then
if ( getPlayerMoney ( source ) >= 7000 ) then
takePlayerMoney ( source , 7000 )
addVehicleUpgrade ( getPedOccupiedVehicle ( source ), 1010 )
outputChatBox ( "Nitro dodano" , source , 255 , 255 , 0 , true )
else
outputChatBox ( "Nie masz tyle kasy." , source , 255 , 0 , 0 , true )
end
else
outputChatBox ( "Nie jestes w aucie" , source , 255 , 0 , 0 , true )
end
end
)
addEvent ( "buyRepair" , true )
addEventHandler ( "buyRepair" , rootElement ,
function()
if isPedInVehicle ( source ) then
if ( getPlayerMoney ( source ) >= 40 ) then
takePlayerMoney ( source , 40 )
fixVehicle ( getPedOccupiedVehicle ( source ))
outputChatBox ( "Auto zosta?o naprawione" , source , 255 , 255 , 0 , true )
else
outputChatBox ( "Nie masz tyle kasy." , source , 255 , 0 , 0 , true )
end
else
outputChatBox ( "Nie jeste? w aucie" , source , 255 , 0 , 0 , true )
end
end
)
addEvent ( "buyFlip" , true )
addEventHandler ( "buyFlip" , rootElement ,
function()
if isPedInVehicle ( source ) then
if ( getPlayerMoney ( source ) >= 0 ) then
takePlayerMoney ( source , 0 )
rx , ry , rz = getVehicleRotation ( getPedOccupiedVehicle ( source ))
setVehicleRotation ( getPedOccupiedVehicle ( source ), rx + 180 , ry , rz + 180 )
else
outputChatBox ( "" , source , 255 , 0 , 0 , true )
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.
Wysłany: 2012-12-07, 23:43
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5198 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
Zamiast rootElement daj getRootElement(), mo?e to pomo?e.
Wysłany: 2012-12-07, 23:54
pidbulxd
Wiek: 28 Na forum: 5230 dni Posty: 135
Nick w MP: Word
Piwa : 540
Wysłany: 2012-12-08, 16:53
Oski
LUA Scripter
Wiek: 30 Na forum: 5246 dni Posty: 428
Nick w MP: Oski
Piwa : 56
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
)
Wysłany: 2012-12-08, 20:49
pidbulxd
Wiek: 28 Na forum: 5230 dni Posty: 135
Nick w MP: Word
Piwa : 540
Wysłany: 2012-12-08, 21:27
Oski
LUA Scripter
Wiek: 30 Na forum: 5246 dni Posty: 428
Nick w MP: Oski
Piwa : 56
Wysłany: 2012-12-08, 21:29
pidbulxd
Wiek: 28 Na forum: 5230 dni Posty: 135
Nick w MP: Word
Piwa : 540
< 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 >
Wysłany: 2012-12-08, 21:33
Oski
LUA Scripter
Wiek: 30 Na forum: 5246 dni Posty: 428
Nick w MP: Oski
Piwa : 56
I wyci?g z debuga podczas restartowania skryptu
Tagi: panel :: fix :: itp.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: