Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.00 KB | None | 0 0
  1. ------- server side ----------
  2.  
  3. PedsPos = {
  4. {120,2779.4453125,-2407.8173828125,13.635701179504,180.54383850098},
  5. {135,2762.865234375,-2535.6484375,13.637379646301,127.07803344727},
  6. {78,2762.845703125,-2537.8515625,13.636841773987,35.659423828125},
  7. {79,2761.3046875,-2537.7509765625,13.634307861328,323.5166015625},
  8. {200,2757.439453125,-2535.2880859375,13.637376785278,262.62942504883},
  9. {118,2788.2470703125,-2507.21484375,13.640826225281,179.83520507813,30,300,"ped","IDLE_chat",5}  
  10. }
  11.  
  12. addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),
  13.     function( )
  14.     ped = {}
  15.         for i,w in ipairs( PedsPos ) do
  16.             outputChatBox(""..i )
  17.             ped[i] = createPed(w[1],w[2],w[3],w[4]) -- so it's good
  18.             setPedRotation(ped[i],w[5]) -- good
  19.             if ( i == 6 ) then
  20.                 outputChatBox( " It's the 6th ped ")
  21.                 local set = setTimer(giveWeapon, 1000, 1, ped[6], tonumber(PedsPos[6][6]), tonumber(PedsPos[6][7]), true) -- not give weapon
  22.                 local set2 = setTimer(setPedAnimation, 1000, 1, ped[6], PedsPos[6][8],PedsPos[6][9] )  -- not setPedAnimation
  23.                 outputChatBox("Weapon and animation" )
  24.                 outputChatBox(":set2"..tostring(set2) )
  25.                 outputChatBox(":set"..tostring(set) )
  26.                 for i,v in pairs(getElementsByType ( "player" )) do
  27.                     triggerClientEvent(v,"streamEnablePeds",v,ped[i])
  28.                 end
  29.             end
  30.             setPedFrozen(ped[i], true )
  31.             setElementData(ped[i],"ndmg",true)
  32.         end
  33.     end
  34. )
  35.  
  36.  
  37. addEventHandler("onPlayerJoin",root,
  38.     function( )
  39.         setTimer(giveWeapon, 1000, 1, ped[6], tonumber(PedsPos[6][6]), tonumber(PedsPos[6][7]), true) -- not give weapon
  40.         setTimer(setPedAnimation, 1000, 1, ped[6], PedsPos[6][8],PedsPos[6][9] )  -- not setPedAnimation
  41.     end
  42. )  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. ------- client side ----------
  52. addEvent("streamEnablePeds",true)
  53. addEventHandler("streamEnablePeds",root,
  54.     function( tPed )
  55.         ped[i] = tPed
  56.         setElementStreamable( ped[i], false )
  57.     end
  58. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement