kmiles1990 5 Posted November 9, 2018 Is there any way to add spawns to specific players? Basically if I want this specific steamId to have an option to either spawn at this certain spot, or spawn randomly. Is that something that can be done? Share this post Link to post Share on other sites
LastS 7 Posted November 9, 2018 18 minutes ago, kmiles1990 said: Is there any way to add spawns to specific players? Basically if I want this specific steamId to have an option to either spawn at this certain spot, or spawn randomly. Is that something that can be done? Yes you can, but you have to develop this function, is easy, i am not at home now to do Share this post Link to post Share on other sites
kmiles1990 5 Posted November 9, 2018 Just now, LastS said: Yes you can, but you have to develop this function, is easy, i am not at home now to do When you get home, could you possibly show me an example? Just not sure where to start with this one. Share this post Link to post Share on other sites
LastS 7 Posted November 9, 2018 1 minute ago, kmiles1990 said: When you get home, could you possibly show me an example? Just not sure where to start with this one. Yeep Share this post Link to post Share on other sites
kmiles1990 5 Posted November 9, 2018 Thanks, I appreciate that. Share this post Link to post Share on other sites
IMT 3190 Posted November 9, 2018 I don't have any code available right now but it would be something along the lines of an if-statement, comparing the player.GetIdentity().GetId() (believe this one was the Steam ID) to an ID you specified. Then spawn that person at the specified location. Else spawn randomly. Share this post Link to post Share on other sites
Sentepu 7 Posted November 9, 2018 (edited) a little search and read others post is enough. unpbo the dta/scripts.pbo file and search in that folder to know what functions you can use Edited November 9, 2018 by Sentepu Share this post Link to post Share on other sites
kmiles1990 5 Posted November 9, 2018 4 hours ago, Sentepu said: a little search and read others post is enough. unpbo the dta/scripts.pbo file and search in that folder to know what functions you can use That post literally has nothing to do with my question. Share this post Link to post Share on other sites
kmiles1990 5 Posted November 9, 2018 5 hours ago, IMT said: I don't have any code available right now but it would be something along the lines of an if-statement, comparing the player.GetIdentity().GetId() (believe this one was the Steam ID) to an ID you specified. Then spawn that person at the specified location. Else spawn randomly. Yea I know how to determine which steamId, the problem is what do I put to spawn a character at a specific location in the init.c Share this post Link to post Share on other sites
Sentepu 7 Posted November 9, 2018 you have all the ID part there with a switch, create character is already in the init.c ... Share this post Link to post Share on other sites
kmiles1990 5 Posted November 9, 2018 Hmm, so basically in the CreateCharacter, I would just check for the specific ID, and if it matches, set to POS part to the vector coordinates I want? Share this post Link to post Share on other sites
kmiles1990 5 Posted November 9, 2018 That being said though, how do I allow the specific player to choose there spawn on death? Share this post Link to post Share on other sites
kmiles1990 5 Posted November 9, 2018 10 hours ago, LastS said: Yeep Would it be something like this? override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName) { string SteamId_Admin = "76561198109829398"; // SteamID if (player.GetIdentity().GetPlainId() == SteamId_Admin) { Entity playerEnt; playerEnt = GetGame().CreatePlayer(identity, characterName, pos /*How would I add the positon? as a vector?*/, 0, "NONE");//Admin Positon Class.CastTo(m_player, playerEnt); GetGame().SelectPlayer(identity, m_player); // Could I put it on a timer? Like 60 minute cool down? If he spawned here, he will spawn randomly on death for the next 60 minutes until CD is done? } else { Entity playerEnt; playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player Class.CastTo(m_player, playerEnt); GetGame().SelectPlayer(identity, m_player); } return m_player; } Share this post Link to post Share on other sites
kmiles1990 5 Posted November 14, 2018 bump Can something like this be done? Share this post Link to post Share on other sites
kaspar rave 4 Posted November 20, 2018 On 14-11-2018 at 7:34 PM, kmiles1990 said: bump Can something like this be done? override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName) { Entity playerEnt; playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player Class.CastTo(m_player, playerEnt); GetGame().SelectPlayer(identity, m_player); switch(player.GetIdentity().GetPlainId()){ case "76561198109829398": player.SetPosition("3413.27 24 14808.81"); // tisy break; case "xxxxxxxxxxxxxxxxx": player.SetPosition("6106.24 24 7736.40"); //stary sobor break; default: //normal players break; } return m_player; } untested. Share this post Link to post Share on other sites
ChawDinky 7 Posted November 25, 2018 On 11/20/2018 at 4:09 AM, kaspar rave said: override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName) { Entity playerEnt; playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player Class.CastTo(m_player, playerEnt); GetGame().SelectPlayer(identity, m_player); switch(player.GetIdentity().GetPlainId()){ case "76561198109829398": player.SetPosition("3413.27 24 14808.81"); // tisy break; case "xxxxxxxxxxxxxxxxx": player.SetPosition("6106.24 24 7736.40"); //stary sobor break; default: //normal players break; } return m_player; } untested. Any update regarding this? Tested yet? Share this post Link to post Share on other sites
kaspar rave 4 Posted November 27, 2018 I will test it later today. (10:18 am here right now) Share this post Link to post Share on other sites
Dongleberry 0 Posted November 28, 2018 Did anyone test this and get it working? One of the things that would have been on my wishlist from the start was ability to spawn certain characters at certain locations, very handy for server events :) Share this post Link to post Share on other sites
Anomal 13 Posted December 8, 2018 I could use something like this as well! Share this post Link to post Share on other sites