Mafia Scene - Mafia I & II Game Fan Site

Modders Corner => Mafia Editing => Mafia II mods => Topic started by: jaca37 on July 31, 2012, 06:51:51 PM

Title: Melee combat LUA
Post by: jaca37 on July 31, 2012, 06:51:51 PM
I'm using LUA commands to have melee weapons in game (freeride and story). I tried this, but it crashes almost always. What's wrong with my script?


 







Quoteif i==nil then i=0 end i=i+1

if i==5 then i=1 end




if i==1 then




game.game:GetActivePlayer():SetAnimStyle("melee","default")




game.game:GetActivePlayer():SetAnimStyle("common","default")




game.game:GetActivePlayer():ModelToHands(true,-1,1) end




if i==2 then




game.game:GetActivePlayer():SetAnimStyle("melee","PendrekStyle")




game.game:GetActivePlayer():SetAnimStyle("common","ManColdWeapon")




game.game:GetActivePlayer():ModelToHands(true,-1,28) end




if i=(//smile3.gif) then




game.game:GetActivePlayer():SetAnimStyle("melee","BatStyle")




game.game:GetActivePlayer():SetAnimStyle("common","ManColdWeapon")




game.game:GetActivePlayer():ModelToHands(true,-1,32) end




if i==4 then




game.game:GetActivePlayer():SetAnimStyle("melee","KnifeStyle")




game.game:GetActivePlayer():SetAnimStyle("common","ManColdWeapon")




game.game:GetActivePlayer():ModelToHands(true,-1,22) end



 


 


 




P.S. I know about melee weapons in Existenz34's freeride, but I use a different one.
Title: Melee combat LUA
Post by: zahar999 on August 01, 2012, 02:06:24 AM
jaca37


 




it different styles ("melee","...") and ("common","...")




and else in game should stand modified file "ingame"







Quoteif i==nil then i=0 end

DelayBuffer:Insert(function(l_1_0)i=i+1 if i==5 then i=1 end




if i==1 then game.game:GetActivePlayer():ModelToHands(true,1,1)




game.game:GetActivePlayer():SetAnimStyle("melee","default")end




if i==2 then game.game:GetActivePlayer():ModelToHands(true,1,28)




game.game:GetActivePlayer():SetAnimStyle("melee","PendrekStyle")end




if i=(//smile3.gif) then game.game:GetActivePlayer():ModelToHands(true,1,32)




game.game:GetActivePlayer():SetAnimStyle("melee","BatStyle")end




if i==4 then game.game:GetActivePlayer():ModelToHands(true,1,22)




game.game:GetActivePlayer():SetAnimStyle("melee","KnifeStyle")end




end,{l_1_0},100,1,false)


Title: Melee combat LUA
Post by: jaca37 on August 01, 2012, 07:36:38 AM
Thanks, I already modified ingame file to have more melee styles.