Jump to content

arrays


-stolka-

Recommended Posts

hi i have this function... how do i make "Ateam" variable contains two teams?

  
local Ateam = getTeamFromName ( "Delta Force" ) 
  
addCommandHandler( "soldiers",  
    function( plr, cmd, amount ) 
        if not amount then return end 
        amount = tonumber( amount ); 
        local x, y, z = getElementPosition( plr ); 
        local peds = { } 
        for i = 1, amount do 
            x = x + math.cos( math.rad( i + 10 ) ) * 2; 
            y = y - math.sin( math.rad( i + 10 ) ) * 2; 
            local ped = exports [ "slothBot" ]:spawnBot ( x, y, z, 270,  math.random ( 300, 303 ), 0, 0, Ateam, math.random ( 24, 32 ),         "chasing", true ); 
        setElementModel ( ped, 287 ); 
        setPedStat(ped, 24, 1000); 
        setPedStat(ped, 78, 1000); 
        setPedStat(ped, 79, 1000); 
        setPedStat(ped, 77, 1000); 
        setPedStat(ped, 73, 1000); 
        setPedStat(ped, 72, 1000); 
        setPedStat(ped, 74, 1000); 
        setPedStat(ped, 70, 1000); 
        setPedStat(ped, 71, 1000); 
        setPedStat(ped, 69, 1000); 
        setPedStat(ped, 76, 1000); 
        setPedStat(ped, 75, 1000); 
            if ped then 
                if not playerPeds[ plr ] then 
                    playerPeds[ plr ] = {  }; 
                    table.insert( playerPeds[ plr ], ped ); 
                else 
                    table.insert( playerPeds[ plr ], ped ); 
                end 
                table.insert( peds, ped ); 
            end 
        end 
    end 
) 

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...