Jump to content

TheBulletSponge

Members
  • Posts

    5
  • Joined

  • Last visited

TheBulletSponge's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Sweet.. Thanky you very much 50p. Going to try an animation next. Wish me luck lol EDIT :: OMG just looked at your signature what the hell connection have you got?
  2. You guys are AMAZING!!!! varez thank you very much! I had to add count = 0 to the top of the script but it works perfectly now. I am a very happy man :) EDIT :: sorry varez
  3. the getLocalPlayer I added as it didnt seem to work without. I just checked and the META file is setting it as client side script. Should I change it to server side script and then I dont need to use getLocalPlayer. I added it because no ped spawned and I didnt realize should be server side script. Remi-X : all I want to do is put a few Peds with different skins in a few places facing different directions to make a Screenshot with. The peds dont need to do anything but stand there. I need to be able to walk to a position and type command, Then a ped spawns with the skin I choose in the same place I am standing or very near and most important must be facing saming direction as my player when I type the command. I need to make some screenshots of A Family Photo, A Car Accident with police and ambulance crew attending , A Bank Robbery and A police Raid
  4. Thank you SolidSnake. I tried something similar myself but I get no errors with DEBUGSCRIPT 3 and I get no PED either. This is the FUNCTION? from the resource PEDS that I think makes the PED for me. addCommandHandler( "ped", function( plr, cmd, id ) if not id then return end local x, y, z = getElementPosition( plr ); local r = getElementPosition ( getElementRotation ( plr ) ); x = x + math.cos( math.rad( getPedRotation( plr ) ) ) * 2; y = y - math.sin( math.rad( getPedRotation( plr ) ) ) * 2; local ped = createPed( tonumber( id ), x, y, z, r ); if ped then if not playerPeds[ plr ] then playerPeds[ plr ] = { }; table.insert( playerPeds[ plr ], ped ); else table.insert( playerPeds[ plr ], ped ); end triggerClientEvent( plr, "pedCreated", plr, ped ); end end ) what I cant figure out is what this bit does. local x, y, z = getElementPosition( plr ); x = x + math.cos( math.rad( getPedRotation( plr ) ) ) * 2; y = y - math.sin( math.rad( getPedRotation( plr ) ) ) * 2; local ped = createPed( tonumber( id ), x, y, z ); But if I remove it the PEDS spawn underground. I thought this was the bit that sets the rotation but I guess I was wrong. I also found this but not sure if it is the problem _setPedRotation = setPedRotation function setPedRotation( ped, rot ) return _setPedRotation( ped, 360 - rot ); end EDIT ::: Gettin somewhere function makeAPed(thePlayer,command,skin) local x,y,z = getElementPosition ( getLocalPlayer ( thePlayer ) ) local x2,y2,z2 = getElementRotation ( getLocalPlayer ( thePlayer ) ) local myped = createPed(tostring(skin),x,y,z,x2,y2,z2) end addCommandHandler("createped",makeAPed) This creates a PED but I cant set skin and the rotation is always the same no matter which way player is facing when command is used
  5. Hi all and thanks for reading Hopefuly an easy question. I am trying to make some screenshots for a little project but I need a few peds stood around.I have tried adapting the community scripts but I am having no luck. All I want is to make a command that allows me to spawn a PED with the skin of my choice in the place where my player is currently standing and facing the same direction as the player. No need for it to move or anything just need it to stand there. Only important things are that it faces the same way as I am when I use the command and the ability to choose what skin it spawns with. EDIT: So far I can make the peds spawn with my choice of skin but they always face the same direction no matter what I do? the only real change I have made to the script is taking the follow player function out of MAKEPED.LUA from the PEDS resource ::: THIS BIT addEventHandler( "onClientRender", getRootElement(), function( ) if myPeds then for k, ped in pairs( myPeds ) do if ped then local x, y, z = getElementPosition( plr ); local px, py, pz = getElementPosition( ped ); local distance = getDistanceBetweenPoints3D( x, y, z, px, py, pz ) if distance < 3.5 then setPedControlState( ped, "aim_weapon", true ); setPedControlState( ped, "fire", false ); setPedControlState( ped, "fire", true ); setPedControlState( ped, "forwards", false ); if ( isPedDucked( plr ) ~= isPedDucked( ped ) ) then setPedControlState( ped, "crouch", isPedDucked( getLocalPlayer( ) )); --setPedControlState( myPed, "crouch", true ); return end else setPedControlState( ped, "forwards", true ); if distance < 6.0 then if isPedDucked( plr ) ~= isPedDucked( ped ) then setPedControlState( ped, "crouch", false ); setPedControlState( ped, "crouch", true ); setPedControlState( ped, "walk", false ); setPedControlState( ped, "sprint", false ); return else setPedControlState( ped, "walk", true ); setPedControlState( ped, "sprint", false ); end elseif distance < 10.0 then setPedControlState( ped, "walk", false ); setPedControlState( ped, "sprint", true ); else setPedControlState( ped, "walk", false ); setPedControlState( ped, "sprint", true ); end local X, Y = 0, 0; X = math.abs( x - px ); Y = math.abs( y - py ); faceMe = math.deg( math.atan2( Y , X ) ); --faceMe = ( 360 - math.deg ( math.atan2 ( ( px - x ), ( py - y ) ) ) ) % 360 if ( x >= px ) and ( y > py ) then -- north-east faceMe = 90 - faceMe elseif ( x <= px ) and ( y > py ) then -- north-west faceMe = 270 + faceMe elseif ( x >= px ) and ( y <= py ) then -- south-east faceMe = 90 + faceMe elseif ( x < px ) and ( y <= py ) then -- south-west faceMe = 270 - faceMe end --guiSetText( label, tostring( faceMe ) ); setPedRotation( ped, faceMe ); setPedLookAt( ped, x, y, z + .5 ); end end end end end ) Thank you for any replies. This is resource I have tried adapting https://community.multitheftauto.com/index.php?p=resources&s=details&id=285 and this https://community.multitheftauto.com/index.php?p=resources&s=details&id=234
×
×
  • Create New...