Kenix Posted May 10, 2011 Share Posted May 10, 2011 Another problem with the tables this time harder. do not want giveWeapon and setPedAnimation. there are no errors in any "chatBox" debug works please tell me how to fix this problem PedsPos = { {120,2779.4453125,-2407.8173828125,13.635701179504,180.54383850098}, {135,2762.865234375,-2535.6484375,13.637379646301,127.07803344727}, {78,2762.845703125,-2537.8515625,13.636841773987,35.659423828125}, {79,2761.3046875,-2537.7509765625,13.634307861328,323.5166015625}, {200,2757.439453125,-2535.2880859375,13.637376785278,262.62942504883}, {118,2788.2470703125,-2507.21484375,13.640826225281,179.83520507813,30,300,"ped","IDLE_chat"} } addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function( ) for i,w in ipairs( PedsPos ) do outputChatBox(""..i ) ped[i] = createPed(w[1],w[2],w[3],w[4]) -- so it's good setPedRotation(ped[i],w[5]) -- good if ( i == 6 ) then outputChatBox( " It's the 6th ped ") giveWeapon(ped[6],tonumber(PedsPos[i][6]),tonumber(PedsPos[i][7]), true) -- not give weapon setPedAnimation( ped[6], PedsPos[6][8],PedsPos[6][9] ) -- not setPedAnimation outputChatBox("Weapon and animation" ) end setPedFrozen(ped[i], true ) setElementData(ped[i],"ndmg",true) end end ) Link to comment
Castillo Posted May 10, 2011 Share Posted May 10, 2011 PedsPos = { {120,2779.4453125,-2407.8173828125,13.635701179504,180.54383850098}, {135,2762.865234375,-2535.6484375,13.637379646301,127.07803344727}, {78,2762.845703125,-2537.8515625,13.636841773987,35.659423828125}, {79,2761.3046875,-2537.7509765625,13.634307861328,323.5166015625}, {200,2757.439453125,-2535.2880859375,13.637376785278,262.62942504883}, {118,2788.2470703125,-2507.21484375,13.640826225281,179.83520507813,30,300,"ped","IDLE_chat"} } addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function( ) ped = {} for i,w in ipairs( PedsPos ) do outputChatBox(""..i ) ped[i] = createPed(w[1],w[2],w[3],w[4]) -- so it's good setPedRotation(ped[i],w[5]) -- good if ( i == 6 ) then outputChatBox( " It's the 6th ped ") setTimer(giveWeapon, 1000, 1, ped[6], tonumber(PedsPos[6][6]), tonumber(PedsPos[6][7]), true) -- not give weapon setTimer(setPedAnimation, 1000, 1, ped[6], PedsPos[6][8],PedsPos[6][9] ) -- not setPedAnimation outputChatBox("Weapon and animation" ) end setPedFrozen(ped[i], true ) setElementData(ped[i],"ndmg",true) end end ) Link to comment
Kenix Posted May 11, 2011 Author Share Posted May 11, 2011 PedsPos = { {120,2779.4453125,-2407.8173828125,13.635701179504,180.54383850098}, {135,2762.865234375,-2535.6484375,13.637379646301,127.07803344727}, {78,2762.845703125,-2537.8515625,13.636841773987,35.659423828125}, {79,2761.3046875,-2537.7509765625,13.634307861328,323.5166015625}, {200,2757.439453125,-2535.2880859375,13.637376785278,262.62942504883}, {118,2788.2470703125,-2507.21484375,13.640826225281,179.83520507813,30,300,"ped","IDLE_chat"} } addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function( ) ped = {} for i,w in ipairs( PedsPos ) do outputChatBox(""..i ) ped[i] = createPed(w[1],w[2],w[3],w[4]) -- so it's good setPedRotation(ped[i],w[5]) -- good if ( i == 6 ) then outputChatBox( " It's the 6th ped ") setTimer(giveWeapon, 1000, 1, ped[6], tonumber(PedsPos[6][6]), tonumber(PedsPos[6][7]), true) -- not give weapon setTimer(setPedAnimation, 1000, 1, ped[6], PedsPos[6][8],PedsPos[6][9] ) -- not setPedAnimation outputChatBox("Weapon and animation" ) end setPedFrozen(ped[i], true ) setElementData(ped[i],"ndmg",true) end end ) works only after restarting the resource. Link to comment
Castillo Posted May 11, 2011 Share Posted May 11, 2011 What do you mean? i added a timer as you can see, also the missing ped table, wait 1 second after restarting the resource, then it will start playing the animation and give him an Ak-47. Link to comment
Kenix Posted May 11, 2011 Author Share Posted May 11, 2011 What do you mean? i added a timer as you can see, also the missing ped table, wait 1 second after restarting the resource, then it will start playing the animation and give him an Ak-47. know it but it works only after restarting the resource. Link to comment
karlis Posted May 11, 2011 Share Posted May 11, 2011 know it but it works only after restarting the resource. it is the way it supposed to work script [re]loads on [re]starting resource Link to comment
Kenix Posted May 12, 2011 Author Share Posted May 12, 2011 this is bug look: weapon http://bugs.mtasa.com/view.php?id=5108 animation http://bugs.mtasa.com/view.php?id=4596 Link to comment
Moderators Citizen Posted May 12, 2011 Moderators Share Posted May 12, 2011 So try to use this function setElementStreamable and turn it to false And when a player join, then apply the animation to this ped Link to comment
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