News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: someone could add strafe in my code? thank you  (Read 3646 times)

0 Members and 1 Guest are viewing this topic.

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
someone could add strafe in my code? thank you
« on: February 26, 2015, 03:27:34 PM »
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

  l_0_0 = 60

MissionSetup = function()
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, l_1_0 +1, l_1_1 +1, l_1_2 +1)
  PedRecruitAlly(gplayer, Johnny)
  Hal = PedCreateXYZ(22, l_1_0 +2, l_1_1 +2, l_1_2 +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
  end

F_MissionSetup = function()

  LoadAnimationGroup("Authority")
  LoadAnimationGroup("Boxing")
  LoadAnimationGroup("B_Striker")
  LoadAnimationGroup("CV_Female")
  LoadAnimationGroup("CV_Male")
  LoadAnimationGroup("DO_Edgar")
  LoadAnimationGroup("DO_Grap")
  LoadAnimationGroup("DO_StrikeCombo")
  LoadAnimationGroup("DO_Striker")
  LoadAnimationGroup("F_Adult")
  LoadAnimationGroup("F_BULLY")
  LoadAnimationGroup("F_Crazy")
  LoadAnimationGroup("F_Douts")
  LoadAnimationGroup("F_Girls")
  LoadAnimationGroup("F_Greas")
  LoadAnimationGroup("F_Jocks")
  LoadAnimationGroup("F_Nerds")
  LoadAnimationGroup("F_OldPeds")
  LoadAnimationGroup("F_Pref")
  LoadAnimationGroup("F_Preps")
  LoadAnimationGroup("G_Grappler")
  LoadAnimationGroup("G_Johnny")
  LoadAnimationGroup("G_Striker")
  LoadAnimationGroup("Grap")
  LoadAnimationGroup("J_Damon")
  LoadAnimationGroup("J_Grappler")
  LoadAnimationGroup("J_Melee")
  LoadAnimationGroup("J_Ranged")
  LoadAnimationGroup("J_Striker")
  LoadAnimationGroup("LE_Orderly")
  LoadAnimationGroup("Nemesis")
  LoadAnimationGroup("N_Ranged")
  LoadAnimationGroup("N_Striker")
  LoadAnimationGroup("N_Striker_A")
  LoadAnimationGroup("N_Striker_B")
  LoadAnimationGroup("P_Grappler")
  LoadAnimationGroup("P_Striker")
  LoadAnimationGroup("PunchBag")
  LoadAnimationGroup("Qped")
  LoadAnimationGroup("Rat_Ped")
  LoadAnimationGroup("Russell")
  LoadAnimationGroup("Russell_Pbomb")
  LoadAnimationGroup("Straf_Dout")
  LoadAnimationGroup("Straf_Fat")
  LoadAnimationGroup("Straf_Female")
  LoadAnimationGroup("Straf_Male")
  LoadAnimationGroup("Straf_Nerd")
  LoadAnimationGroup("Straf_Prep")
  LoadAnimationGroup("Straf_Savage")
  LoadAnimationGroup("Straf_Wrest")
  LoadAnimationGroup("TE_Female")
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  LaunchScript("SObjTest.lua")

end

PlayerSwapModel("GR2nd_Peanut")

MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
  if IsButtonPressed(7,0) then
  ExecuteActionNode(gPlayer,"/Global/G_Johnny/Offense","Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(2,0) then
  PedSetActionTree(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "act/anim/G_Johnny.act")
  elseif IsButtonPressed(15,0) then
  PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(3,0) then
  PedSetActionNode(gPlayer, "/Global/G_Striker_A/Offense/GroundAttack/GroundPunch", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(0,0) then
  PedSetActionNode(gPlayer, "/Global/G_Striker_A/Offense/Medium", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(14,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks", "Act/Anim/G_Johnny.act")
  end
  UpdateTextQueue()
    Wait(0)
  end
end

Offline GreenOmnitrix

  • XFire: jedijosh920
  • Full Member
  • ***
  • Posts: 292
  • Gender: Male
  • 欺負改裝是真棒
    • View Profile
    • YouTube Channel
Re: someone could add strafe in my code? thank you
« Reply #1 on: February 26, 2015, 04:23:38 PM »
le sigh

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: someone could add strafe in my code? thank you
« Reply #3 on: February 26, 2015, 05:50:54 PM »
le sigh

No one is asking for your negativity. Move on if you're not interested in helping this person.

Offline Ky

  • Full Member
  • ***
  • Posts: 329
  • Gender: Male
  • <3
    • View Profile
Re: someone could add strafe in my code? thank you
« Reply #4 on: February 26, 2015, 06:19:00 PM »
le sigh

No one is asking for your negativity. Move on if you're not interested in helping this person.
Thank SWEGTA, I was impressed with what you said

Offline Goatth

  • Count Grishnackh
  • Jr. Member
  • **
  • Posts: 27
  • Gender: Male
    • View Profile
Re: someone could add strafe in my code? thank you
« Reply #5 on: February 26, 2015, 06:29:29 PM »
i can add me on skype: erison187

Offline GreenOmnitrix

  • XFire: jedijosh920
  • Full Member
  • ***
  • Posts: 292
  • Gender: Male
  • 欺負改裝是真棒
    • View Profile
    • YouTube Channel
Re: someone could add strafe in my code? thank you
« Reply #6 on: February 26, 2015, 07:12:09 PM »
le sigh

No one is asking for your negativity. Move on if you're not interested in helping this person.

K

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: someone could add strafe in my code? thank you
« Reply #7 on: February 26, 2015, 10:27:48 PM »
and people wonder why new members leave so fast when they get treated like this...

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: someone could add strafe in my code? thank you
« Reply #8 on: February 26, 2015, 11:25:58 PM »
and people wonder why new members leave so fast when they get treated like this...
^

deadpoolXYZ

  • Guest
Re: someone could add strafe in my code? thank you
« Reply #9 on: February 27, 2015, 07:49:21 PM »
Thanks to daboss who originally made public this code (afaik).

Code: [Select]

function IsMoving()
  local s = 0.08 -- sensitivity
  return GetStickValue(16,c) > s or GetStickValue(16,c) < -s or GetStickValue(17,c) > s or GetStickValue(17,c) < -s
end

F_StartMission = function()
style = ""

while Alive do
if style ~= "Player" and style ~= "player" then
      if IsButtonPressed(10,0) and IsMoving() and not isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
PedSetActionNode(gPlayer,"/Global/FIGHTINGSTYLE/Default_KEY/ExecuteNodes/LocomotionOverride/Combat/CombatBasic","act/anim/FIGHTINGSTYLE.act")
isStrafing = true
  elseif IsButtonPressed(10,0) and not IsMoving() and isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
PedSetActionTree(gPlayer, "/Global/FIGHTINGSTYLE", "act/anim/FIGHTINGSTYLE.act")
isStrafing = false
  elseif (not IsButtonPressed(10,0) or not IsMoving()) and isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
PedSetActionTree(gPlayer, "/Global/FIGHTINGSTYLE", "act/anim/FIGHTINGSTYLE.act")
    isStrafing = false
  elseif isStrafing then
    local x,y,z = PedGetPosXYZ(PedGetTargetPed())
    PedFaceXYZ(gPlayer,x,y,z)
  end
end

wait(0)

end
end
« Last Edit: February 27, 2015, 07:55:41 PM by The Dream Is Dead »

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: someone could add strafe in my code? thank you
« Reply #10 on: February 28, 2015, 01:43:19 PM »