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)