AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spawn to origin (https://forums.alliedmods.net/showthread.php?t=29147)

NewUser 05-30-2006 17:27

Spawn to origin
 
Instead of the default origins created by the mapper, spawn elsewhere? How would I do this? And, it's for one map in specific so don't warn me about how it will be messed up if I declare an origin.

VEN 05-30-2006 19:08

This should work
Code:
#define SPAWN_MAX 32 new Float:g_spawn_origin[2][SPAWN_MAX][3] = {     {         {0.0, 0.0, 0.0}, // define your origins for Ts spawn points         // ...         {0.0, 0.0, 0.0}     },     {         {0.0, 0.0, 0.0}, // define your origins for CTs spawn points         // ...         {0.0, 0.0, 0.0}     } } new g_spawn_classname[2][] = {"info_player_deathmatch", "info_player_start"} public plugin_init() {     for (new i = 0; i < 2; ++i) {         new j = -1, k = 0         while ((j = find_ent_by_class(j, g_spawn_classname[i])))             entity_set_origin(j, g_spawn_origin[i][k++])     } }

NewUser 05-30-2006 21:41

Tag mismatches on lines 13, 15, 17.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define SPAWN_MAX 32 #define PLUGIN "plugin" #define version "version" #define author "author" new Float:g_spawn_origin[2][SPAWN_MAX][3] = {     {         {-2692, -2272, -342}, // line 13         {-2191, 2098, -348} // line 15     } } // line 17 new g_spawn_classname[2][] = {"info_player_deathmatch","info_player_start"} public plugin_init() {     register_plugin(PLUGIN,version,author);     for(new i = 0; i < 2; ++i)     {         new j = -1, k = 0         while ((j = find_ent_by_class(j, g_spawn_classname[i])))             entity_set_origin(j, g_spawn_origin[i][k++])     } }

VEN 05-31-2006 11:24

You should do it like that:
Code:
#define SPAWN_MAX 2 new Float:g_spawn_origin[2][SPAWN_MAX][3] = {     {         {-2692.0, -2272.0, -342.0}, // T point #1         {-2191.0, 2098.0, -348.0} // T point #2     },     {         {-342.0, 543.0, 933.0}, // CT point #1         {-883.0, 423.0, 783.0} // CT point #2     } }


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

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