Jump to content

Melee weapons doesn't work


Ride1234

Recommended Posts

Hello, i have a problem with melee weapons.

When i'm in the interior (lobby in my script) they works fine, but when i'm on the my map (created using mta editor) melee weapons doesn't work (there is animation, but no damage). Other weapons such as pistols, machineguns, shotguns, flamethorews, etc works fine. There are no canceled events in my code.

Why its happens?

Here is my onPlayerSpawn code:

if(started == true) then
if(skin[source] == 0 and var3[player] == nil ) then
setElementPosition(source,x,y,z)
setElementModel(source,skin1)
else
setElementPosition(source,x,y,z)
setElementModel(source,skin2)
end	
if(var3[source] ~= nil) then -- pb var3
if(var3[source] == 1) then
setElementPosition(source,x,y,z)
setElementModel(source,model2)
setTimer(giveWeapon,1000,1,source,9,1,true)		 	
elseif(var3[source] == 2) then
setElementPosition(source,x,y,z)
setElementModel(source,model2)
setTimer(giveWeapon,1000,1,source,8,1,true)
elseif(var3[source] == 3) then
setElementPosition(source,x,y,z)
setElementModel(source,model2)
setTimer(giveWeapon,1000,1,source,36,50000,true)
end
triggerClientEvent(source,"dxSpawnText",getRootElement())
setElementData(source, "status", "In Game")
end	
setElementInterior(source,0)
else -- not started (lobby)
if(skin[source] == 0) then  
setElementPosition(source,x,y,z)
setElementModel(source,skin1)
else
setElementPosition(source,x,y,z)
setElementModel(source,skin2)
end	
setElementInterior(source,3)
setElementData(source, "status", "In Lobby")
end	
setPlayerNametagShowing(source, false)
setCameraTarget(source)
setPedFrozen(source,false)
toggleAllControls (source, true)

Link to comment
  • 2 weeks later...
  • 5 months later...
Hello, i have a problem with melee weapons.

When i'm in the interior (lobby in my script) they works fine, but when i'm on the my map (created using mta editor) melee weapons doesn't work (there is animation, but no damage). Other weapons such as pistols, machineguns, shotguns, flamethorews, etc works fine. There are no canceled events in my code.

Machineguns, shotguns, flamethorews are those belong to melee weapons?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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