فاّرس Posted July 7, 2013 Share Posted July 7, 2013 (edited) Position = { [1] = {x,y,z}, [2] = {x,y,z}, [3] = {x,y,z}, } addCommandHandler("set", function(player) if getElementType(player) == 'player' then Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) setElementPosition(player,Pos_X,Pos_Y,Pos_Z) local Position_X,Position_Y,Position_Z = getElementPosition(player) Car = createVehicle(605,Position_X,Position_Y,Position_Z) warpPedIntoVehicle(player,Car) end end ) Bad argument @ 'createVehicle'[Expected number at argument2,got nil] Edited July 7, 2013 by Guest Link to comment
#Al-Ha[J]aRii Posted July 7, 2013 Share Posted July 7, 2013 Position = { [1] = {x,y,z}, [2] = {x,y,z}, [3] = {x,y,z}, } addCommandHandler("set", function(player) if getElementType(player) == 'player' then Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) setElementPosition(player,Pos_X,Pos_Y,Pos_Z) local Position_X,Position_Y,Position_Z = getElementPosition(player) Car = createVehicle(605,Position_X,Position_Y,Position_Z) warpPedIntoVehicle(player,Car) end end ) Bad argument @ 'createVehicle'[Expected number at argument2,got nil] لايوجد سيارة ID = 605 هذه الغلط ذذ Link to comment
فاّرس Posted July 7, 2013 Author Share Posted July 7, 2013 Position = { [1] = {x,y,z}, [2] = {x,y,z}, [3] = {x,y,z}, } addCommandHandler("set", function(player) if getElementType(player) == 'player' then Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) setElementPosition(player,Pos_X,Pos_Y,Pos_Z) local Position_X,Position_Y,Position_Z = getElementPosition(player) Car = createVehicle(605,Position_X,Position_Y,Position_Z) warpPedIntoVehicle(player,Car) end end ) Bad argument @ 'createVehicle'[Expected number at argument2,got nil] لايوجد سيارة ID = 605 هذه الغلط ذذ لا موجوده ذذ Link to comment
#Al-Ha[J]aRii Posted July 7, 2013 Share Posted July 7, 2013 Position = { [1] = {x,y,z}, [2] = {x,y,z}, [3] = {x,y,z}, } addCommandHandler("set", function(player) if getElementType(player) == 'player' then Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) setElementPosition(player,Pos_X,Pos_Y,Pos_Z) local Position_X,Position_Y,Position_Z = getElementPosition(player) Car = createVehicle(605,Position_X,Position_Y,Position_Z) warpPedIntoVehicle(player,Car) end end ) Bad argument @ 'createVehicle'[Expected number at argument2,got nil] لايوجد سيارة ID = 605 هذه الغلط ذذ لا موجوده ذذ هههههههه سهران و مادري مخي وين راح المهم انا جربت الكود و سويت للسيارة احداثيات و الكود تمام و شغال يمكن المشكلة من الاحداثيات في الجدول : Position = { [1] = {2495.6311035156,-1670.9040527344,13.335947036743}, [2] = {2478.4775390625,-1668.4677734375,13.330327033997}, [3] = {2479.5393066406,-1655.3582763672,13.311396598816}, } addCommandHandler("set", function(player) if getElementType(player) == 'player' then Pos_X,Pos_Y,Pos_Z = unpack(Position[math.random(#Position)]) setElementPosition(player,Pos_X,Pos_Y,Pos_Z) local Position_X,Position_Y,Position_Z = getElementPosition(player) Car = createVehicle(605,Position_X,Position_Y,Position_Z) warpPedIntoVehicle(player,Car) end end ) Link to comment
فاّرس Posted July 7, 2013 Author Share Posted July 7, 2013 الاحداثيات تمام عندي , واذا كتبت الامر يسوي لي احداثيات عشوائي + السيارة ما تظهر ويطلع خطأ بالديبوق Link to comment
PaiN^ Posted July 7, 2013 Share Posted July 7, 2013 local Position = { { x, y, z }, { x, y, z }, { x, y, z } } local vehicles = { } addCommandHandler( "set", function( player ) if isElement( vehicles[ player ] ) then destroyElement( vehicles[ player ] ) end local Pos_X, Pos_Y, Pos_Z = unpack( Position[ math.random( #Position ) ] ) setElementPosition( player, Pos_X, Pos_Y, Pos_Z ) vehicles[ player ] = createVehicle( 605, Pos_X, Pos_Y, Pos_Z ) if vehicles[ player ] then warpPedIntoVehicle( player, vehicles[ player ] ) end end ) Link to comment
فاّرس Posted July 7, 2013 Author Share Posted July 7, 2013 local Position = { { x, y, z }, { x, y, z }, { x, y, z } } local vehicles = { } addCommandHandler( "set", function( player ) if isElement( vehicles[ player ] ) then destroyElement( vehicles[ player ] ) end local Pos_X, Pos_Y, Pos_Z = unpack( Position[ math.random( #Position ) ] ) setElementPosition( player, Pos_X, Pos_Y, Pos_Z ) vehicles[ player ] = createVehicle( 605, Pos_X, Pos_Y, Pos_Z ) if vehicles[ player ] then warpPedIntoVehicle( player, vehicles[ player ] ) end end ) يعطيك العافيه ما قصرت يالذيب , Link to comment
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