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

Wysłany: 2015-10-18, 13:10


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

Witam, gdy wpisuje /x i jest kolczatka, ale jest minus tego, ?e jak wjad? przednimi ko?ami to od razu te cztery znikaj? zamiast jednego i czy jest mo?liwo?? taka by mi kto? to edytowa? :)

Kod:


local thePlayer = getLocalPlayer()
local theKolczatka = {}
local kolec = {}
function kladz()
if( isPlayerInVehicle( thePlayer ) ) then -- is the player in a car?
if( isElement( theKolczatka[ thePlayer ] ) ) then
destroyElement( theKolczatka[ thePlayer ] )
destroyElement( kolec[ thePlayer ] )
end
local theVehicle = getPlayerOccupiedVehicle( thePlayer )
local rx, ry, rz = getVehicleRotation( theVehicle )
local x, y, z = getElementPosition( theVehicle )
local a = getPlayerRotation( thePlayer )
x = x + math.sin( math.rad(a) ) * 4
y = y - math.cos( math.rad(a) ) * 4
rz = rz + 90
local ziemiaZ = getGroundPosition( x, y, z )
if( ziemiaZ ~= z ) then z = ziemiaZ + 0.2 end
theKolczatka[ thePlayer ] = createObject( 2899, x, y, z, 0, 0, rz )
kolec[ thePlayer ] = createColRectangle( (x - 2.0), (y - 2.0), 4.0, 4.0 )
setElementData( kolec[ thePlayer ], "kolce", "abc" )
outputChatBox( "Roz?o?y?e? kolczatk?!", thePlayer, 255, 0, 0, true )
else
outputChatBox( "Musisz by? w aucie ?eby po?o?yc kolczatk?!", thePlayer, 255, 0, 0, true )
end
end

function kolabum( theElement, matchingDimension )
if( getElementType( theElement ) == "vehicle" and getElementData( source, "kolce" ) == "abc" ) then
setVehicleWheelStates( theElement, 2, 2, 2, 2 )
end
end

I jeszcze chce je usun??, ale niestety jeszcze nie umiem tak dobrze tego napisa? aby usun?? czy kto? m?g?by to przerobi? lepiej :) ?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-19, 18:26


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Pr?buj xD :

local thePlayer getLocalPlayer() 
local theKolczatka = {} 
local kolec = {} 
function kladz() 
if( isPlayerInVehiclethePlayer ) ) then -- is the player in a car? 
if( isElementtheKolczatkathePlayer ] ) ) then 
destroyElementtheKolczatkathePlayer ] ) 
destroyElementkolecthePlayer ] ) 
end 
local theVehicle getPlayerOccupiedVehiclethePlayer local rxryrz getVehicleRotationtheVehicle local xygetElementPositiontheVehicle local a getPlayerRotationthePlayer math.sinmath.rad(a) ) * 4 
y math.cosmath.rad(a) ) * 4 
rz rz 90 
local ziemiaZ getGroundPositionxy) 
if( ziemiaZ ~= then z ziemiaZ 0.2 end 
theKolczatkathePlayer ] = createObject2899xyz00rz kolecthePlayer ] = createColRectangle( (2.0), (2.0), 4.04.0 setElementDatakolecthePlayer ], "kolce""abc" outputChatBox"Roz?o?y?e? kolczatk?!"thePlayer25500true ) 
else 
outputChatBox"Musisz by? w aucie ?eby po?o?yc kolczatk?!"thePlayer25500true end 
end 
addCommandHandler ("kolczatka"kladz)

function kolabumtheElementmatchingDimension ) 
if( getElementTypetheElement ) == "vehicle" and getElementDatasource"kolce" ) == "abc" then 
setVehicleWheelStatestheElement202end 
end

function usun (theKolczatkathePlayer])
         deleteObject (theKolczatkathePlayer])
end
addCommandHandler ("usun"usun)


Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Tagi: kolaczatki
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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