FlyingSpoon Posted April 23, 2015 Share 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. Link to comment
Walid Posted April 23, 2015 Share Posted April 23, 2015 the function must be in the same resource (client side) Link to comment
FlyingSpoon Posted April 23, 2015 Author Share Posted April 23, 2015 function spawnSystem() - end addEventHandler("onClientResourceStart", resourceRoot, spawnSystem) function onDeath () spawnSystem() triggerServerEvent ( "on.death", localPlayer ) end addEventHandler("onClientPlayerWasted", getRootElement(), onDeath) Link to comment
Walid Posted April 23, 2015 Share 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) Link to comment
FlyingSpoon Posted April 23, 2015 Author Share 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. Link to comment
ALw7sH Posted April 23, 2015 Share Posted April 23, 2015 Are you using spawnPlayer function in your spawn codes? Link to comment
FlyingSpoon Posted April 24, 2015 Author Share 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) Link to comment
Walid Posted April 24, 2015 Share 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) Link to comment
FlyingSpoon Posted April 24, 2015 Author Share 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 ;( Link to comment
Walid Posted April 24, 2015 Share 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. Link to comment
FlyingSpoon Posted April 24, 2015 Author Share Posted April 24, 2015 I'll send you it in PM, I don't want to share it. Link to comment
ALw7sH Posted April 24, 2015 Share Posted April 24, 2015 As i told you and WhoAmI told you, you have to use spawnPlayer function Link to comment
FlyingSpoon Posted April 24, 2015 Author Share 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. 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