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: 5160 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: 27
Na forum: 5319 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: 5160 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: 27
Na forum: 5319 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: 5160 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: 33
Na forum: 6853 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: 5028 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

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

 function turnEngineOn ( theVehicle, jackerPlayer ) 
 if leftSeat == 1 and not jackerPlayer then 
 setVehicleEngineState ( theVehicle, true ) 
 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: 5160 dni
Posty: 8
Nick w MP: KoksiarskiPL



Respekt: 50

"monio" napisał/a:

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

 function turnEngineOn ( theVehicle, jackerPlayer ) 
 if leftSeat == 1 and not jackerPlayer then 
 setVehicleEngineState ( theVehicle, true ) 
 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: 5028 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: 5160 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 ( theVehicle, jackerPlayer ) 
 if leftSeat == 0 and not jackerPlayer then 
 setVehicleEngineState ( theVehicle, false ) 
 end 
 end 
 bindKey(source, "K", "down", turnEngineOff) 
 addEventHandler ( "onPlayerVehicle", getRootElement ( ), turnEngineOff ) 

 function turnEngineOn ( theVehicle, jackerPlayer ) 
 if leftSeat == 1 and not jackerPlayer then 
 setVehicleEngineState ( theVehicle, true ) 
 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: 5028 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: 5160 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: 5028 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_onVehicleEnter( thePlayer, seat )
if seat == 0 then
if not getVehicleEngineState( source ) then
vehicleEngine[ source ]=false
setVehicleEngineState ( source, false )
else
vehicleEngine[ source ]=true
setVehicleEngineState ( source, true )
end
if vehicleLights[ source ] then
vehicleLights[ source ]=true
setVehicleOverrideLights ( car, 2 )
else
vehicleLights[ source ]=false
setVehicleOverrideLights ( car, 1 )
end
end
end
addEventHandler ( "onVehicleEnter", getRootElement(), Script_onVehicleEnter )

function Script_onVehicleExit( thePlayer, seat )
if ( seat==0 ) then
if not getVehicleEngineState( source ) then
setVehicleEngineState ( source, false )
vehicleEngine[ source ]=false
else
setVehicleEngineState ( source, true )
vehicleEngine[ source ]=true
end
if vehicleLights[ source ] then
setVehicleOverrideLights ( car, 2 )
vehicleLights[ source ]=true
else
setVehicleOverrideLights ( car, 1 )
vehicleLights[ source ]=false
end
end
end
addEventHandler ( "onVehicleExit", getRootElement(), Script_onVehicleExit )

function Engine ( player )
car = getPedOccupiedVehicle ( player )
if ( car ) then
if not getVehicleEngineState( car ) then
setVehicleEngineState ( car, true )
outputChatBox("Silnik zosta? w??czony.",player, 102, 255, 51, true )
vehicleEngine[ car ]=true
else
setVehicleEngineState ( car, false )
outputChatBox("Silnik zosta? wy??czony.",player, 102, 255, 51, true )
vehicleEngine[ car ]=false
end
end
end

function Lights ( player )
car = getPedOccupiedVehicle ( player )
if ( car ) then
if not vehicleLights[ car ] then
setVehicleOverrideLights ( car, 2 )
outputChatBox("?wiat?a zosta?y w??czone.",player, 102, 255, 51, true )
vehicleLights[ car ]=true
else
outputChatBox("?wiat?a zosta?y wy??czone.",player, 102, 255, 51, true )
setVehicleOverrideLights ( car, 1 )
vehicleLights[ car ]=false
end
end
end


function getVehicleEngineState( vehicle )
return vehicleEngine[ vehicle ]
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 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