AlliedModders

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

Unidentified 12-19-2005 17:36

Teleport
 
How would you set a teleport, to an origin with a sprite to a new origin?

teame06 12-19-2005 17:39

You mean you want to set the origin of a entity from one place to another place?

Unidentified 12-19-2005 19:00

Quote:

Originally Posted by teame06
You mean you want to set the origin of a entity from one place to another place?

No. like a teleport using a spr. Such as If I were to walk Into a certain origin or so, It would teleport me to a different origin. Catch my drift?

Unidentified 12-20-2005 17:54

Anyone? :mrgreen:

Charr 12-20-2005 21:29

EntMod

Bruno 12-20-2005 21:32

Well you can just place the sprite where you want on the map, define the coordinates, and then use the set_user_origin function.

Charr 12-20-2005 21:35

Or that too

Bruno 12-20-2005 21:41

I think this is right. If not, someone please correct me.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> new teleportstart[3] = { x, y, z };         // Coordinates new teleportend[3] = { x, y, z };       // Coordinates public plugin_init() {     register_plugin("Name of plugin","version","Your name")         set_task(1.0,"teleport",0,"",0,"b") } public teleport(id) {     new num, players[32]     get_players(players,num,"ac")     for( new i = 0;  i < num; i++ )     {     new origin[3]     get_user_origin(players[i],origin)     if(get_distance(origin,teleportstart) <= 50)  //50 is radius of teleport     {                  set_user_origin(players[i],teleportend)         } }

Do you know how to insert a model or sprite into the map?

Bruno 12-20-2005 21:42

For some reason the spacing came out kind of screwed up.

Charr 12-21-2005 08:26

Heres a basic version without a sprite and cvars:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> new telestart[3] = {x,y,z} new teleend[3] = {x,y,z}     public plugin_init() {     register_plugin("AMXX Teleporter","1.0.BETA","Charr")     register_cvar("amx_tele_enable","1")     register_cvar("amx_tele_distance","50") } public Client_PreThink(id) {     if(!is_user_alive(id) || !is_user_connected(id))         return PLUGIN_HANDLED     if(get_cvar_num("amx_tele_enable") == 0)         return PLUGIN_CONTINUE     new origin[3]     get_user_origin(id,origin,0)     if(get_distance(origin,telestart) <= get_cvar_num("amx_tele_distance"))         set_user_origin(id,teleend)     return PLUGIN_CONTINUE }


All times are GMT -4. The time now is 16:07.

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