Cassandra Posted March 1, 2013 Posted March 1, 2013 What might be the problem? client: addCommandHandler("givewep", function(command, botid, weapon) botid = botid or 1 weapon = weapon or "Knife" bot = botGet(botid) or outputChatBox("Invalid Bot.") local weaponid = getWeaponIDFromName(weapon) or outputChatBox("Invalid Weapon.") if(bot and weapon) then triggerServerEvent("eGiveBotWeapon", localPlayer, bot, weaponid) outputChatBox("Bot " .. tostring(id) .. " given weapon " .. weapon) end end) server: function giveBotWeapon(bot, weaponID) setTimer(giveWeapon, 300, 1, bot, weaponID, 1, true) end addEvent("eGiveBotWeapon", true) addEventHandler("eGiveBotWeapon", root, giveBotWeapon)
Fury Posted March 1, 2013 Posted March 1, 2013 any debug error? Nope. Weird huh? are you sure that "botGet" function is working properly?
Cassandra Posted March 1, 2013 Author Posted March 1, 2013 any debug error? Nope. Weird huh? are you sure that "botGet" function is working properly? Yeah it works.
Castillo Posted March 1, 2013 Posted March 1, 2013 Your bot is created client side? if so, that's the reason.
Fury Posted March 1, 2013 Posted March 1, 2013 Yeah it works. i think u should create and check peds at server-side. that might be the problem.
Cassandra Posted March 1, 2013 Author Posted March 1, 2013 Your bot is created client side? if so, that's the reason. Aaaaah thought about that. Is that the same for all other elements?
Castillo Posted March 1, 2013 Posted March 1, 2013 Yes, if a element is created client side, the server doesn't know about it.
Fury Posted March 1, 2013 Posted March 1, 2013 Yes, if a element is created client side, the server doesn't know about it. setElementID() getElementByID() hm?
Cassandra Posted March 1, 2013 Author Posted March 1, 2013 Yes, if a element is created client side, the server doesn't know about it. Is that the same the other way around? Like if the element is created server side, the client doesn't know about it.
Castillo Posted March 1, 2013 Posted March 1, 2013 No, that's different, e.g: you can send a ped element and do stuff with him.
Cassandra Posted March 1, 2013 Author Posted March 1, 2013 No, that's different, e.g: you can send a ped element and do stuff with him. Aaah thanks for clarifying. I got it now.
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