ksTakor
Members-
Posts
75 -
Joined
-
Last visited
Everything posted by ksTakor
-
Thank's worked very well
-
sorry, I can't understand how to do it. That's what I want to do: function magnetVehicleCheck ( player ) local veh = getPedOccupiedVehicle ( player ) if veh then if getElementData ( veh, "magnetic" ) then if getElementData ( veh, "hasmagnetactivated" ) then setElementData ( veh, "hasmagnetactivated", false ) detachElements ( getElementData ( veh, "magneticVeh" ) ) else local magnet = getElementData ( veh, "magnet" ) local x, y, z = getElementPosition ( magnet ) local magpos = getElementData ( veh, "magpos" ) local marker = createColSphere ( x , y , z, 2 ) local vehs = getElementsWithinColShape ( marker, "vehicle" ) destroyElement ( marker ) grabveh = false for key, vehitem in ipairs(vehs) do if vehitem ~= veh then local grabveh = vehitem --I wanna check if is grabveh is empty then allowed him to be grabbed attachElements ( grabveh, magnet, 0, 0, -1, 0, 0, getVehicleRotation(grabveh) ) setElementData ( veh, "hasmagnetactivated", true ) setElementData ( veh, "magneticVeh", grabveh ) break end end end end end end Sorry for being a noob
-
I want to identify if the vehicle is occupied, then if it is do nothing. Here is my code: function magnetVehicleCheck ( player ) local veh = getPedOccupiedVehicle ( player ) if veh then if getElementData ( veh, "magnetic" ) then if getElementData ( veh, "hasmagnetactivated" ) then setElementData ( veh, "hasmagnetactivated", false ) detachElements ( getElementData ( veh, "magneticVeh" ) ) else local magnet = getElementData ( veh, "magnet" ) local x, y, z = getElementPosition ( magnet ) local magpos = getElementData ( veh, "magpos" ) local marker = createColSphere ( x , y , z, 2 ) local vehs = getElementsWithinColShape ( marker, "vehicle" ) destroyElement ( marker ) grabveh = false for key, vehitem in ipairs(vehs) do if vehitem ~= veh then local grabveh = vehitem attachElements ( grabveh, magnet, 0, 0, -1, 0, 0, getVehicleRotation(grabveh) ) setElementData ( veh, "hasmagnetactivated", true ) setElementData ( veh, "magneticVeh", grabveh ) break end end end end end end Thanks in Advance
-
How to use it, only put in the lua and execute or add to my code?
-
I have write this script but it don't render the image Can someone help? local screenWidth,screenHeight = guiGetScreenSize() function drawncross ( prevSlot, newSlot ) if getPedWeapon(getLocalPlayer(),newSlot) == 31 then --if the switched weapon is the M4 local seconds = getTickCount() / 1000 local angle = math.sin(seconds) * 80 dxDrawImage ( screenWidth/2 - 637,- 100, 1280, 960, 'arrow.png')--drawn the crosshair else --if it isnt the M4 return end end end addEventHandler ( "onClientPlayerTarget", getRootElement(), drawncross )
-
Oh i see Thanks you helped a lot
-
How can I use OnPlayerTarget only for the m4 weapon
-
thank's, I gonna try
-
I already do this, I want detect when I aim with the m4 to hide the crosshair and dxdrawn another
-
How can I detect when I aim with the m4?
-
Thank's Ren Can you give me some help, because I am a noob kk
-
How can I add that when i use the night vision become more bright?
-
Great, and how is the progress going 50p?
-
How can I make an command only available after the player death, when he re-spawn?
-
Bump
-
Didn't work
-
Need a paid scripter only to edit a resource. For more information add me on skype: jeanflx Thanks in advance
-
This is the code: player = getLocalPlayer ( ) sw, sh = guiGetScreenSize ( ) mouse1_pressed = false FPS_CAMERA = false --FUNCTION MADE BY 'Doomed_Space_Marine', FIXED BY 'robhol' function findRotation ( x1, y1, x2, y2 ) local t = -math.deg ( math.atan2 ( x2 - x1, y2 - y1 ) ) if t < 0 then t = t + 360 end return t end --ALWAYS SET CAMERA POSITION IN THE PLAYER'S HEAD addEventHandler ( "onClientPreRender", getRootElement ( ), function ( ) if FPS_CAMERA then local x1, y1, z1 = getPedBonePosition ( player, 6 ) setCameraMatrix ( x1, y1, z1 ) if not getControlState ( "aim_weapon" ) then setControlState ( "aim_weapon", false ) end end end ) --MAKE SURE THE PLAYER AIMS WITH THE MOUSE addEventHandler ( "onClientCursorMove", getRootElement ( ), function ( guiy1, guiy1, guix2, guiy2, x2, y2, z2 ) if not isCursorShowing ( ) and not isChatBoxInputActive ( ) and not isMainMenuActive ( ) and FPS_CAMERA then local x1, y1, z1 = getPedBonePosition ( player, 6 ) setPedRotation ( player, findRotation ( x1, y1, x2, y2 ) ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end end ) --A SIMPLE WAY TO MAKE A KEY REPEATER bindKey ( "mouse1", "both", function ( k, state ) if state == "down" then mouse1_pressed = true else mouse1_pressed = false end end ) --CONTROLS PART function resetControls ( ) toggleControl ( "aim_weapon", not FPS_CAMERA ) toggleControl ( "backwards", not FPS_CAMERA ) toggleControl ( "sprint", not FPS_CAMERA ) toggleControl ( "right", not FPS_CAMERA ) toggleControl ( "left", not FPS_CAMERA ) toggleControl ( "fire", not FPS_CAMERA ) toggleControl ( "enter_vehicle", not FPS_CAMERA ) toggleControl ( "enter_passenger", not FPS_CAMERA ) if FPS_CAMERA then setElementAlpha ( player, 0 ) else setElementAlpha ( player, 255 ) end end --DRAW A BEAUTIFUL CROSSHAIR IN THE MIDDLE OF THE SCREEN addEventHandler ( "onClientRender", getRootElement ( ), function ( ) if FPS_CAMERA then dxDrawImage ( ( sw / 2 ) - 4, ( sh / 2 ) - 4, 8, 8, "crosshair.png" ) end end ) addCommandHandler ( "fpscamera", function ( ) FPS_CAMERA = not FPS_CAMERA if not FPS_CAMERA then setCameraTarget ( player ) else resetCamera ( ) end resetControls ( ) end )
-
hum the problem in the resource is the weapon don't follow the crosshair up and down. This will make it follow?
-
I am with a problem in a first person script, how can I make the weapon follow my custom crosshair?
-
The two change the skins, but I don't want.
-
I found a script of first person but I cannot aim up an down with a weapon. Here is the script: player = getLocalPlayer ( ) sw, sh = guiGetScreenSize ( ) mouse1_pressed = false FPS_CAMERA = false --FUNCTION MADE BY 'Doomed_Space_Marine', FIXED BY 'robhol' function findRotation ( x1, y1, x2, y2 ) local t = -math.deg ( math.atan2 ( x2 - x1, y2 - y1 ) ) if t < 0 then t = t + 360 end return t end --ALWAYS SET CAMERA POSITION IN THE PLAYER'S HEAD addEventHandler ( "onClientPreRender", getRootElement ( ), function ( ) if FPS_CAMERA then local x1, y1, z1 = getPedBonePosition ( player, 6 ) setCameraMatrix ( x1, y1, z1 ) if not getControlState ( "aim_weapon" ) then setControlState ( "aim_weapon", false ) end end end ) --MAKE SURE THE PLAYER AIMS WITH THE MOUSE addEventHandler ( "onClientCursorMove", getRootElement ( ), function ( guiy1, guiy1, guix2, guiy2, x2, y2, z2 ) if not isCursorShowing ( ) and not isChatBoxInputActive ( ) and not isMainMenuActive ( ) and FPS_CAMERA then local x1, y1, z1 = getPedBonePosition ( player, 6 ) setPedRotation ( player, findRotation ( x1, y1, x2, y2 ) ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end end ) --A SIMPLE WAY TO MAKE A KEY REPEATER bindKey ( "mouse1", "both", function ( k, state ) if state == "down" then mouse1_pressed = true else mouse1_pressed = false end end ) --CONTROLS PART function resetControls ( ) toggleControl ( "aim_weapon", not FPS_CAMERA ) toggleControl ( "backwards", not FPS_CAMERA ) toggleControl ( "sprint", not FPS_CAMERA ) toggleControl ( "right", not FPS_CAMERA ) toggleControl ( "left", not FPS_CAMERA ) toggleControl ( "fire", not FPS_CAMERA ) toggleControl ( "enter_vehicle", not FPS_CAMERA ) toggleControl ( "enter_passenger", not FPS_CAMERA ) if FPS_CAMERA then setElementAlpha ( player, 0 ) else setElementAlpha ( player, 255 ) end end --DRAW A BEAUTIFUL CROSSHAIR IN THE MIDDLE OF THE SCREEN addEventHandler ( "onClientRender", getRootElement ( ), function ( ) if FPS_CAMERA then dxDrawImage ( ( sw / 2 ) - 4, ( sh / 2 ) - 4, 8, 8, "crosshair.png" ) end end ) addCommandHandler ( "fpscamera", function ( ) FPS_CAMERA = not FPS_CAMERA if not FPS_CAMERA then setCameraTarget ( player ) else resetCamera ( ) end resetControls ( ) end ) Help me
-
Good Luck, I wish that you can finish this tool. Again good luck.
