Page 1 of 1

Respawn?

Posted: Thu Mar 07, 2019 12:48 am
by ae2x
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?

Re: Respawn?

Posted: Thu Mar 07, 2019 2:29 am
by satoon101
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()

Re: Respawn?

Posted: Thu Mar 07, 2019 6:40 am
by Ayuto
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".

Re: Respawn?

Posted: Thu Mar 07, 2019 12:08 pm
by ae2x
how about respawn in map counter strike source like there is always a respawn ofc is that possible?

Re: Respawn?

Posted: Thu Mar 07, 2019 12:41 pm
by Ayuto
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.

Re: Respawn?

Posted: Thu Mar 07, 2019 1:15 pm
by ae2x
Okay so i need that player.spawn(True) no matter where he is or what he doing it always respawn him

Re: Respawn?

Posted: Thu Mar 07, 2019 1:16 pm
by ae2x

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?

Re: Respawn?

Posted: Thu Mar 07, 2019 4:27 pm
by Ayuto
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)