-
Posts
200 -
Joined
-
Last visited
Everything posted by Cassandra
-
It doesn't make the bot jump when clearpath, jumping and isTimer is equals to false. It occurs frequently but randomly. Inside onClientRender local jumping = getPedControlState(bot, "jump") local clearpath = isLineOfSightClear(px, py, pz+2, x, y, z+2, true, true, false, true, false, true, false) outputChatBox("Clear: " .. tostring(clearpath)) outputChatBox("Jumping: " .. tostring(jumping)) if((clearpath == false) and (jumping == false) and (isTimer(jumpTimer) == false)) then setPedAnimation(bot) setPedControlState(bot, "jump", true) jumpTimer = setTimer(setPedControlState, 500, 1, bot, "jump", false) end
-
Aaah thanks for clarifying. I got it now.
-
Is that the same the other way around? Like if the element is created server side, the client doesn't know about it.
-
Aaaaah thought about that. Is that the same for all other elements?
-
Nope. Weird huh? are you sure that "botGet" function is working properly? Yeah it works.
-
Nope. Weird huh?
-
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)
-
Aaaah gotcha. Thanks for clarifying it.
-
Why do people put spawnPlayer, fadeCamera, etc inside a timer which has no interval? What's the point of it?
-
setAccountData doesn't take in decimal values. It coverts them to whole number.
-
Alright seem like I have to use that anyway. I have a problem though. Does anyone know why setAccountData doesn't set floating values? My player's position is a bit messed up for that.
-
I want to use bandwidth but I don't want to use setElementData or another trigger function. Will it be possible to reference that variable?
-
Suggestion: Could you make the server folder directory configurable?
-
Any alternatives?
-
Is there a way to get the return value of a function using triggerServer/ClientEvent?
-
Not a good way of advertising I would say.
-
Thanks. It works fine now.
-
Aren't there are any alternatives for that? To make a pickup not pickable.
-
Is there a way to fix that?
-
I will try that. Thanks for the tips.
-
Yeah. I guess I have to stick with the "exports".
-
Ooops sorry for not explaining better. I'm needing a method to use a function from other files on the same resource. So, for example I want to use that function above to my other scripts on the same resource. I don't want it to declare over and over again for each scripts.
-
Is there a way to reuse a function on different files?(Doesn't matter if it's server/client) For example if I have this code in s_player.lua function multi_check( source, ... ) local arguments = { ... }; for _, argument in ipairs( arguments ) do if argument == source then return true; end end return false; end I want to use that function on all of the different files.
-
Thanks. That what I was looking for.
-
Similar. I want it to play gta world sound instead.
