Jump to content

Lanzagranadas


RekZ

Recommended Posts

Posted

el titulo lo dice todo existe algun scrip con el que teniendo equipada la M4 y por ejemplo pulsando la "N" lanzara una granada

lo e visto en algunos server pero claro tengo este scrip pero no consigo hacer ke dispare por lo menos

  
function onClientPlayerWeaponFireFunc(weapon,ammo,ammoInClip,hitX,hitY,hitZ,hitElement) 
    if weapon == 31 then  
        if not createProjectile(getLocalPlayer(),16,getElementPosition(getLocalPlayer()),200) then  
           
        end 
    end 
end 
  
addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc) 

Admin and Owner of the Pro Chile Community :3

Posted
function onClientPlayerWeaponFireFunc(weapon,ammo,ammoInClip,hitX,hitY,hitZ,hitElement) 
    if (weapon == 31) then 
        local x, y, z = getElementPosition(localPlayer) 
        createProjectile(localPlayer,16,x,y,z,200) 
    end 
end 
addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

No se, ami me funciona perfecto.

Estas seguro que lo pusiste como client-side en el meta.xml?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Aca funciona perfecto, estas usando el M4, verdad?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

si claro asta ay llego la M4 y luego disparo y ay keda

Edit: nose porque pero aora funciona le quite al meta lo de autor,descripcion.... y ba perfectamente aunque me queda la duda supongo que seria de el meta.xml

Gracias por tu ayuda

Admin and Owner of the Pro Chile Community :3

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...