Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-01-03, 01:04


Kradus







Wiek: 28
Na forum: 4169 dni
Posty: 100
Nick w MP: Salldan

Piwa: 78

Respekt: 50

Ot?? jak w temacie poczyta?em troch? o tych botach i uda?o mi si? je zrobi? ale jest pewien problem. Bo one s? "jednorazowe" raz zaczn? strzela? a potem no nic wi?cej nie robi? tylko stoj?.

function boss (player,comando,weaponid,skinid)
local x,y,getElementPosition(player)
 bot exports "slothbot" ]:spawnBot x,y,90tonumber(weaponid), 00politonumber(skinid), "hunting"true )
 end
addCommandHandler("spawnbot",boss)

function boss2 (player,comando,weaponid,skinid)
local x,y,getElementPosition(player)
 bot2 exports "slothbot" ]:spawnBot x,y,90tonumber(weaponid), 00politonumber(skinid), "guarding"true )
 end
addCommandHandler("ochrona",boss2)

function boss3 (player,comando,weaponid,skinid)
local x,y,getElementPosition(player)
 bot3 exports "slothbot" ]:spawnBot x,y,90tonumber(weaponid), 00politonumber(skinid), "following"true )
 end
addCommandHandler("follower",boss3)


Co tu jest nie tak?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-16, 11:15


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

daj funkcje kt?r? eksportujesz 'spawnBot'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-16, 22:54


Kradus







Wiek: 28
Na forum: 4169 dni
Posty: 100
Nick w MP: Salldan

Piwa: 78

Respekt: 50

Emm nie bardzo rozumiem. Co da?? To ju? wszystko wy?ej jest kod na frakcje i nic wi?cej.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-16, 23:01


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Jak masz skrypt slothbot to poszukaj w nim funkcji spawnBot i daj j? tutaj

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-16, 23:23


Kradus







Wiek: 28
Na forum: 4169 dni
Posty: 100
Nick w MP: Salldan

Piwa: 78

Respekt: 50

function spawnBot(xyzrotskininteriordimensionteamweaponmodemodesubject)
--checks the function commands to see if all neccesary parts are filledsets defaults if not or returns false.
    if not x then return false end
    if not y then return false end
    if not z then return false end
    if not rot then return false end
    if not skin then skin 0 end
    if not interior then interior 0 end
    if not dimension then dimension 0 end
    if isElement(team) == false then team nil end
    if not weapon then weapon 0 end
    if not mode then mode "hunting" end
    if not modesubject then modesubject nil end
    if mode == "following" then
        if not modesubject then return false end
    end
    if mode == "chasing" then
        if not modesubject then return false end
    end
    local slothbot createPed (tonumber(skin),tonumber(x),tonumber(y),tonumber(z))--spawns the ped
    if (slothbot ~= falsethen
        triggerEvent "onBotSpawned"slothbot )        
        setTimer setElementData2001slothbot"slothbot"true ) -- makes it a bot
        setTimer setElementData2001slothbot"AllowFire"true ) -- makes it able to shoot when it wants
        setTimer assigncontroller3001slothbot ) --sets the bots controller
        setTimer giveWeapon8001slothbottonumber(weapon), 99999true ) --gives the weapon
        setElementData(slothbot"BotWeapon"tonumber(weapon))
        if team ~= nil then
            setElementData(slothbot"BotTeam"team)
        end
        setTimer setElementInterior1001slothbottonumber(interior)) --sets interior
        setTimer setElementDimension1001slothbottonumber(dimension)) --sets dimension
        
        --sets the mode
        if mode == "waiting" then
            setTimer setElementData6001slothbot"status""waiting")
        elseif mode == "following" then
            setTimer setElementData4001slothbot"leader"modesubject )
            setTimer setElementData6001slothbot"status""following")
        elseif mode == "chasing" then
            setTimer setElementData4001slothbot"target"modesubject )
            setTimer setElementData6001slothbot"status""chasing")
        elseif mode == "guarding" then
            setTimer setBotGuard4001slothbotxyz)
        else
            setTimer setElementData6001slothbot"status""hunting")
        end
        return slothbot
    end
end


No jest i co dalej?

Postaw piwo autorowi tego posta
 

 
Tagi: boty
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku