Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Hej, od pewnego czasu szukam kolczatek i nie mog? znale?? a moja mi nie dzia?a, znalaz?em na owym forum jak??, ale te? zbugowana. Wzi??em wi?c z community i wygl?da ona tak:
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 , 1 , 1 , 1 , 1 )
end
end
addEventHandler ( "onClientColShapeHit" , getRootElement (), kolabum )
addCommandHandler ( "ustawkolczatke" , kladz )
Moje pro?by, jakie chcia?bym aby si? kto? taki znalaz? co opisa?by mi to:
1. Chcia?bym aby gracz rozk?ada? ile chce kolczatek, a nie jedn?.
2. Chcia?bym dorobi? usuni?cie ich na komend?, ale tylko tych co postawi? dany gracz.
3. Z tego co si? dowiedzia?em, to tylko osoba, kt?ra stawia kolczatk? j? widzi.
4. Gdzie? mia?em skrypt, ?e wida? nick osoby, kt?ra j? postawi?a nad kolczatk? - je?li kto? by?by tak dobry to prosi?bym.
Oczywi?cie dobrze wynagrodz? podane przeze mnie pro?by :-)
+ chatboxy si? nie pojawiaj?, debug daje warningi.