Jump to content

مساعدة في صنع Ped


MrCor

Recommended Posts

  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

  
thePed1 = createPed ( ID, x, y, z ) 
thePed2 = createPed ( ID, x, y, z ) 
thePed3 = createPed ( ID, x, y, z ) 
  

Or

  
thePositions = { 
    { x, y, z }, 
    { x, y, z }, 
    { x, y, z }, 
} 
  
for _, AllPositions in ipairs ( thePositions ) do 
    createPed ( ID, AllPositions [1], AllPositions [2], AllPositions [3] ) 
end 
  

Link to comment
-- Server Side 
thePed = createPed ( 124, 1513.3770751953, -1677.8481445313, 14.046875 ) 
thePed1 = createPed ( 124, 1514.3770751953, -1677.8481445313, 14.046875 ) 
thePed2 = createPed ( 124, 1515.3770751953, -1677.8481445313, 14.046875 ) 
thePed3 = createPed ( 124, 1516.3770751953, -1677.8481445313, 14.046875 ) 
  
theMarker = createMarker ( 1516.3770751953, -1677.8481445313, 14.046875, "cylinder", 15, 0, 0, 0, 0 ) 
  
setPedStat ( thePed, 77, 999 ) 
setPedStat ( thePed1, 77, 999 ) 
setPedStat ( thePed2, 77, 999 ) 
setPedStat ( thePed3, 77, 999 ) 
setPedWeaponSlot ( thePed, 3 ) 
setPedWeaponSlot ( thePed1, 3 ) 
setPedWeaponSlot ( thePed2, 3 ) 
setPedWeaponSlot ( thePed3, 3 ) 
attachElements ( theMarker, thePed, 0, 0, -1 ) 
attachElements ( theMarker, thePed1, 0, 0, -1 ) 
attachElements ( theMarker, thePed2, 0, 0, -1 ) 
attachElements ( theMarker, thePed3, 0, 0, -1 ) 
setTimer ( giveWeapon, 500, 0, thePed, 25, 99999, true ) 
setTimer ( giveWeapon, 500, 0, thePed1, 25, 99999, true ) 
setTimer ( giveWeapon, 500, 0, thePed2, 25, 99999, true ) 
setTimer ( giveWeapon, 500, 0, thePed3, 25, 99999, true ) 
addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            if getPlayerTeam ( thePlayer ) == getTeamFromName ( "eetlaf" ) then         
                triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePed ) 
                if isPedInVehicle ( thePlayer ) then 
                    destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) 
                end 
            end 
        end 
    end 
) 
      
addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed ) 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed1 ) 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed2 ) 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed3 ) 
            setTimer ( giveWeapon, 500, 1, thePed, 25, 99999, true ) 
            setTimer ( giveWeapon, 500, 1, thePed1, 25, 99999, true ) 
            setTimer ( giveWeapon, 500, 1, thePed2, 25, 99999, true ) 
            setTimer ( giveWeapon, 500, 1, thePed3, 25, 99999, true ) 
  
        end 
    end 
) 
  

-- Client Side 
addEvent ( "setPedAttacking", true ) 
addEventHandler ( "setPedAttacking", root, 
    function ( thePed )( thePed1 )( thePed2 )( thePed3 ) 
        setTimer ( 
            function ( ) 
                x, y, z = getElementPosition ( localPlayer ) 
                setPedAimTarget ( thePed, x, y, z ) 
                setPedAimTarget ( thePed1, x, y, z ) 
                setPedAimTarget ( thePed2, x, y, z ) 
                setPedAimTarget ( thePed3, x, y, z ) 
  
            end 
        , 100, 0 ) 
        setPedControlState ( thePed, "fire", true ) 
        setPedControlState ( thePed1, "fire", true ) 
        setPedControlState ( thePed2, "fire", true ) 
        setPedControlState ( thePed3, "fire", true ) 
  
        outputChatBox ( "* Start Shooting !!!", 255, 255, 0, true )     
    end 
) 
          
