Jump to content

sloth bot question


Castillo

Recommended Posts

function Spawnbot1 (source) 
local x,y,z = getElementPosition (source) -- Posisi koordinat XYZ, yang ini menandakan "dapatkan lokasi yang menulis commandnya" 
local rot= 90 -- Rotasi botnya pada saat spawnnya 
local skin=287 -- ID skin orang yang diambil untuk bot 
local interior=0 -- Lokasi interior bot, 0 berarti di luar  
local dimension= 0 -- Lokasi dimensi bot 
local weapon=22 -- ID Senjata yang akan dipakai bot 
local team = Army 
local mode= "guarding" -- Mode yang bot mau lakukan, informasi lebih lengkap ada di MTA SA wiki 
local modesubject=source -- Target yang akan ditembak oleh bot 
call (getResourceFromName("slothbot"), "spawnBot", x+2, y, z+1, rot, skin, interior, dimension, team, weapon, mode, modesubject) -- Call dari resource lain (slothbot) untuk mengikuti semua variabel dari atas. 
end 
  
addCommandHandler("spawnbot", Spawnbot1) -- Command yang bisa digunakan untuk spawn botnya. 

Link to comment
if I'm right, slothbot kills someone if that player isn't in the same team. So change the team and slothbot will stop.

no, look what i made,

a ped in client side then i create a slothbot in server side but the slothbot keeps killing the ped (its suposed slothbot to protect the ped lol), so how i could stop this? does slothbot has any argument for this?

Link to comment

thew only way to stop a bot from shooting at peds or players is to put them on the bots team. you cant do that with the normal functions of slothbot, so you have to do this:

setElementData(thePed, "BotTeam", theTeam) 

where "thePed" is your ped that you dont want the bot to shoot, and theTeam is the team that your slothbot is on.(the team element id, not the team name)

if i remember correctly, your ot should be all buddy buddy with the ped after that.

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