Darky Posted January 11, 2012 Share Posted January 11, 2012 como hago para vincular este scrip con una tecla ose al apretar una tecla lanze na granada porque de la forma que esta puesto es un poco dificil no dispararlas y tendria ke desactivar y activar el scrip. e probado a vincularlo con un comando pero no e podido lo saque de este post: viewtopic.php?f=145&t=38731 local screenWidth, screenHeight = guiGetScreenSize() function onClientPlayerWeaponFireFunc(weapon,ammo,ammoInClip,hitX,hitY,hitZ,hitElement) if (weapon == 31) then local x2, y2, z2 = getWorldFromScreenPosition(screenWidth/2, screenHeight/2, 100) local x, y, z = getElementPosition(localPlayer) local force = getDistanceBetweenPoints2D(x, y, x2, y2) createProjectile(localPlayer,16,x,y,z,force/100) end end addEventHandler("onClientPlayerWeaponFire", root, onClientPlayerWeaponFireFunc) Link to comment
RekZ Posted January 11, 2012 Share Posted January 11, 2012 pos mira no seria mala idea pero no creo que se pueda Link to comment
Castillo Posted January 11, 2012 Share Posted January 11, 2012 local screenWidth, screenHeight = guiGetScreenSize() function throwGrenade() local x2, y2, z2 = getWorldFromScreenPosition(screenWidth/2, screenHeight/2, 100) local x, y, z = getElementPosition(localPlayer) local force = getDistanceBetweenPoints2D(x, y, x2, y2) createProjectile(localPlayer,16,x,y,z,force/100) end bindKey("G","down",throwGrenade) Link to comment
Recommended Posts