addEvent ( "setPedStanding", true ) 
addEventHandler ( "setPedStanding", root, 
    function ( thePed )( thePed1 )( thePed2 )( thePed3 ) 
        setPedControlState ( thePed, "fire", false ) 
        setPedControlState ( thePed1, "fire", false ) 
        setPedControlState ( thePed2, "fire", false ) 
        setPedControlState ( thePed3, "fire", false ) 
  
        outputChatBox ( "* Stop Shooting !!!", 255, 255, 0, true )      
        for _, x3NAD in ipairs ( getTimers ( 100 ) ) do 
            killTimer ( x3NAD ) 
        end     
    end 
) 
  

Link to comment
-- Server Side 
thePed = createPed ( 124, 1513.3770751953, -1677.8481445313, 14.046875 ) 
thePed1 = createPed ( 124, 1514.3770751953, -1677.8481445313, 14.046875 ) 
thePed2 = createPed ( 124, 1515.3770751953, -1677.8481445313, 14.046875 ) 
thePed3 = createPed ( 124, 1516.3770751953, -1677.8481445313, 14.046875 ) 
  
theMarker = createMarker ( 1516.3770751953, -1677.8481445313, 14.046875, "cylinder", 15, 0, 0, 0, 0 ) 
  
setPedStat ( thePed, 77, 999 ) 
setPedStat ( thePed1, 77, 999 ) 
setPedStat ( thePed2, 77, 999 ) 
setPedStat ( thePed3, 77, 999 ) 
setPedWeaponSlot ( thePed, 3 ) 
setPedWeaponSlot ( thePed1, 3 ) 
setPedWeaponSlot ( thePed2, 3 ) 
setPedWeaponSlot ( thePed3, 3 ) 
attachElements ( theMarker, thePed, 0, 0, -1 ) 
attachElements ( theMarker, thePed1, 0, 0, -1 ) 
attachElements ( theMarker, thePed2, 0, 0, -1 ) 
attachElements ( theMarker, thePed3, 0, 0, -1 ) 
setTimer ( giveWeapon, 500, 0, thePed, 25, 99999, true ) 
setTimer ( giveWeapon, 500, 0, thePed1, 25, 99999, true ) 
setTimer ( giveWeapon, 500, 0, thePed2, 25, 99999, true ) 
setTimer ( giveWeapon, 500, 0, thePed3, 25, 99999, true ) 
addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            if getPlayerTeam ( thePlayer ) == getTeamFromName ( "eetlaf" ) then         
                triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePed ) 
                if isPedInVehicle ( thePlayer ) then 
                    destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) 
                end 
            end 
        end 
    end 
) 
      
addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed ) 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed1 ) 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed2 ) 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed3 ) 
            setTimer ( giveWeapon, 500, 1, thePed, 25, 99999, true ) 
            setTimer ( giveWeapon, 500, 1, thePed1, 25, 99999, true ) 
            setTimer ( giveWeapon, 500, 1, thePed2, 25, 99999, true ) 
            setTimer ( giveWeapon, 500, 1, thePed3, 25, 99999, true ) 
  
        end 
    end 
) 
  

-- Client Side 
addEvent ( "setPedAttacking", true ) 
addEventHandler ( "setPedAttacking", root, 
    function ( thePed )( thePed1 )( thePed2 )( thePed3 ) 
        setTimer ( 
            function ( ) 
                x, y, z = getElementPosition ( localPlayer ) 
                setPedAimTarget ( thePed, x, y, z ) 
                setPedAimTarget ( thePed1, x, y, z ) 
                setPedAimTarget ( thePed2, x, y, z ) 
                setPedAimTarget ( thePed3, x, y, z ) 
  
            end 
        , 100, 0 ) 
        setPedControlState ( thePed, "fire", true ) 
        setPedControlState ( thePed1, "fire", true ) 
        setPedControlState ( thePed2, "fire", true ) 
        setPedControlState ( thePed3, "fire", true ) 
  
        outputChatBox ( "* Start Shooting !!!", 255, 255, 0, true )     
    end 
) 
          
