Jump to content

createExplosion


ThePCGuy

Recommended Posts

Posted

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?

Posted

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. 
  

Posted

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?

Posted

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?

Posted

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 .

Posted

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.

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

Posted

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

Posted
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 ?

Posted

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) 

Posted

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?

Posted

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)

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