AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Teleport player to spawn! (https://forums.alliedmods.net/showthread.php?t=20202)

atomic 11-03-2005 16:00

Teleport player to spawn!
 
how do i teleport a player to their spawn without typing the origins! or get the spawnpoint

"Cant look at the functions in home cuz its screwed up"

v3x 11-03-2005 16:13

I'm guessing get their spawnpoints in ResetHUD and save them, then use that?

Code:
register_event("ResetHUD", "GetSpawnOrigin", "b"); // ... new g_iOrigin[33][3]; public GetSpawnOrigin( id ) {   get_user_origin(id, g_iOrigin[id], 0); }

atomic 11-03-2005 16:24

or i can just use the function "spawn (id)"... will that work?

Hawk552 11-03-2005 19:09

No, it will not. You need to spawn(id) twice, because of some stupid bug in the HL engine. Like this:

Code:
public whatever(id) {     set_task(0.5,"spawnage",id);     set_task(0.7,"spawnage",id); } public spawnage(id)     spawn(id);

v3x 11-03-2005 21:05

If you're not using the older AMXX versions, use cs_user_spawn. It seems to work perfectly :D

mysticssjgoku4 11-04-2005 01:34

Quote:

Originally Posted by Hawk552
No, it will not. You need to spawn(id) twice, because of some stupid bug in the HL engine. Like this:

Code:
public whatever(id) {     set_task(0.5,"spawnage",id);     set_task(0.7,"spawnage",id); } public spawnage(id)     spawn(id);

spawn(id) creates a new entity, it doesn't spawn a player. However, it CAN spawn a fake player.... :lol:

v3x 11-04-2005 01:39

Doh.. Well, if you want to just move the already alive player to where he first spawned at, just use set_user_origin ;)

atomic 11-04-2005 09:43

ill just go and look at the wc3 mod code... warden respawn!

[ --<-@ ] Black Rose 11-04-2005 11:20

w8w8... do you want respawn or teleport into base
if teleport take from uwc3's warpgate instead

v3x 11-04-2005 18:54

Try this:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {   register_plugin("Telly to spawn", "0.1", "v3x");   register_clcmd("telly", "ClCmd_Teleport", ADMIN_KICK);   register_clcmd("fullupdate", "BlockCmd");   register_event("ResetHUD", "GetSpawnOrigin", "b"); } new g_iOrigin[33][3]; public GetSpawnOrigin( id ) {   get_user_origin(id, g_iOrigin[id], 0); } public ClCmd_Teleport( id, lvl, cid ) {   if(!cmd_access(id, lvl, cid, 0))     return PLUGIN_HANDLED;   set_user_origin(id, g_iOrigin[id]);   client_print(id, 3, "If all went well, you should be where you spawned.");   return PLUGIN_HANDLED; } public BlockCmd( id ) {   return PLUGIN_HANDLED; }
After you spawn, go somewhere else. Then type "telly" in console.


All times are GMT -4. The time now is 23:36.

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