addEvent ( "setPedStanding", true ) 
addEventHandler ( "setPedStanding", root, 
    function ( thePed )( thePed1 )( thePed2 )( thePed3 ) 
        setPedControlState ( thePed, "fire", false ) 
        setPedControlState ( thePed1, "fire", false ) 
        setPedControlState ( thePed2, "fire", false ) 
        setPedControlState ( thePed3, "fire", false ) 
  
        outputChatBox ( "* Stop Shooting !!!", 255, 255, 0, true )      
        for _, x3NAD in ipairs ( getTimers ( 100 ) ) do 
            killTimer ( x3NAD ) 
        end     
    end 
) 
  

في طريقة أسهل اذا ما تعرف حق هذي الطريقة

سو مود ثاني

Link to comment

[2012-11-23 22:15:01] restart: Requested by Console 
[2012-11-23 22:15:01] restart: Resource restarting... 
[2012-11-23 22:15:01] Stopping 43 
[2012-11-23 22:15:01] Resource '43' changed, reloading and starting 
[2012-11-23 22:15:01] Starting 43 
[2012-11-23 22:15:01] WARNING: 43\server.lua:21: Bad argument @ 'setPedStat' 
[2012-11-23 22:15:01] WARNING: 43\server.lua:22: Bad argument @ 'setPedWeaponSlot' 
[2012-11-23 22:15:01] WARNING: 43\server.lua:23: Bad argument @ 'attachElements' 
[2012-11-23 22:15:01] 43 restarted successfully 
[2012-11-23 22:15:06] WARNING: Bad argument @ 'giveWeapon' 
[2012-11-23 22:15:11] WARNING: Bad argument @ 'giveWeapon' 
[2012-11-23 22:15:16] WARNING: Bad argument @ 'giveWeapon' 
[2012-11-23 22:15:21] WARNING: Bad argument @ 'giveWeapon' 
[2012-11-23 22:15:26] WARNING: Bad argument @ 'giveWeapon' 
  

-- Server Side 
  
thePositions = { 
    { 1514.3770751953, -1677.8481445313, 14.046875 }, 
    { 1515.3770751953, -1677.8481445313, 14.046875 }, 
    { 1516.3770751953, -1677.8481445313, 14.046875 }, 
    { 1517.3770751953, -1677.8481445313, 14.046875 }, 
    { 1518.3770751953, -1677.8481445313, 14.046875 }, 
    { 1513.3770751953, -1678.8481445313, 14.046875 }, 
    { 1513.3770751953, -1679.8481445313, 14.046875 }, 
    { 1513.3770751953, -1680.8481445313, 14.046875 }, 
    { 1513.3770751953, -1681.8481445313, 14.046875 }, 
    { 1513.3770751953, -1682.8481445313, 14.046875 },    
} 
  
for _, AllPositions in ipairs ( thePositions ) do 
    createPed ( 124, AllPositions [1], AllPositions [2], AllPositions [3], AllPositions [4], AllPositions [5], AllPositions [6], AllPositions [7], AllPositions [8],AllPositions [9],AllPositions [10] ) 
end 
 theMarker = createMarker ( 0, 0, 0, "cylinder", 15, 0, 0, 0, 0 ) 
  
setPedStat ( Ped, 77, 999 ) 
setPedWeaponSlot ( Ped, 3 ) 
attachElements ( theMarker, Ped, 0, 0, -1 ) 
setTimer ( giveWeapon, 5000, 0, Ped, 25, 99999, true ) 
      
addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            if getPlayerTeam ( thePlayer ) == getTeamFromName ( "Skulls" ) then         
                triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePed ) 
                if isPedInVehicle ( thePlayer ) then 
                    destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) 
                end 
            end 
        end 
    end 
) 
      
addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed ) 
            setTimer ( giveWeapon, 500, 1, thePed, 25, 99999, true ) 
        end 
    end 
) 
  
  

