ThePCGuy Posted July 11, 2013 Share Posted July 11, 2013 Is it possible to create a screen shaking effect with this function? Like that the function will loop so you have a constant screen shaking effect for example when you are drunk. And if so, can someone give me a little example? Link to comment
Al3grab Posted July 11, 2013 Share Posted July 11, 2013 You can use these arguments ( client-side) makeSound: A boolean specifying whether the explosion should be heard or not. camShake: A float specifying the camera shake's intensity. damaging: A boolean specifying whether the explosion should cause damage or not. Link to comment
ThePCGuy Posted July 11, 2013 Author Share Posted July 11, 2013 I still dont get it, how can i script it so the createExplosion will go in a loop till it's being called to shut off? Link to comment
ThePCGuy Posted July 12, 2013 Author Share Posted July 12, 2013 Ok, thanks. But the explosion that i will create will be visible for everyone right? Is it possible to make it invisible for everyone just that the player gets the screen shake alone? Link to comment
PaiN^ Posted July 12, 2013 Share Posted July 12, 2013 Do it client side and it will be visible for you only . Link to comment
ThePCGuy Posted July 12, 2013 Author Share Posted July 12, 2013 Okay, but how can i locate the explosion beneath the ground, so ''you'' the player will get the shake but not see the explosion. Link to comment
PaiN^ Posted July 12, 2013 Share Posted July 12, 2013 local x, y, z = getElementPosition( getLocalPlayer( ) ) createExplosion( x, y, z - 2, ... ) Link to comment
ThePCGuy Posted July 12, 2013 Author Share Posted July 12, 2013 I've got another problem now, i want to call the explosion function with setTimer, but the function is located in the server sided script, and the setTimer in the client sided part. How can i call the function now? Link to comment
PaiN^ Posted July 12, 2013 Share Posted July 12, 2013 In order to make the explosion harmless and visible only to you you need to make it client side, If you made it server side it will be harmful . Link to comment
ThePCGuy Posted July 12, 2013 Author Share Posted July 12, 2013 No i made a server sided function that activates the client sided function, but i want to call that server sided function with a timer that's not in the same lua file. Link to comment
PaiN^ Posted July 12, 2013 Share Posted July 12, 2013 You can ust triggers but i doubt it a good idea ! Link to comment
MIKI785 Posted July 12, 2013 Share Posted July 12, 2013 No i made a server sided function that activates the client sided function, but i want to call that server sided function with a timer that's not in the same lua file. Not in a same lua file? If the function is not local you can call it from any file in that resource (of the same type client/server). If it's another resource, just export the function. Link to comment
ThePCGuy Posted July 12, 2013 Author Share Posted July 12, 2013 I've got another problem, i called a server function with triggerServerEvent, but debugscript gives me a error that the server sided event is not added, but it is. ERROR: Client (Merry) triggered serverside event checkForDrunk, but event is not added serverside Link to comment
bandi94 Posted July 12, 2013 Share Posted July 12, 2013 I've got another problem, i called a server function with triggerServerEvent, but debugscript gives me a error that the server sided event is not added, but it is. ERROR: Client (Merry) triggered serverside event checkForDrunk, but event is not added serverside show the scrip where you added the event ? Link to comment
ThePCGuy Posted July 12, 2013 Author Share Posted July 12, 2013 Well, this is a function from the server side part: function checkDrunkLevel(charID) local result = mysql_query(handler, "SELECT * FROM `chars` WHERE `id` = '" .. (charID) .. "'") local row = mysql_fetch_assoc(result) charID = row["id"] drunkLevel = row["alcoholpercentage"] triggerClientEvent("theBlurShizzle", getRootElement(), drunkLevel) end addEvent( "checkForDrunk", true ) addEventHandler( "checkForDrunk", getRootElement(), checkDrunkLevel ) And this is a part from the client side: function triggerDrunkLevelCheck() playerID = getLocalPlayer() triggerServerEvent( "checkForDrunk", getLocalPlayer(), playerID ) end addEventHandler("onClientPreRender", root, triggerDrunkLevelCheck) Link to comment
ThePCGuy Posted July 12, 2013 Author Share Posted July 12, 2013 So, why does it say it's not added server side then? Link to comment
ThePCGuy Posted July 12, 2013 Author Share Posted July 12, 2013 Well, i'm somewhat closer to the problem. When i run the script it gives on error on every player. Here: ERROR: Client (Merry) triggered serverside event checkForDrunk, but event is not added serverside ERROR: Client (Chuckie) triggered serverside event checkForDrunk, but event is not added serverside So, someone have a clue what is going on here? Link to comment
bandi94 Posted July 12, 2013 Share Posted July 12, 2013 is everything 'ok' in meta.xml ? defined as server/client side'd script ? Link to comment
itoko Posted July 12, 2013 Share Posted July 12, 2013 Maybe there is something above the serverside event, that stop the addEvent, try to put the serverside event and function you showed us, in another server file (create a new one) 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