Jump to content

[Help]Ped animation problem


OutPut

Recommended Posts

Codes overlap

action.lua

peds = {
  {28,29,30},
}

pedAnim = {
  {"crc","crack","crckidle2"},
}

function pedArmy()
  for _,v in ipairs(peds) do
    local rot,x,y,z = unpack(v);
  	createPed(rot, -1302, 2508, 87)
	createPed(rot, -1305, 2515, 87)
	createPed(rot, -1307, 2528, 87)
	createPed(rot, -1320, 2512, 92)
	createPed(rot, -1311, 2522, 89)
  end
end
addCommandHandler("spawnpeds",pedArmy)

function doAnim(source,cmd,anim)
  if (anim) then
  	  for _,v in ipairs(pedAnim) do
      	local animName,animBlock,actualAnimName = unpack(v);
      	if (tostring(anim) == animName) then
            for _,p in ipairs(getElementsByType("ped")) do
        		  setPedAnimation(p,animBlock,actualAnimName)
          	end
        end
      end
  end
end
addCommandHandler("action",doAnim)

action2.lua

peds = {
  {0},
}

pedAnim = {
  {"crc1","crack","crckidle1"},
}

function pedArmy()
  for _,v in ipairs(peds) do
    local rot,x,y,z = unpack(v);
  	createPed(rot, -1311, 2508, 87)
	createPed(rot, -1294, 2514, 87)
	createPed(rot, -1310, 2516, 87)
	createPed(rot, -1299, 2522, 87)
	createPed(rot, -1286, 2505, 87)
  end
end
addCommandHandler("spawnpeds1",pedArmy)

function doAnim(source,cmd,anim)
  if (anim) then
  	  for _,v in ipairs(pedAnim) do
      	local animName,animBlock,actualAnimName = unpack(v);
      	if (tostring(anim) == animName) then
            for _,p in ipairs(getElementsByType("ped")) do
        		  setPedAnimation(p,animBlock,actualAnimName)
          	end
        end
      end
  end
end
addCommandHandler("action1",doAnim)

And finally I can not give any other skin to all help pls. bad english

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...