FlyingSpoon Posted April 23, 2015 Posted April 23, 2015 function onDeath () spawnSystem() triggerServerEvent ( "on.death", localPlayer ) end addEventHandler("onClientPlayerWasted", getRootElement(), onDeath) Basically when a person dies, I want to re-open the gui function called - function spawnSystem() , but it doesn't open it up.
Walid Posted April 23, 2015 Posted April 23, 2015 the function must be in the same resource (client side)
FlyingSpoon Posted April 23, 2015 Author Posted April 23, 2015 function spawnSystem() - end addEventHandler("onClientResourceStart", resourceRoot, spawnSystem) function onDeath () spawnSystem() triggerServerEvent ( "on.death", localPlayer ) end addEventHandler("onClientPlayerWasted", getRootElement(), onDeath)
Walid Posted April 23, 2015 Posted April 23, 2015 try this if it dosen't work , try triggerClientEvent from server side (onPlayerWasted) function onDeath () if source == localPlayer then spawnSystem() triggerServerEvent ( "on.death", localPlayer ) end end addEventHandler("onClientPlayerWasted", getRootElement(), onDeath)
FlyingSpoon Posted April 23, 2015 Author Posted April 23, 2015 My spawn is like set in a interior etc, but when I did my screen is black why? And GUI shows up.
ALw7sH Posted April 23, 2015 Posted April 23, 2015 Are you using spawnPlayer function in your spawn codes?
FlyingSpoon Posted April 24, 2015 Author Posted April 24, 2015 I am using setElementPositon function onDeath () if source == localPlayer then spawnSystem() triggerServerEvent ( "on.death", localPlayer ) end end addEventHandler("onClientPlayerWasted", getRootElement(), onDeath)
Walid Posted April 24, 2015 Posted April 24, 2015 My spawn is like set in a interior etc,but when I did my screen is black why? And GUI shows up. i think there is something wrong with your (dimension;interior)
FlyingSpoon Posted April 24, 2015 Author Posted April 24, 2015 I dont think so, because when I join the server it's perfect, but after I die, it's all black ;(
Walid Posted April 24, 2015 Posted April 24, 2015 I dont think so, because when I join the server it's perfect, but after I die, it's all black ;( show me your code.
FlyingSpoon Posted April 24, 2015 Author Posted April 24, 2015 I'll send you it in PM, I don't want to share it.
ALw7sH Posted April 24, 2015 Posted April 24, 2015 As i told you and WhoAmI told you, you have to use spawnPlayer function
FlyingSpoon Posted April 24, 2015 Author Posted April 24, 2015 Nvm fixed it, I have just changed ped and stuff to dimension 0 and stuff, and moved it out of interior.
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