Jump to content

createExplosion


ThePCGuy

Recommended Posts

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 post

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 post

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

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

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 post

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 post

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