isa_Khamdan Posted September 28, 2013 Share Posted September 28, 2013 Hello , I making a Warp panel but I am having a little problem with setElementPosition(localPlayer,x,y,z) This will only change the player position so how can I make it spawn the player with the vehicle if he have one in the selected x,y,z? Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 warpPedIntoVehicle Hmm it works but I still have one problem with my code It doesn't fade Camera so can anyone tell me how can I fix it? fadeCamera(true, 5) Link to comment
iMr.3a[Z]eF Posted September 28, 2013 Share Posted September 28, 2013 The whole codes? Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 The whole codes? Only the fade camera isn't working , I think there is a mistake in the Syntax cuz I couldn't find the right one So can you give me the right Syntax for FadeCamera ( Client Side ). Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 bool fadeCamera ( bool fadeIn, [ float timeToFade = 1.0, int red = 0, int green = 0, int blue = 0 ] ) 'false' fade the camera. 'true' not fade. Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 bool fadeCamera ( bool fadeIn, [ float timeToFade = 1.0, int red = 0, int green = 0, int blue = 0 ] ) 'false' fade the camera. 'true' not fade. So it should look like this? fadeCamera ( true, 5) Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 This code will not fade the camera. Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 then which code should do that?? Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 Should be : fadeCamera ( false, 5) Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 Should be : fadeCamera ( false, 5) Hmm , The Camera fade now but how can I make it stop after 1 second? Link to comment
iPrestege Posted September 28, 2013 Share Posted September 28, 2013 fadeCamera ( true,1 ) --Show after 1 second. fadeCamera ( false,1 ) --Hide after 1 second . Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 fadeCamera ( true,1 ) --Show after 1 second. fadeCamera ( false,1 ) --Hide after 1 second . It doesn't work addEventHandler("onClientGUIClick",root, function () local sel = guiGridListGetSelectedItem(grid) local theVehicle = getPedOccupiedVehicle ( localPlayer ) if source == move then if sel ~= -1 then if not isPedInVehicle ( localPlayer ) then local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) fadeCamera ( false, 0.5) fadeCamera ( true, 2 ) setElementPosition(localPlayer,x,y,z) elseif source == move then if sel ~= -1 then if isPedInVehicle ( localPlayer ) then local Controler = getVehicleController ( theVehicle ) if ( Controler ) then local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) fadeCamera ( false, 0.5 ) fadeCamera ( true, 2 ) setElementPosition(theVehicle,x,y,z) warpPedIntoVehicle ( localPlayer, theVehicle ) end end end end else outputChatBox("* Please Select A Positon",255,0,0) end end end ) Link to comment
Castillo Posted September 28, 2013 Share Posted September 28, 2013 warpPedIntoVehicle is not required, that function is used to warp a player/ped into a vehicle, not change the position of it. addEventHandler ( "onClientGUIClick", root, function ( ) local sel = guiGridListGetSelectedItem ( grid ) local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( source == move ) then if ( sel ~= -1 ) then local theElement = ( theVehicle and theVehicle or localPlayer ) local x, y, z = unpack ( guiGridListGetItemData ( grid, sel, 1 ) ) fadeCamera ( false, 0.5 ) fadeCamera ( true, 2 ) setElementPosition ( theElement, x, y, z ) else outputChatBox ( "* Please Select A Positon", 255, 0, 0 ) end end end ) That should change the position of the vehicle ( if he/she is in one ) and the localPlayer ( if not in a vehicle ). Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 warpPedIntoVehicle is not required, that function is used to warp a player/ped into a vehicle, not change the position of it. addEventHandler ( "onClientGUIClick", root, function ( ) local sel = guiGridListGetSelectedItem ( grid ) local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( source == move ) then if ( sel ~= -1 ) then local theElement = ( theVehicle and theVehicle or localPlayer ) local x, y, z = unpack ( guiGridListGetItemData ( grid, sel, 1 ) ) fadeCamera ( false, 0.5 ) fadeCamera ( true, 2 ) setElementPosition ( theElement, x, y, z ) else outputChatBox ( "* Please Select A Positon", 255, 0, 0 ) end end end ) That should change the position of the vehicle ( if he/she is in one ) and the localPlayer ( if not in a vehicle ). It is working but why the Camera doesn't fade? Link to comment
Castillo Posted September 28, 2013 Share Posted September 28, 2013 Well, you are fading it-in too fast, you should use a timer. Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 Well, you are fading it-in too fast, you should use a timer. Like this? setTimer ( fadeCamera, 5, true ) Edit: I want it to Fade just like on the freeroam when you use set position using the map. Link to comment
Castillo Posted September 28, 2013 Share Posted September 28, 2013 No, that's wrong. Use: setTimer ( fadeCamera, 500, 1, true ) Link to comment
isa_Khamdan Posted September 28, 2013 Author Share Posted September 28, 2013 No, that's wrong.Use: setTimer ( fadeCamera, 500, 1, true ) Thanks a lot it's working fine now 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