jkub Posted November 28, 2010 Share Posted November 28, 2010 I am rewriting my entire spawn system on my server for about the ten millionith time, and I was needing to know if there was a way to "unspawn" a player after he logs out of his account. For example, if you connect to a server with no gamemode or resources running, it is a strait black screen where the player is not in the actual world yet. Reason being is that once a player logs out in my server, he will be returned to a "login screen" and he is not allowed to do anything until he logs in. So if he still has a character spawned in the world, he can still be killed or manipulated. That will not only be annoying, but it will interfere with other scripts and in turn screw up my login system. So instead of "patching" it up I was looking for a 1 shot fix. I am shooting for something like that after logging out. But I looked in the wiki and saw nothing that would work. I was also wondering if there was a function that checks if a player is spawned into the world or not, I looked for that also but to my luck nothing turned up. I would appreciate any help with this, and thanks for any help I can get. Link to comment
Castillo Posted November 28, 2010 Share Posted November 28, 2010 you could set his position under water or something like that, is my idea. Link to comment
jkub Posted November 28, 2010 Author Share Posted November 28, 2010 well then he would drown lol. Ive also tried the ghetto method of setting position to dead center of map b4 and that failed as well with some of my older systems. I don't know what to do Link to comment
Castillo Posted November 28, 2010 Share Posted November 28, 2010 kill him first then set position? Link to comment
jkub Posted November 28, 2010 Author Share Posted November 28, 2010 thats a start lol... Maybe there could be setting the player an another unused dimension but then again, that is ghetto. Link to comment
Remp Posted November 28, 2010 Share Posted November 28, 2010 I dont think there is such a thing as 'despawned'. When you join a server with no resources running and get a black screen, if you use runcode to fade the camera and set the local player as the camera target, your character is just frozen at 0,0,0. You are always spawned in the world, you just arent looking at yourself Link to comment
CowTurbo Posted November 28, 2010 Share Posted November 28, 2010 I dont think there is such a thing as 'despawned'. When you join a server with no resources running and get a black screen, if you use runcode to fade the camera and set the local player as the camera target, your character is just frozen at 0,0,0. You are always spawned in the world, you just arent looking at yourself then just check does player position is 0 0 0 if is, then he isnt spawned and when he logout, freeze him, and set his pos to 0 0 0 and when spawn, unfreeze him. Link to comment
jkub Posted November 28, 2010 Author Share Posted November 28, 2010 I dont think there is such a thing as 'despawned'. When you join a server with no resources running and get a black screen, if you use runcode to fade the camera and set the local player as the camera target, your character is just frozen at 0,0,0. You are always spawned in the world, you just arent looking at yourself then just check does player position is 0 0 0 if is, then he isnt spawned and when he logout, freeze him, and set his pos to 0 0 0 and when spawn, unfreeze him. That is exactly what I have done before, and rewriting my code, I cannot fall back on methods like that and be able to rely on it. Link to comment
dzek (varez) Posted November 28, 2010 Share Posted November 28, 2010 what about destroyElement? Link to comment
Remp Posted November 28, 2010 Share Posted November 28, 2010 You cant destroyElement on a player That is exactly what I have done before, and rewriting my code, I cannot fall back on methods like that and be able to rely on it. why not? whats wrong with it? Link to comment
jkub Posted November 28, 2010 Author Share Posted November 28, 2010 It specificly tells you on the wiki that you can't use destroyElement on players. I don't think it says why, but my guess would be that if you were to remove a player from the element tree, it would be something like kicking him from the server. Link to comment
BinSlayer1 Posted November 28, 2010 Share Posted November 28, 2010 onPlayerLogout , fade his camera to black and optionally set his position to 0,0,0 and freeze him if you don't want his element to interact anymore.. Btw, I dont think you can freeze players who are in the state of "falling" so you could warp his ass into a vehicle and freeze the vehicle at 0,0,0 if this is the case https://wiki.multitheftauto.com/wiki/FadeCamera Link to comment
Castillo Posted November 29, 2010 Share Posted November 29, 2010 what about switching dimension? Link to comment
jkub Posted November 29, 2010 Author Share Posted November 29, 2010 I mentioned the changing of dimensions earlier Link to comment
Castillo Posted November 29, 2010 Share Posted November 29, 2010 oh yeah, my bad. and didn't that worked? Link to comment
12p Posted November 29, 2010 Share Posted November 29, 2010 maybe you should use fadeCamera --black screen setElementInterior --no area in admin panel, so he isn't inside the map setElementPosition --to 0,0,0 setPedFrozen --so he won't do anything anymore setElementAlpha --invisible hahahaha! Link to comment
jkub Posted November 30, 2010 Author Share Posted November 30, 2010 Ok guys. Thanks for the help, I may try out some of this when I get to this part of my system. But if you have more ideas, please don't hesitate to voice them here. 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