Author Topic: OnPlayerSpawn  (Read 1977 times)

Can you make event that would fire as soon as player spawns into world, regardless of whether he is inside or outside minigame?

We have OnRespawn event, but it is basically unusable outside minigames and aside of that it's not at all what I need. What I need is event that fires ONLY when player initially spawn into world (i.e. after joining and downloading all server junk, etc), not every time he dies and respawns.

Possible uses of such event:

- Make players spawn in same, specified place every time they join on free build servers where making minigame and use spawn bricks makes no sense
- Displaying rules of server, either by chat messages or by MessageBoxOK event.
- many others that I can't think about now because I'm so damn tired.

There are specific mods for the uses you have listed.

Yeah, but eventing them would be easier for most people and if, let's say I want both, I'd need to install only OnPlayerSpawn mod and teleport mod instead of rules/setting position on join (both would either require fiddling with console/changing some files outside BL). It's just easier.

Yeah, but eventing them would be easier for most people and if, let's say I want both, I'd need to install only OnPlayerSpawn mod and teleport mod instead of rules/setting position on join (both would either require fiddling with console/changing some files outside BL). It's just easier.

why would you make the person teleport on spawn lol

just put the spawn where you want them to be

or do you mean like

yeah idk

hodototman, the problem is, spawn bricks only work in minigames. On freebuild servers making default minigame just so player will spawn in right place make absolutely no sense (and since other people would probably be able to build, they would be able to build other spawn blocks, which makes player spawn randomly, AFAIK in one of them).

I found the event for you...

http://forum.blockland.us/index.php?topic=174399.0 (this also includes a Personal Spawn Point mod)

That's not quite what I need. I need event that would fire up once when player spawns initially on server, i.e. at same time that "(playername) spawned" is shown in chat. Not on every respawn and certainly not dependent on any spawn bricks.

Ok, I had some free time so I wrote one up. It's just a quick edit of Destiny's old minigame events and I didn't test it, so let me know how it works.

http://greekmods.webs.com/mods/Event_onClientEnterGame.zip
« Last Edit: March 01, 2013, 01:38:07 AM by Greek2me »

Ok, I had some free time so I wrote one up. It's just a quick edit of Destiny's old minigame events and I didn't test it, so let me know how it works.

http://greekmods.webs.com/mods/Event_onClientEnterGame.zip
Pretty sure you should package gameconnection::spawnplayer instead

Greek2me, it doesn't work.

Parameters of server:

Gamemode: Custom (with your mod installed)
No minigame

How I tested? Added event that would change emitter of one brick into laser using your event and when my friend spawned it didn't change.

Also, on another note, could you add Named Brick to possible targets?


Bump. I need that, don't have enough skill to write it myself and one Greek2me wrote doesn't work (thought I'd like to thank you for the effort, I appreciate that).