Wysłany: 2016-02-06, 15:56
Luker
Jakiś NoName
Wiek: 23 Na forum: 3890 dni Posty: 15
Nick w MP: LukeR
Witajcie, mam problem ze skryptem, a mianowicie z mechanikiem. Wszystko dzia?a po wjechaniu w marker fixa nam auto lecz nie wiem jak zrobi? aby zabiera?o graczowi pieni?dze. Mo?e kto? wie? za pomoc
Wysłany: 2016-02-06, 17:01
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4261 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-02-06, 20:09
Luker
Jakiś NoName
Wiek: 23 Na forum: 3890 dni Posty: 15
Nick w MP: LukeR
Hmmm.. dzi?ki ale ci?gle po wjechaniu w marker wyskakuje error:
[2016-02-06 18] WARNING: [testowane]/mechanik/main.lua:110: Bad argument @ 'takePlayerMoney' [Expected element at argument 1, got nil]
I nie wiem co z tym zrobi?
(My?l?, ?e prawdopodobnie umie?ci?em to takeplayermoney w z?ym miejscu)
Tutaj kawa?ek skryptu:
function showGarageBlips ( show )
if show then
outputServerLog ( "AR: show blips of garages" )
else
outputServerLog ( "AR: hide blips of garages" )
end
for marker , obj in pairs ( g_garages ) do
if show then
if obj . blip == nil then
obj . blip = createBlip ( obj . x , obj . y , obj . z , GARAGE_ICON )
end
else
if obj . blip then
destroyElement ( obj . blip )
obj . blip = nil
end
end
end
end
-----------------------------------------------------------------------------------------------------------------------
function onMarkerHit ( hitElement , matchingDimension )
if not matchingDimension then
return
end
if getElementType ( hitElement ) == "vehicle" then
local g_obj = g_garages [ source ]
if g_obj then
-- Trigger event for all resources . Vehicle element is the source of event .
if triggerEvent ( "autorepairMarkerHit" , hitElement , g_obj . id ) then
-- Now we can fix vehicle .
if fixVehicle ( hitElement ) then
takePlayerMoney ( thePlayer , 1000 )
local driver = getVehicleOccupant ( hitElement ) -- get the player sitting in seat 0
if driver then
-- playSoundFrontEnd ( driver , 46 ) -- repair sound . Crapy sound ..
triggerClientEvent ( driver , "playRepairSound" , driver )
end
-- Trigger event for all resources . Vehicle element is the source of event .
triggerEvent ( "vehicleRepaired" , hitElement , g_obj . id )
else
end
else
end
end
end
end
-----------------------------------------------------------------------------------------------------------------------
function createGarageObj ( id , name , x , y , z )
local obj = {}
obj . x = x
obj . y = y
obj . z = z
obj . id = id
obj . name = name
local marker = createMarker ( x , y , z , "cylinder" , MARKER_SIZE , 255 , 0 , 0 )
if marker then
g_garages [ marker ] = obj
addEventHandler ( "onMarkerHit" , marker , onMarkerHit )
return obj
else
return false
end
end
Wysłany: 2016-02-06, 20:11
GreenApple
Wiek: 28 Na forum: 3860 dni Posty: 27
Piwa : 2
[quote="Luker"][/quote]Odczytaj prywatn? wiadomo?? lub wejd? na fb.
A co do kodu trzeba da? kwot? zabrania ze swojego stanu, chcia?em Ci pom?c....
[ Dodano : 2016-02-06, 20:15 ]
Luker , odpowiedz @up
Tagi: zabieranie :: pieniędzy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: