AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple respawn (https://forums.alliedmods.net/showthread.php?t=24485)

Obbin 02-24-2006 08:22

Simple respawn
 
I want to respawn a player when he/she dies or types /spawn.
I looked at Geesus "Respawn forever", but i didnt understand the "task-id-system". If someone could write up a simple code, or explain the task thing, it would be nice.

Thx.

v3x 02-24-2006 08:32

Simple.
Code:
#include <amxmodx> #include <cstrike> public plugin_init() {   register_clcmd("say /spawn" , "cmd_spawn"); } public cmd_spawn(id) {   if(!is_user_alive(id)) {     set_task(0.1 , "spawn_user" , id);   }   return PLUGIN_HANDLED; // if you don't want other people to see the /spawn text in chat } public spawn_user(id) {   cs_user_spawn(id); }

Obbin 02-24-2006 08:47

Width cs_user_spawn() there is no need to spawn the player twice to avoid the hl engine bug?

v3x 02-24-2006 09:00

Well cs_user_spawn is specifically for players and spawn() is not, so I'd say yes ( no need for 2 ).

nordy 05-28-2006 14:06

can you add for this also that the weaponss aren't staying eem i mean when you are killed your weapon disapears...

cccpsmiley 05-28-2006 15:04

any way you can possibly make this work for all mods ? or atleast dod :)

SweatyBanana 05-28-2006 15:12

Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_clcmd("say /spawn" , "cmd_spawn"); } public cmd_spawn(id) {     spawn(id);     set_task(0.5,"second_spawn",id); } public second_spawn(id) {     spawn(id); }

cccpsmiley 05-28-2006 18:03

dont work for dod :(

Hawk552 05-28-2006 20:28

You need to give more time between the spawns.

SweatyBanana 05-28-2006 20:49

fixed.


All times are GMT -4. The time now is 20:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.