Link to comment
-- Server Side 
thePositions = { 
    { 1514.3770751953, -1677.8481445313, 14.046875 }, 
    { 1515.3770751953, -1677.8481445313, 14.046875 }, 
    { 1516.3770751953, -1677.8481445313, 14.046875 }, 
    { 1517.3770751953, -1677.8481445313, 14.046875 }, 
    { 1518.3770751953, -1677.8481445313, 14.046875 }, 
    { 1513.3770751953, -1678.8481445313, 14.046875 }, 
    { 1513.3770751953, -1679.8481445313, 14.046875 }, 
    { 1513.3770751953, -1680.8481445313, 14.046875 }, 
    { 1513.3770751953, -1681.8481445313, 14.046875 }, 
    { 1513.3770751953, -1682.8481445313, 14.046875 },    
} 
  
for _, AllPositions in ipairs ( thePositions ) do 
    thePed = createPed ( 124, AllPositions [1], AllPositions [2], AllPositions [3] ) 
    theMarker = createMarker ( 0, 0, 0, "cylinder", 50, 0, 0, 0, 0 ) 
    setPedStat ( thePed, 77, 999 ) 
    setPedWeaponSlot ( thePed, 3 ) 
    attachElements ( theMarker, thePed, 0, 0, -1 ) 
    setTimer ( giveWeapon, 5000, 0, thePed, 25, 99999, true )    
end 
      
addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            if getPlayerTeam ( thePlayer ) == getTeamFromName ( "Skulls" ) then         
                triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePed ) 
                if isPedInVehicle ( thePlayer ) then 
                    destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) 
                end 
            end 
        end 
    end 
) 
      
addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed ) 
            setTimer ( giveWeapon, 500, 1, thePed, 25, 99999, true ) 
        end 
    end 
) 
  

Link to comment

هي شغلة بسيطة والمفروض تعتمد على نفسك :/

  
-- Server Side 
thePositions = { 
    { 1514.3770751953, -1677.8481445313, 14.046875 }, 
    { 1515.3770751953, -1677.8481445313, 14.046875 }, 
    { 1516.3770751953, -1677.8481445313, 14.046875 }, 
    { 1517.3770751953, -1677.8481445313, 14.046875 }, 
    { 1518.3770751953, -1677.8481445313, 14.046875 }, 
    { 1513.3770751953, -1678.8481445313, 14.046875 }, 
    { 1513.3770751953, -1679.8481445313, 14.046875 }, 
    { 1513.3770751953, -1680.8481445313, 14.046875 }, 
    { 1513.3770751953, -1681.8481445313, 14.046875 }, 
    { 1513.3770751953, -1682.8481445313, 14.046875 },   
} 
  
for _, AllPositions in ipairs ( thePositions ) do 
    createPed ( 124, AllPositions [1], AllPositions [2], AllPositions [3] ) 
    createMarker ( AllPositions [1], AllPositions [2], AllPositions [3] - 1, "cylinder", 5, 0, 0, 0, 0 ) 
    for _, thePeds in ipairs ( getElementsByType ( "ped", getResourceRootElement ( getThisResource() ) ) ) do 
        setPedStat ( thePeds, 77, 999 ) 
        setPedWeaponSlot ( thePeds, 3 ) 
        setTimer ( giveWeapon, 5000, 0, thePeds, 25, 99999, true )    
    end 
end 
      
addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            if getPlayerTeam ( thePlayer ) == getTeamFromName ( "Skulls" ) then    
                for _, thePeds in ipairs ( getElementsByType ( "ped", getResourceRootElement ( getThisResource() ) ) ) do            
                    triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePeds ) 
                end 
                if isPedInVehicle ( thePlayer ) then 
                    destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) 
                end 
            end 
        end 
    end 
) 
      
addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), 
    function ( thePlayer ) 
        if getElementType ( thePlayer ) == "player" then 
            if getPlayerTeam ( thePlayer ) == getTeamFromName ( "Skulls" ) then          
                for _, thePeds in ipairs ( getElementsByType ( "ped", getResourceRootElement ( getThisResource() ) ) ) do            
                    triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePeds ) 
                    setTimer ( giveWeapon, 500, 1, thePeds, 25, 99999, true )                    
                end 
            end 
        end 
    end 
) 
  

Edited by Guest
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...