mcer Posted July 6, 2013 Posted July 6, 2013 function LowBloodAnim() local getplayer = getPlayerName(sourcePlayer) if getElementHealth ( sourcePlayer ) <= 20 then if not ( anim[1] == "crack" and anim[2] =="crckidle1" ) then setPedAnimation ( sourcePlayer, "crack", "crckidle1", -1, true, true, false ) end end end It's serverside.
Castillo Posted July 6, 2013 Posted July 6, 2013 And how do you execute that function? and where's sourcePlayer defined? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
MTA Team 0xCiBeR Posted July 6, 2013 MTA Team Posted July 6, 2013 (edited) He is asking, how does that function execute..? With command? event?..Etc.. EDIT: You must define sourcePlayer.. Example: function say (sourcePlayer) end addCommandHandler ( "hello", say ) Edited July 6, 2013 by Guest DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
mcer Posted July 6, 2013 Author Posted July 6, 2013 He is asking, how does that function execute..? With command? event?..Etc.. Command
MTA Team 0xCiBeR Posted July 6, 2013 MTA Team Posted July 6, 2013 function LowBloodAnim(sourcePlayer) local getplayer = getPlayerName(sourcePlayer) if getElementHealth ( sourcePlayer ) <= 20 then if not ( anim[1] == "crack" and anim[2] =="crckidle1" ) then setPedAnimation ( sourcePlayer, "crack", "crckidle1", -1, true, true, false ) end end end addCommandHandler ( "anim", LowBloodAnim ) DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
mcer Posted July 6, 2013 Author Posted July 6, 2013 Look (Clientside). addEventHandler('onClientResourceStart',resourceRoot, function () Shocking1() end ) function Shocking1() setTimer ( function ( ) local anim = {getPedAnimation( localPlayer )} if getElementHealth ( localPlayer ) <= 20 then if not ( anim[1] == "crack" and anim[2] =="crckidle1" ) then addEventHandler("onClientRender", getRootElement(), ShockWinGui) setPedAnimation ( localPlayer, "crack", "crckidle1", -1, true, true, false ) end else if ( anim[1] == "crack" and anim[2] == "crckidle1" ) then setPedAnimation( localPlayer, false) removeEventHandler("onClientRender", getRootElement(), ShockWinGui) end end end,500,0 ) end It set the anim only for the client... The other players can't see it.
MTA Team 0xCiBeR Posted July 6, 2013 MTA Team Posted July 6, 2013 Well whats the problem there? DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
mcer Posted July 6, 2013 Author Posted July 6, 2013 Well whats the problem there? I want it for serverside, But idk how.
MTA Team 0xCiBeR Posted July 6, 2013 MTA Team Posted July 6, 2013 addEventHandler('ResourceStart',resourceRoot, function () Shocking1() end ) function Shocking1() for i,v in ipairs(getElementsByType("player")) do setTimer ( function ( ) local anim = {getPedAnimation( v )} if getElementHealth ( v ) <= 20 then if not ( anim[1] == "crack" and anim[2] =="crckidle1" ) then setPedAnimation ( v, "crack", "crckidle1", -1, true, true, false ) end else if ( anim[1] == "crack" and anim[2] == "crckidle1" ) then setPedAnimation( v, false) end end end,500,0 ) end end It would be something like that,.Im from my cell, Maybe wrong somewhere,Try it..Anyway there are event handlers a bit strange there...Is it your script? DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
mcer Posted July 6, 2013 Author Posted July 6, 2013 addEventHandler('ResourceStart',resourceRoot, function () Shocking1() end ) function Shocking1() for i,v in ipairs(getElementsByType("player")) do setTimer ( function ( ) local anim = {getPedAnimation( v )} if getElementHealth ( v ) <= 20 then if not ( anim[1] == "crack" and anim[2] =="crckidle1" ) then setPedAnimation ( v, "crack", "crckidle1", -1, true, true, false ) end else if ( anim[1] == "crack" and anim[2] == "crckidle1" ) then setPedAnimation( v, false) end end end,500,0 ) end end It would be something like that,.Im from my cell, Maybe wrong somewhere,Try it..Anyway there are event handlers a bit strange there...Is it your script? Don't work and no errors in Debugscript.
MTA Team 0xCiBeR Posted July 6, 2013 MTA Team Posted July 6, 2013 Copy it again DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
mcer Posted July 6, 2013 Author Posted July 6, 2013 It's client side so you'll not see other players. I know, that's why I want to do this serverside.
MTA Team 0xCiBeR Posted July 6, 2013 MTA Team Posted July 6, 2013 It's client side so you'll not see other players. I made it server side-Did you switch the type in the meta? DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
mcer Posted July 6, 2013 Author Posted July 6, 2013 It's client side so you'll not see other players. I made it server side-Did you switch the type in the meta? Yes.
iMr.3a[Z]eF Posted July 6, 2013 Posted July 6, 2013 getPedAnimation this function is ClientSide only To Visit Us Press Here: mtasa://5.9.206.180:22002
iPrestege Posted July 6, 2013 Posted July 6, 2013 It's client side so you'll not see other players. I made it server side-Did you switch the type in the meta? You can't change it to server side read the code.
mcer Posted July 7, 2013 Author Posted July 7, 2013 Okay, The post is ended. I recreated this for serverside. Thanks everyone!.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now