Jump to content

[Ayuda Nuevamente] Slothbot


Platin

Recommended Posts

Haciendo pruebas con Slothbot vi que el mismo tiene unos problemas, entre ellos el que no detecta los teams y que da un error al intentar usar el setBotWeapon.

Como ustedes son los pro's acá, quisiera dejar mi archivo de pruebas aquí, a ver si es error mío o algo más.

function bot() 
    bots = exports.Slothbot:spawnBot (2919, -2051, 4, 0, 285, 0, 0) -- No lo complete porque la accion que quiero que cumplan igual no la hacen. 
    exports.Slothbot:setBotTeam (bots, "Sobrevivientes") 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), bot ) 
  
function bot2() 
    bots2 = exports.Slothbot:spawnBot (2919, -2053, 4, 0, 115, 0, 0) 
    exports.Slothbot:setBotTeam (bots2, "Staff") 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), bot2 ) 
  
function botTeam() -- Este lo hice para ver si los teams estaban funcionando, como funcionar funcionan, pero no se detectan. 
    exports.Slothbot:getBotTeam (bots) 
    if exports.Slothbot:getBotTeam(false) then 
        outputChatBox ( "Bots no tener equipo" ) 
    else 
        outputChatBox ( "Bots tener equipo" ) 
    end 
end 
addCommandHandler("team",botTeam) 
  
function weaponParty() -- En este caso, probé el poner las armas mediante un comando a los bots, probe usando source y ni bola, lo mismo con estos dos. 
    exports.Slothbot:setBotWeapon(bots, 25) 
    exports.Slothbot:setBotWeapon(bots2, 25) 
end 
addCommandHandler("arma",weaponParty) 

Bueno, por si no quedo claro, quisiera saber que si es un error mío en el código, cosa que no dudo, o si es un error del Slothbot ya que no esta updateado. Desde ya, ¡muchas gracias!

Link to comment
  
function bot() 
    bots = exports.Slothbot:spawnBot (2919, -2051, 4, 0, 285, 0, 0) -- No lo complete porque la accion que quiero que cumplan igual no la hacen. 
    exports.Slothbot:setBotTeam (bots, getTeamFromName("Sobrevivientes")) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), bot ) 
  
function bot2() 
    bots2 = exports.Slothbot:spawnBot (2919, -2053, 4, 0, 115, 0, 0) 
    exports.Slothbot:setBotTeam (bots2, getTeamFromName("Staff")) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), bot2 ) 
  
function botTeam() -- Este lo hice para ver si los teams estaban funcionando, como funcionar funcionan, pero no se detectan. 
    exports.Slothbot:getBotTeam (bots) 
    if exports.Slothbot:getBotTeam(false) then 
        outputChatBox ( "Bots no tener equipo" ) 
    else 
        outputChatBox ( "Bots tener equipo" ) 
    end 
end 
addCommandHandler("team",botTeam) 
  

Link to comment

Buen intento, pero es un problema del resource Slothbot de seguro, no detecta los equipos, da igual lo que hagas. Antes lo hacía, de seguro fue por la actualización de player a ped y eso, pero no se.

EDIT

Progrese, ahora no se pelean, pero desearía que me sigan, ¿qué debería de hacer?

EDIT2

Todo funciona, muchas gracias.

teamStaff = getTeamFromName ("Staff") 
setTeamFriendlyFire ( teamStaff, false ) 
  
function bot1() 
    bots1 = exports.Slothbot:spawnBot (2919, -2051, 4, 0, 285, 0, 0, teamStaff, 25, "following", true ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), bot1 ) 
  
function bot2() 
    bots2 = exports.Slothbot:spawnBot (2919, -2053, 4, 0, 115, 0, 0, teamStaff, 25, "following", true ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), bot2 ) 
  
function bot1haveteam() 
    exports.Slothbot:getBotTeam (bots1) 
    if exports.Slothbot:getBotTeam(false) then 
        outputChatBox ( "Bots no tener equipo" ) 
    else 
        outputChatBox ( "Bots tener equipo" ) 
    end 
end 
addCommandHandler("team", bot1haveteam) 
  
function weaponParty() 
    exports.Slothbot:setBotWeapon(bots1, 25) 
    exports.Slothbot:setBotWeapon(bots2, 25) 
end 
addCommandHandler("arma", weaponParty) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...