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

Wysłany: 2014-02-22, 18:27


hiubinowi8







Wiek: 36
Na forum: 5019 dni
Posty: 8
Nick w MP: KoksiarskiPL



Respekt: 50

Witam,
zrobi?em skrypt na wy??czanie i w??cznie silnika powiedzcie mi co tu jest ?le .

Kod:

function turnEngineOff ( theVehicle, jackerPlayer )
if leftSeat == 0 and not jackerPlayer then
setVehicleEngineState ( theVehicle, false )
end
end
bindKey(source, "K", "down", Engine)
addEventHandler ( "onPlayerVehicle", getRootElement ( ), turnEngineOff )

function turnEngineOff ( theVehicle, jackerPlayer )
if leftSeat == 1 and not jackerPlayer then
setVehicleEngineState ( theVehicle, true )
end
end
bindKey(source, "K", "down", Engine)
addEventHandler ( "onPlayerVehicle", getRootElement ( ), turnEngineOff )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 18:40


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

Gdzie masz funkcje Engine ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 18:45


hiubinowi8







Wiek: 36
Na forum: 5019 dni
Posty: 8
Nick w MP: KoksiarskiPL



Respekt: 50

"vipSEBOvip" napisał/a:

Gdzie masz funkcje Engine ?


jak? funkcj? ?? ja jestem pocz?tkuj?cy wi?c, czy m?g?by? mi to poprawi? .. ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 18:47


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

bindKey(source"K""down"Engine


Gdzie masz funkcje engine rozpoczynaj?c? si? po wci?ni?ciu K

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 18:53


hiubinowi8







Wiek: 36
Na forum: 5019 dni
Posty: 8
Nick w MP: KoksiarskiPL



Respekt: 50

"vipSEBOvip" napisał/a:

bindKey(source"K""down"Engine


Gdzie masz funkcje engine rozpoczynaj?c? si? po wci?ni?ciu K


nie wiem o co chodzi, jak ju? m?wi?em jesstem pocz?tkuj?cy :( i za wiele nie umiem :( :( :( czy m?g?by? mnie czego? nauczy? ??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 19:31


Piorun







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

Piwa: 516

Respekt: 480,7
Respekt: 480,7

Zacznijmy od prostego pytania: tw?j kod? Pocz?tkuj?cy nie klepie takich skrypt?w, a jak ju? w og?le to wie co si? w nich znajduje.

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

 
Wysłany: 2014-02-22, 20:10


monio







Wiek: 30
Na forum: 4887 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

function turnEngineOff theVehiclejackerPlayer ) 
 if leftSeat == and not jackerPlayer then 
 setVehicleEngineState theVehiclefalse ) 
 end 
 end 
 bindKey(source"K""down"turnEngineOff) 
 addEventHandler "onPlayerVehicle"getRootElement ( ), turnEngineOff ) 

 function turnEngineOn theVehiclejackerPlayer ) 
 if leftSeat == and not jackerPlayer then 
 setVehicleEngineState theVehicletrue ) 
 end 
 end 
 bindKey(source"K""down"turnEngineOn) 
 addEventHandler "onPlayerVehicle"getRootElement ( ), turnEngineOn )


taka ma?a sugestia ;)

[ Dodano: 2014-02-22, 20:11 ]
no ale w?tpi?, ?e to tw?j kodzik ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 22:24


hiubinowi8







Wiek: 36
Na forum: 5019 dni
Posty: 8
Nick w MP: KoksiarskiPL



Respekt: 50

"monio" napisał/a:

function turnEngineOff theVehiclejackerPlayer ) 
 if leftSeat == and not jackerPlayer then 
 setVehicleEngineState theVehiclefalse ) 
 end 
 end 
 bindKey(source"K""down"turnEngineOff) 
 addEventHandler "onPlayerVehicle"getRootElement ( ), turnEngineOff ) 

 function turnEngineOn theVehiclejackerPlayer ) 
 if leftSeat == and not jackerPlayer then 
 setVehicleEngineState theVehicletrue ) 
 end 
 end 
 bindKey(source"K""down"turnEngineOn) 
 addEventHandler "onPlayerVehicle"getRootElement ( ), turnEngineOn )


taka ma?a sugestia ;)

[ Dodano: 2014-02-22, 20:11 ]
no ale w?tpi?, ?e to tw?j kodzik ;(


Kodzik troch? skopiowany ale funkcje sam przerabia?em i wi?kszo?? wiem , tylko tych funkcij nie mog?em znale?? bo nie wiedzialem gdzie : "turnEngineOff" i "turnEngineOn" .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 23:03


monio







Wiek: 30
Na forum: 4887 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

a dzia?? to wgl ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-23, 08:34


hiubinowi8







Wiek: 36
Na forum: 5019 dni
Posty: 8
Nick w MP: KoksiarskiPL



Respekt: 50

"monio" napisał/a:

a dzia?? to wgl ?


Zaraz sprawdz? :)

[ Dodano: 2014-02-23, 09:09 ]
"monio" napisał/a:

function turnEngineOff theVehiclejackerPlayer ) 
 if leftSeat == and not jackerPlayer then 
 setVehicleEngineState theVehiclefalse ) 
 end 
 end 
 bindKey(source"K""down"turnEngineOff) 
 addEventHandler "onPlayerVehicle"getRootElement ( ), turnEngineOff ) 

 function turnEngineOn theVehiclejackerPlayer ) 
 if leftSeat == and not jackerPlayer then 
 setVehicleEngineState theVehicletrue ) 
 end 
 end 
 bindKey(source"K""down"turnEngineOn) 
 addEventHandler "onPlayerVehicle"getRootElement ( ), turnEngineOn )


taka ma?a sugestia ;)

[ Dodano: 2014-02-22, 20:11 ]
no ale w?tpi?, ?e to tw?j kodzik ;(


Nie dzia?a :( bo jak za?aduj? do paczki .zip to nie ma go w resources w grze :( w tym pannelu :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-23, 10:01


monio







Wiek: 30
Na forum: 4887 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

to zrob tak: zr?b folder o nazwi np odpalanie/ daj plik lua do tego folderu i plik .xml (meta.xml) i zapakuj i wejdz do ftp/resource/ i prze?li i odrazu to tam wkleisz/ wejdz na server wpisz: /refresh/start odpalanie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-23, 10:58


hiubinowi8







Wiek: 36
Na forum: 5019 dni
Posty: 8
Nick w MP: KoksiarskiPL



Respekt: 50

"monio" napisał/a:

to zrob tak: zr?b folder o nazwi np odpalanie/ daj plik lua do tego folderu i plik .xml (meta.xml) i zapakuj i wejdz do ftp/resource/ i prze?li i odrazu to tam wkleisz/ wejdz na server wpisz: /refresh/start odpalanie.


tez nie dziala

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-23, 11:35


monio







Wiek: 30
Na forum: 4887 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

vehicleEngine = { false }
vehicleLights = { false }
function Script_onPlayerJoin( )
bindKey source,"j""down"Engine )
bindKey source"l""down"Lights )
end
addEventHandler "onPlayerJoin"getRootElement(), Script_onPlayerJoin)
function Script_onVehicleEnterthePlayerseat )
if seat == 0 then
if not getVehicleEngineStatesource then
vehicleEnginesource ]=false
setVehicleEngineState sourcefalse )
else
vehicleEnginesource ]=true
setVehicleEngineState sourcetrue )
end
if vehicleLightssource then
vehicleLightssource ]=true
setVehicleOverrideLights car)
else
vehicleLightssource ]=false
setVehicleOverrideLights car)
end
end
end
addEventHandler "onVehicleEnter"getRootElement(), Script_onVehicleEnter )

function Script_onVehicleExitthePlayerseat )
if ( seat==then
if not getVehicleEngineStatesource then
setVehicleEngineState sourcefalse )
vehicleEnginesource ]=false
else
setVehicleEngineState sourcetrue )
vehicleEnginesource ]=true
end
if vehicleLightssource then
setVehicleOverrideLights car)
vehicleLightssource ]=true
else
setVehicleOverrideLights car)
vehicleLightssource ]=false
end
end
end
addEventHandler "onVehicleExit"getRootElement(), Script_onVehicleExit )

function Engine player )
car getPedOccupiedVehicle player )
if ( car then
if not getVehicleEngineStatecar then
setVehicleEngineState cartrue )
outputChatBox("Silnik zosta? w??czony.",player10225551true )
vehicleEnginecar ]=true
else
setVehicleEngineState carfalse )
outputChatBox("Silnik zosta? wy??czony.",player10225551true )
vehicleEnginecar ]=false
end
end
end

function Lights player )
car getPedOccupiedVehicle player )
if ( car then
if not vehicleLightscar then
setVehicleOverrideLights car)
outputChatBox("?wiat?a zosta?y w??czone.",player10225551true )
vehicleLightscar ]=true
else
outputChatBox("?wiat?a zosta?y wy??czone.",player10225551true )
setVehicleOverrideLights car)
vehicleLightscar ]=false
end
end
end


function getVehicleEngineStatevehicle )
return vehicleEnginevehicle ]
end


<meta>
<script src="odpalaniezgaszanie.lua" type="server" />
</meta>


[ Dodano: 2014-02-23, 11:37 ]
licze na zimne :piwo:

Postaw piwo autorowi tego posta
 

 
Tagi: silnik
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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