Miika Posted July 3, 2014 Posted July 3, 2014 My resource not working... local amark = { {1667.2,1014.3,10.8}, } function createMarker() local random = math.random ( #amark ) local x, y, z = amark[random][1] Marker = createMarker ( x, y, z "cylinder", 4, 255, 255, 0, 170 ) setElementCollisionsEnabled( Marker, false ) bl = createBlipAttachedTo(Marker,11) outputChatBox( "Autokaupan ryöstö on saatavilla! Ryöstä se keltaisen rekan luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createMarker) addEventHandler("onMarkerHit",root, function ( player ) if ( source ~= Marker ) then return end if ( isPedInVehicle( player ) ) then return end destroyElement( Marker ) destroyElement( bl ) randomMoney = math.random ( 3000, 5000 ) givePlayerMoney(player,randomMoney) setPlayerWantedLevel ( player, 6 ) outputChatBox("Sait $" .. tostring(randomMoney) .." rahaa ja 6 tähteä", player, 0, 250, 0) setTimer( createMarker, 900000, 1 ) end ) Sorry my bad english D:
MIKI785 Posted July 3, 2014 Posted July 3, 2014 What about debug? Saying that it doesn't work isn't enough..
MTA Team botder Posted July 3, 2014 MTA Team Posted July 3, 2014 function createMarker() Change the name from your function because it overwrites the original MTA function.
Miika Posted July 3, 2014 Author Posted July 3, 2014 What about debug? Saying that it doesn't work isn't enough.. I want make "rob the car shop" resource.
Miika Posted July 3, 2014 Author Posted July 3, 2014 function createMarker() Change the name from your function because it overwrites the original MTA function. I change the function, but not working... local amark = { {1667.2,1014.3,10.8}, } function createRob() local random = math.random ( #amark ) local x, y, z = amark[random][1] Marker = createMarker ( x, y, z "cylinder", 4, 255, 255, 0, 170 ) setElementCollisionsEnabled( Marker, false ) bl = createBlipAttachedTo(Marker,11) outputChatBox( "Autokaupan ryöstö on saatavilla! Ryöstä se keltaisen rekan luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createRob) addEventHandler("onMarkerHit",root, function ( player ) if ( source ~= Marker ) then return end if ( isPedInVehicle( player ) ) then return end destroyElement( Marker ) destroyElement( bl ) randomMoney = math.random ( 3000, 5000 ) givePlayerMoney(player,randomMoney) setPlayerWantedLevel ( player, 6 ) outputChatBox("Sait $" .. tostring(randomMoney) .." rahaa ja 6 tähteä", player, 0, 250, 0) setTimer( createMarker, 900000, 1 ) end )
_DrXenon Posted July 3, 2014 Posted July 3, 2014 x,y,z = amark[random][1],amark[random][2],amark[random][3] That will fix it
Et-win Posted July 3, 2014 Posted July 3, 2014 setTimer( createMarker, 900000, 1 ) You forgot to change that too btw.
_DrXenon Posted July 3, 2014 Posted July 3, 2014 As function name was changed, it should be: SetTimer(createRob,900000,1)
Miika Posted July 3, 2014 Author Posted July 3, 2014 x,y,z = amark[random][1],amark[random][2],amark[random][3]That will fix it Thx! It working!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now