Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------- server side ----------
- 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",5}
- }
- 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 ")
- local set = setTimer(giveWeapon, 1000, 1, ped[6], tonumber(PedsPos[6][6]), tonumber(PedsPos[6][7]), true) -- not give weapon
- local set2 = setTimer(setPedAnimation, 1000, 1, ped[6], PedsPos[6][8],PedsPos[6][9] ) -- not setPedAnimation
- outputChatBox("Weapon and animation" )
- outputChatBox(":set2"..tostring(set2) )
- outputChatBox(":set"..tostring(set) )
- for i,v in pairs(getElementsByType ( "player" )) do
- triggerClientEvent(v,"streamEnablePeds",v,ped[i])
- end
- end
- setPedFrozen(ped[i], true )
- setElementData(ped[i],"ndmg",true)
- end
- end
- )
- addEventHandler("onPlayerJoin",root,
- function( )
- 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
- end
- )
- ------- client side ----------
- addEvent("streamEnablePeds",true)
- addEventHandler("streamEnablePeds",root,
- function( tPed )
- ped[i] = tPed
- setElementStreamable( ped[i], false )
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement