Respawn?

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
ae2x
Junior Member
Posts: 27
Joined: Mon Apr 09, 2018 4:26 pm

Respawn?

Postby ae2x » Thu Mar 07, 2019 12:48 am

I found this evenscript script but not working with es_emulator

Code: Select all

import es

def player_say(ev):
   if ev['text'] == '!respawn':
      es.server.cmd('est_spawn %s 1'%(ev['userid']))


So if that is so simple made can someone remake it?
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Respawn?

Postby satoon101 » Thu Mar 07, 2019 2:29 am

It's been awhile, but I think this will work:

Syntax: Select all

from commands.say import SayCommand
from players.entity import Player


@SayCommand('!respawn')
def respawn_player(command, index, team_only):
Player(index).spawn()
Image
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Respawn?

Postby Ayuto » Thu Mar 07, 2019 6:40 am

If you want to respawn alive players, you need to pass True to the spawn function. That will force a respawn.

Your ES add-on doesn't work because est_spawn is a server command that is provided by ES Tools, which doesn't work anymore since 2010. Though, there are alternatives that provide the same commands.
In your server console you should see "unknown command est_spawn".
ae2x
Junior Member
Posts: 27
Joined: Mon Apr 09, 2018 4:26 pm

Re: Respawn?

Postby ae2x » Thu Mar 07, 2019 12:08 pm

how about respawn in map counter strike source like there is always a respawn ofc is that possible?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Respawn?

Postby Ayuto » Thu Mar 07, 2019 12:41 pm

I'm not quite sure what you mean. player.spawn() only spawns players that are dead, spectator or unassigned. player.spawn(True) forces a spawn/respawn. No matter if the player is alive, dead, spectator, etc. The game or map doesn't really matter. The map just needs a spawn point.
ae2x
Junior Member
Posts: 27
Joined: Mon Apr 09, 2018 4:26 pm

Re: Respawn?

Postby ae2x » Thu Mar 07, 2019 1:15 pm

Okay so i need that player.spawn(True) no matter where he is or what he doing it always respawn him
ae2x
Junior Member
Posts: 27
Joined: Mon Apr 09, 2018 4:26 pm

Re: Respawn?

Postby ae2x » Thu Mar 07, 2019 1:16 pm

Syntax: Select all

from commands.say import SayCommand
from players.entity import Player


@SayCommand('!respawn')
def respawn_player(command, index, team_only):
Player(True).spawn()


Like this?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Respawn?

Postby Ayuto » Thu Mar 07, 2019 4:27 pm

No, like this:

Syntax: Select all

from commands.say import SayCommand
from players.entity import Player


@SayCommand('!respawn')
def respawn_player(command, index, team_only):
Player(index).spawn(True)

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 18 guests