rogerioexper Posted September 12, 2016 Share Posted September 12, 2016 mkl - createmaker(1274.0817871094, -1657.0938720703, 13.546875 ,"cylinder" 1.5 , 0, 255, 0, 255) function createVehicleForPlayer(thePlayer, command, vehicleModel) local x 1274.0817871094,y -1657.0938720703,z 13.546875 = getElementPosition(thePlayer) x = x + 5 adiciona 5 unidades na variável x local createdVehicle = createVehicle(tonumber(VechicleModel),x,y,z) if (createdVehicle == false) then outputChatBox("Could not create the vehicle . The syntax is: /createvehicle [597]",thePlayer) end someone help this giving error "-" "=" expected near I need a lot of help from some script Link to comment
aka Blue Posted September 12, 2016 Share Posted September 12, 2016 It's so bad that code. Use this i think: mkl - createmaker(1274.0817871094, -1657.0938720703, 13.546875 ,"cylinder" 1.5 , 0, 255, 0, 255) function createVehicleForPlayer( player, cmd, model ) local model = tonumber( model ) if model then local x, y, z = getElementPosition( player ) local vehicle = createVehicle( model, x, y, z ) else outputChatBox( "Syntax: /"..cmd.." [model]", player, 255, 255, 255 ) end end 1 Link to comment
KariiiM Posted September 12, 2016 Share Posted September 12, 2016 local mkl = createMarker ( 1274.0817871094, -1657.0938720703, 13.546875 ,"cylinder", 1.5, 0, 255, 0, 255 ) function createVehicleForPlayer ( thePlayer, _, vehicleModel ) local vehicleModel = tonumber ( vehicleModel ) local x ,y ,z = getElementPosition ( thePlayer ) --x = x + 5 adiciona 5 unidades na variável x local createdVehicle = createVehicle ( vehicleModel, x + 5, y, z ) if ( not createdVehicle ) then outputChatBox ( "Could not create the vehicle . The syntax is: /createvehicle [597]", thePlayer, 255, 0, 0 ) else outputChatBox ( "The vehicle was created successfully.", thePlayer, 0, 255, 0 ) end end 1 Link to comment
rogerioexper Posted September 12, 2016 Author Share Posted September 12, 2016 Thank you so much it activates the marker more does not create the vehicle friend Link to comment
_DrXenon Posted September 12, 2016 Share Posted September 12, 2016 3 hours ago, rogerioexper said: Thank you so much it activates the marker more does not create the vehicle friend It would not create the vehicle when you hit the marker. Your script is kinda made for a command. This means uou gotta add: addCommandHandler("car",createVehicleForPlayer) or add an event handler that triggers when you hit the marker - with a bit of parameters changes 1 Link to comment
..:D&G:.. Posted September 13, 2016 Share Posted September 13, 2016 (edited) local mkl = createMarker ( 1274.0817871094, -1657.0938720703, 13.546875 ,"cylinder", 1.5, 0, 255, 0, 255 ) local vehID = 597 function createVehicleForPlayer ( thePlayer ) local x ,y ,z = getElementPosition ( thePlayer ) local createdVehicle = createVehicle ( vehID, x + 5, y, z ) if ( not createdVehicle ) then outputChatBox ( "Error spawning vehicle.", thePlayer, 255, 0, 0 ) else outputChatBox ( "The vehicle was created successfully.", thePlayer, 0, 255, 0 ) end end addEventHandler( "onMarkerHit", mkl, createVehicleForPlayer ) Edited September 13, 2016 by ..:D&G:.. 1 Link to comment
Walid Posted September 13, 2016 Share Posted September 13, 2016 (edited) local mkl = createMarker ( 1274.0817871094, -1657.0938720703, 13.546875 ,"cylinder", 1.5, 0, 255, 0, 255 ) function createVehicleForPlayer ( thePlayer ) if thePlayer and getElementType( thePlayer ) == "player" and not isPedInVehicle (thePlayer) then local x ,y ,z = getElementPosition ( thePlayer ) local createdVehicle = createVehicle (597, x + 5, y, z ) if ( not createdVehicle ) then outputChatBox ( "Error spawning vehicle.", thePlayer, 255, 0, 0 ) else outputChatBox ( "The vehicle was created successfully.", thePlayer, 0, 255, 0 ) end end end addEventHandler( "onMarkerHit", mkl, createVehicleForPlayer ) Edited September 13, 2016 by Walid 1 Link to comment
rogerioexper Posted September 14, 2016 Author Share Posted September 14, 2016 Thank you so much 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