stefutz101 Posted December 22, 2015 Share Posted December 22, 2015 Hi , i have a mta Dayz server and i have some warns at slothbot . function spawnBot(x, y, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) --checks the function commands to see if all neccesary parts are filled, sets 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 isElement(slothbot) and getElementType(slothbot)== "ped" then if (slothbot ~= false) then triggerEvent ( "onBotSpawned", slothbot ) setTimer ( setElementData, 200, 1, slothbot, "slothbot", true ) -- makes it a bot setTimer ( setElementData, 200, 1, slothbot, "AllowFire", true ) -- makes it able to shoot when it wants setTimer ( assigncontroller, 300, 1, slothbot ) --sets the bots controller setTimer ( giveWeapon, 800, 1, slothbot, tonumber(weapon), 99999, true ) line 1160 setElementData(slothbot, "BotWeapon", tonumber(weapon)) if team ~= nil then setElementData(slothbot, "BotTeam", team) end setTimer ( setElementInterior, 100, 1, slothbot, tonumber(interior)) --sets interior setTimer ( setElementDimension, 100, 1, slothbot, tonumber(dimension)) --sets dimension --sets the mode if mode == "waiting" then setTimer ( setElementData, 600, 1, slothbot, "status", "waiting") elseif mode == "following" then setTimer ( setElementData, 400, 1, slothbot, "leader", modesubject ) setTimer ( setElementData, 600, 1, slothbot, "status", "following") elseif mode == "chasing" then setTimer ( setElementData, 400, 1, slothbot, "target", modesubject ) setTimer ( setElementData, 600, 1, slothbot, "status", "chasing") elseif mode == "guarding" then setTimer ( setBotGuard, 400, 1, slothbot, x, y, z) else setTimer ( setElementData, 600, 1, slothbot, "status", "hunting") line 1180 end return slothbot end end end I have warnings at all setTimer ( setElementData ... ) functions . Any help please ? I tried to put condition if slothbot exist then ... if isElement(slothbot) and getElementType(slothbot)== "ped" then but the same error . Photo http://postimg.org/image/gg4g6hck9/ Thanks in advance ! Link to comment
Captain Cody Posted December 22, 2015 Share Posted December 22, 2015 setElementData ( slothbot,key, value ,synchronize - True or False ) That's the correct format Link to comment
stefutz101 Posted December 22, 2015 Author Share Posted December 22, 2015 The same error . I replaced al function like your model but i still have warns Link to comment
stefutz101 Posted December 23, 2015 Author Share Posted December 23, 2015 Help , please ? Link to comment
stefutz101 Posted December 25, 2015 Author Share Posted December 25, 2015 Ok i have 4 days since i'm trying to fix those warns but i can't . Any help ? Please... Link to comment
Revolt Posted December 25, 2015 Share Posted December 25, 2015 Maybe the 'onBotSpawned' event destroys the ped? Link to comment
stefutz101 Posted December 25, 2015 Author Share Posted December 25, 2015 And if you're right how i can fix it ? Link to comment
Revolt Posted December 25, 2015 Share Posted December 25, 2015 Find the portion of the code that corresponds to the mentioned event and check its code. If it is all right, then there might be some other issues with your code... Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now