How do I use OnPlayerRespawned
or
OnFindSpawnPoint
to set the players spawn point to a set of coordinates (x,y,z) when they re-spawn?
Currently I have
but I get errorCode:void OnPlayerRespawned(BasePlayer player) { string kos = "Think you've been killed on sight, and there is no purge? Contact an admin."; string tradezone = "You've been respawned at the Trade Zone. This is a safe, non-pvp area."; SendReply(player, "RUST RP", kos); SendReply(player, "RUST RP", tradezone); rust.ForcePlayerPosition(player, 1400, 6, -1882); }
[Oxide] 7:29 PM [Error] TestPlugin plugin failed to compile!
[Oxide] 7:29 PM [Error] TestPlugin.cs(24,13): error CS1501: No overload for method `ForcePlayerPosition' takes `4' arguments
Also, how do I define which zone with OnEntityEnter ? so when they enter rad town it says 'blah blah' ?
thanks
Spawn points
Discussion in 'Rust Development' started by Captain. Knee Gell, Aug 2, 2015.
-
use
Code:player.ClientRPCPlayer(null, player, "ForcePositionTo", new object[] { 1400, 6, -1882 }); -
Cheers!
[DOUBLEPOST=1438547173][/DOUBLEPOST]This doesn't seem to work.
Code:using Oxide.Core;namespace Oxide.Plugins { [Info("Purge", "Matthew Lang", 0.1, ResourceId = 0)] [Description("Adds a Purge element into the game.")] class TestPlugin : RustPlugin { void Init() { Puts("Purge Plugin has loaded."); } void Unload() { Puts("Purge Plugin has been unloaded."); } void OnPlayerRespawned(BasePlayer player) { string kos = "<color=orange><b><i>RUST:RP</i></b></color> Think you've been killed on sight, and there is no purge? Contact an admin."; string tradezone = "You've been respawned at the Trade Zone. This is a safe, non-pvp area."; SendReply(player, kos); SendReply(player, tradezone); player.ClientRPCPlayer(null, player, "ForcePositionTo", new object[] { 1400, 6, -1882 }); } string purge = "Raiding and killing on sight is not allowed, unless there is a purge, which happens every Wed/Sat/Fri."; void OnPlayerChat(ConsoleSystem.Arg arg) { string message = arg.GetString(0, "text"); BasePlayer player = (BasePlayer) arg.connection.player; if (message.Contains("purge")) { PrintToChat(player, purge); } } [ChatCommand("purge")] void cmdPurge(BasePlayer player, string command, string[] args) { SendReply(player, purge); } } }
