Home / Forums / Modders Corner / Mafia Editing / Mafia Mod Request / Multiple models under one script.

Multiple models under one script.

Home / Forums / Modders Corner / Mafia Editing / Mafia Mod Request / Multiple models under one script.

4 replies
13 years, 8 months ago
#6895

Could anybody write a script for me, in which I could switch through multiple models using just one key?

I’m using this cript for single model:

 

DelayBuffer:Insert(function(l_1_0)CommandBuffer:Insert(l_6_0,{function(l_1_0)game.game:ChangePlayerModel(“cpoli3”)end})end,{l_1_0},100,1,false)

 

I’d be very grateful smile.png” data-emoticon=”” srcset=”/wp-content/uploads/invision_emoticons/smile@2x.png 2x” width=”20″ height=”20″>

13 years, 8 months ago
#12527

Hi, it is this.

You can change the player model anytime, anywhere.

100% working.

 

 

 

ply=game.game:GetActivePlayer()

if i==nil then i=0 end i=i+1 if i==13+1 then i=1 end

DelayBuffer:Insert(function(l_1_0)if i==1 then game.game:ChangePlayerModel(“vitarmy”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==2 then game.game:ChangePlayerModel(“vitksl2”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i=smile3.gif then game.game:ChangePlayerModel(“vitnah_t”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==4 then game.game:ChangePlayerModel(“vitoveral”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==5 then game.game:ChangePlayerModel(“vitspo”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==6 then game.game:ChangePlayerModel(“vittel”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==7 then game.game:ChangePlayerModel(“vitukl”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==8 then game.game:ChangePlayerModel(“vitvez”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==9 then game.game:ChangePlayerModel(“vitvop”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==10 then game.game:ChangePlayerModel(“vitvov”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==11 then game.game:ChangePlayerModel(“vitvov2i”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==12 then game.game:ChangePlayerModel(“vitvov3”)end end,{l_1_0},250,1,false)

 

13 years, 8 months ago
#12530

jaca37

DelayBuffer:Insert & CommandBuffer:Insert for one commande is not necessary.

 

in FR Script for change player model this is sufficient.

game.game:ChangePlayerModel(“Name_model”)

 

But the game crashes when using injector with direct control of this type.

that’s why we use a delay.

DelayBuffer:Insert(function(l_1_0) xxxxx
end,{l_1_0},250
,1
,false)

xxxxx
= your command

250
= delay (millisecond) before activation of the command

1
= number of times to repeat the fonction

 

Test to understand the function “DelayBuffer”:

DelayBuffer:Insert(function(l_1_0)game.game:SaveGame(1) end,{l_1_0},10000
,10
,false)

a backup is performed every 10
second (10000 milli) for10
times. 

So in the end, we have.

DelayBuffer:Insert(function(l_1_0)game.game:ChangePlayerModel(“Name_model”)end,{l_1_0},250,1,false)

 

and for “x” choices.

if i==nil then i=0 end i=i+1 if i==x+1
then i=1 end

DelayBuffer:Insert(function(l_1_0)if i==1 then game.game:ChangePlayerModel(“Name_model”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i==2 then game.game:ChangePlayerModel(“Name_model”)end end,{l_1_0},250,1,false)

DelayBuffer:Insert(function(l_1_0)if i=smile3.gif …….

don’t write x+1
but if you have 5 model, write 6.

13 years, 8 months ago
#12533

Thank you eXistenZ34.

You are more experienced than me.

I’m just learning.

13 years, 8 months ago
#12534

Thank both of you guys. Especially Existenz for this small tutorial <img decoding=” data-emoticon=”” srcset=”/wp-content/uploads/invision_emoticons/wink@2x.png 2x” width=”20″ height=”20″>

  • You must be logged in to reply to this topic.