MisterQuestions Posted September 20, 2014 Share Posted September 20, 2014 Hi i got a error this supose to set the camera to a garage when player uses command, but just have errors whats wrong? Server-Side function garage1() fadeCamera( source, true, 5) setCameraMatrix(source, 1873, -2101, 14, 1873, -2101, 14) --Un extra... outputChatBox ( "#FF9E00Welcome to the garage!", getRootElement(), 255, 255, 255, true ) end addCommandHandler("g1", garage1) Logs [2014-09-19 20:52:28] WARNING: gm\server.lua:14: Bad argument @ 'fadeCamera' [Expected element at argument 1, got nil] [2014-09-19 20:52:28] WARNING: gm\server.lua:15: Bad argument @ 'setCameraMatrix' [Expected element at argument 1, got nil] Link to comment
Emile Posted September 20, 2014 Share Posted September 20, 2014 Try this: function garage1(source) fadeCamera( source, true, 5) setCameraMatrix( source, 1873, -2101, 14, 1873, -2101, 14) --Un extra... outputChatBox ( "#FF9E00Welcome to the garage!", source, 255, 255, 255, true ) end addCommandHandler("g1", garage1) Link to comment
Anubhav Posted September 20, 2014 Share Posted September 20, 2014 function garage1(source) fadeCamera( source, true, 5) setCameraMatrix(source, 1873, -2101, 14, 1873, -2101, 14) --Un extra... outputChatBox ( "#FF9E00Welcome to the garage!", source, 255, 255, 255, true ) end addCommandHandler("g1", garage1) Edit: GoldenEye was faster Link to comment
MisterQuestions Posted September 20, 2014 Author Share Posted September 20, 2014 Mmm i will try..but now how to create a vehicle in x position just for deco on a login screen and when player login destroy them. Link to comment
MisterQuestions Posted September 20, 2014 Author Share Posted September 20, 2014 When a player join to server the camera is seted to a "X" point, how to create cars on that point, just for decoration... Link to comment
Anubhav Posted September 20, 2014 Share Posted September 20, 2014 playerCars = {} function garage1(source) fadeCamera( source, true, 5) setCameraMatrix(source, 1873, -2101, 14, 1873, -2101, 14) playerCars[source] = createVehicle(345, 1873, -2101, 14) setElementVisibleTo(playerCars[source], root, false) setElementVisibleTo(playerCars[source], source, true) outputChatBox ( "#FF9E00Welcome to the garage!", source, 255, 255, 255, true ) end addCommandHandler("g1", garage1) addEventHandler("onPlayerQuit", root, function() if playerCars[source] then destroyElement(playerCars[source]) playerCars[source] = nil end end ) addEventHandler("onPlayerLogin", root, function() if playerCars[source] then destroyElement(playerCars[source]) playerCars[source] = nil end end ) I-guess. Link to comment
MisterQuestions Posted September 20, 2014 Author Share Posted September 20, 2014 oh! amazing.... now i need to search a place to set camera (when i say place i mean to a garage) Link to comment
Anubhav Posted September 20, 2014 Share Posted September 20, 2014 Thanks and no problem. 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