Soren Posted February 11, 2012 Share Posted February 11, 2012 (edited) Hola a todos quiero pasar a este script a un commando que sea /fps checking = 0 function FPSStart (startedresource) if startedresource == getThisResource() then local x,y,z = getElementPosition( getLocalPlayer() ) Body = createObject (983, x, y, z ) attachElements ( Body, getLocalPlayer(), 0, -0.1, 0.45, 90, 0, 90) setElementAlpha( Body, 0) setTimer ( setElementAlpha,1000, 1, getLocalPlayer(), 0) end end addEventHandler ( "onClientResourceStart", getRootElement(), FPSStart) function invisOnSpawn() setElementAlpha(getLocalPlayer(), 0) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), invisOnSpawn ) function climbcheck() setElementCollisionsEnabled(Body, false) if checking == 0 then checking = 1 stopclimbcheck = setTimer ( stopCcheck, 1200, 1 ) addEventHandler ("onClientRender", getRootElement(), areyouclimbing) elseif checking == 1 then killTimer(stopclimbcheck) stopclimbcheck = setTimer ( stopCcheck, 1200, 1 ) end end bindKey ("jump", "down", climbcheck ) function stopCcheck() setElementCollisionsEnabled(Body, true) removeEventHandler("onClientRender", getRootElement(), areyouclimbing) setCameraTarget (getLocalPlayer()) checking = 0 end function areyouclimbing() hx,hy,hz = getPedBonePosition ( getLocalPlayer(), 8 ) local rot = getPedRotation (getLocalPlayer()) radRot = math.rad ( rot ) local radius = .5 local tx = hx + radius * math.sin(radRot) local ty = hy + -(radius) * math.cos(radRot) local tz = hz setCameraMatrix(tx,ty,tz,hx,hy,hz) if ( isPedDoingTask ( getLocalPlayer(), "TASK_SIMPLE_CLIMB" ) ) then killTimer(stopclimbcheck) doneclimbyet = setTimer ( finishCcheck, 400, 1 ) end end function finishCcheck() if ( isPedDoingTask ( getLocalPlayer(), "TASK_SIMPLE_CLIMB" ) ) then doneclimbyet = setTimer ( finishCcheck, 400, 1 ) else finishedclimbing() end end function finishedclimbing() checking = 0 removeEventHandler("onClientRender", getRootElement(), areyouclimbing) setElementCollisionsEnabled(Body, true) setCameraTarget (getLocalPlayer()) end function FPSStop (startedresource) if startedresource == getThisResource() then setElementAlpha( getLocalPlayer(), 255) setCameraTarget (getLocalPlayer()) end end addEventHandler ( "onClientResourceStop", getRootElement(), FPSStop) function shakeCamera(weapon) x,y,z = getPedBonePosition ( getLocalPlayer(), 26 ) if weapon == 24 then createExplosion ( x,y,z + 10,12,false,0.4,false) elseif weapon == 25 then createExplosion ( x,y,z + 10,12,false,0.5,false) elseif weapon == 26 then createExplosion ( x,y,z + 10,12,false,0.7,false) elseif weapon == 27 then createExplosion ( x,y,z + 10,12,false,0.5,false) elseif weapon == 29 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 30 then createExplosion ( x,y,z+10,12,false,0.2,false) elseif weapon == 31 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 33 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 34 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 22 then createExplosion ( x,y,z + 10,12,false,0.1,false) elseif weapon == 28 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 32 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 38 then createExplosion ( x,y,z + 10,12,false,0.6,false) end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), shakeCamera ) function carcheck(player) if player == getLocalPlayer() then abortCarEnterCheck = setTimer ( checkCarTask, 100, 1 ) setElementCollisionsEnabled(Body, false) setElementAlpha(getLocalPlayer(), 255) end end addEventHandler ( "onClientVehicleStartEnter", getRootElement(), carcheck ) function checkCarTask() local stask = getPedSimplestTask(getLocalPlayer()) if (stask == "TASK_SIMPLE_CAR_GET_IN") or (stask == "TASK_SIMPLE_GO_TO_POINT") or (stask == "TASK_SIMPLE_CAR_OPEN_DOOR_FROM_OUTSIDE") or (stask == "TASK_SIMPLE_CAR_ALIGN") or (stask == "TASK_SIMPLE_CAR_CLOSE_DOOR_FROM_INSIDE") or (stask == "TASK_SIMPLE_CAR_SHUFFLE") or (stask == "TASK_SIMPLE_CAR_DRIVE") or (stask == "TASK_SIMPLE_ACHIEVE_HEADING") then abortCarEnterCheck = setTimer ( checkCarTask, 100, 1 ) elseif (isPedInVehicle(getLocalPlayer()) == false) then --enter vehicle was aborted setElementCollisionsEnabled(Body, true) setElementAlpha(getLocalPlayer(), 0) end end function carexit(player) if player == getLocalPlayer() then setElementCollisionsEnabled(Body, true) setElementAlpha(getLocalPlayer(), 0) end end addEventHandler ( "onClientVehicleExit", getRootElement(), carexit ) Mas no se ocmo hacerlo intente de una manera pero no sirviop alguna idea de como? Edited February 11, 2012 by Guest Link to comment
Castillo Posted February 11, 2012 Share Posted February 11, 2012 Si no me equivoco es el recurso "armas", verdad? si es asi, entonces que quieres que funcione con "/fps"? Link to comment
Soren Posted February 11, 2012 Author Share Posted February 11, 2012 Si no me equivoco es el recurso "armas", verdad? si es asi, entonces que quieres que funcione con "/fps"? Arreglado Link to comment
Recommended Posts