Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
player_remove #385429
10/18/11 13:14
10/18/11 13:14
Joined: Sep 2011
Posts: 11
Germany
L
Lomacil Offline OP
Newbie
Lomacil  Offline OP
Newbie
L

Joined: Sep 2011
Posts: 11
Germany
I got the code from the tutorial(workshop25)
but I just got A7commercial and now I dont know how to remove an entity of a disconnected player, I also tried it with on_close and got no solution. Now I can connect and move around but the models are not removed if I disconnect the clients. I thought about moving them away but that would be no real solution.
Hope the anwser is as easy as my session_connect post (even if the manual says it is compatible with A7)

Last edited by Lomacil; 10/18/11 14:06.
Re: player_remove [Re: Lomacil] #385516
10/19/11 13:07
10/19/11 13:07
Joined: Sep 2011
Posts: 11
Germany
L
Lomacil Offline OP
Newbie
Lomacil  Offline OP
Newbie
L

Joined: Sep 2011
Posts: 11
Germany
just got troubled by c-lite/c-script and mixed it up

Last edited by Lomacil; 10/20/11 09:48.
Re: player_remove [Re: Lomacil] #385585
10/20/11 15:04
10/20/11 15:04
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
For anyone searching for this and maybe even for you:

Best solution is to use EVENT_DISCONNECT on the server.
The manual has an example how to use it properly.


Problem with on_close is that is it never called when the client crashes, and thus the entity remains on the server.

Re: player_remove [Re: SchokoKeks] #385606
10/20/11 20:32
10/20/11 20:32
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
If you use on_close, the entity will only be removed on the client and thus it will continue to exist on the server even after the client has left the game.

You need to use EVENT_DISCONNECT as SchokoKeks said to remove the player entity on the server. The removal of the entity will thus be communicated to all the clients automatically and the player will be completely removed on all clients.


Eats commas for breakfast.

Play Barony: Cursed Edition!
Re: player_remove [Re: Redeemer] #385691
10/22/11 05:11
10/22/11 05:11
Joined: Sep 2011
Posts: 11
Germany
L
Lomacil Offline OP
Newbie
Lomacil  Offline OP
Newbie
L

Joined: Sep 2011
Posts: 11
Germany
I think the on_close just executes the command you put in(as said in manual)
it had nothing to do with removing the entity.
My failt was just that I tried the to use the code from workshop 25 on A7 (where the less of mp commands work).
I just had to rearange the command from the workshop to

function player_remove()
{
wait(1);
ent_remove(my);
}

action player_move()
{
my.emask |= ENABLE_DISCONNECT;
my.event = player_remove;
.
.
.
}

on_close is just executed if you press the x button or cancle while an error occures. If I send a request to remove the entity to the server with on_close it would work too(just not if the client crashes thats right).
That was just what I tried to figure out my fail^^

I just got confused from the manual, because if you look for EVENT_DISCONNECT you get other examples as if you look for the event thingy, and not the one nor the other works on it own.


Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1