Could anyone help me with modifying my server teleport code so that players using the "sm_donatorroom" command must be standing within a func_respawnroom brush in-order for the teleport to take place? & if they arent standing in one, they have a message relayed to them telling them they cannot use the command in that location.
PHP Code:
#include <sourcemod>
#include <sdktools>
new Float:g_SpawnCoordBlue[3] = {384.0, -192.0, 52.0};
new Float:g_SpawnCoordRed[3] = {384.0, 192.0, 52.0};
new Float:g_SkyboxCoord[3] = {736.0, 3296.0, 1844.0};
new Float:g_PortalRoomCoord[3] = {-3904.0, 0.0, -172.0};
new Float:g_DonatorRoomCoord[3] = {1376.0, 2304.0, 4436.0};
new Float:g_DoomRoomCoord[3] = {176.0, 0.0, 292.0};
public OnPluginStart() {
RegAdminCmd("sm_spawn", Command_GotoSpawn, ADMFLAG_GENERIC);
RegAdminCmd("sm_skybox", Command_GotoSkybox, ADMFLAG_GENERIC);
RegAdminCmd("sm_portalroom", Command_GotoPortalRoom, ADMFLAG_GENERIC);
RegAdminCmd("sm_donatorroom", Command_GotoDonatorRoom, ADMFLAG_GENERIC);
RegAdminCmd("sm_doomroom", Command_GotoDoomRoom, ADMFLAG_ROOT);
}
public Action:Command_GotoSpawn(client, args) {
if (!IsPlayerAlive(client)) {
ReplyToCommand(client, "[SM] You must be alive to use this command.");
return Plugin_Handled;
}
if (GetClientTeam(client) == 2) {
TeleportEntity(client, g_SpawnCoordRed, NULL_VECTOR, NULL_VECTOR);
} else if (GetClientTeam(client) == 3) {
TeleportEntity(client, g_SpawnCoordBlue, NULL_VECTOR, NULL_VECTOR);
}
return Plugin_Handled;
}
public Action:Command_GotoSkybox(client, args) {
if (!IsPlayerAlive(client)) {
ReplyToCommand(client, "[SM] You must be alive to use this command.");
return Plugin_Handled;
}
TeleportEntity(client, g_SkyboxCoord, NULL_VECTOR, NULL_VECTOR);
return Plugin_Handled;
}
public Action:Command_GotoPortalRoom(client, args) {
if (!IsPlayerAlive(client)) {
ReplyToCommand(client, "[SM] You must be alive to use this command.");
return Plugin_Handled;
}
TeleportEntity(client, g_PortalRoomCoord, NULL_VECTOR, NULL_VECTOR);
return Plugin_Handled;
}
public Action:Command_GotoDonatorRoom(client, args) {
if (!IsPlayerAlive(client)) {
ReplyToCommand(client, "[SM] You must be alive to use this command.");
return Plugin_Handled;
}
TeleportEntity(client, g_DonatorRoomCoord, NULL_VECTOR, NULL_VECTOR);
return Plugin_Handled;
}
public Action:Command_GotoDoomRoom(client, args) {
if (!IsPlayerAlive(client)) {
ReplyToCommand(client, "[SM] You must be alive to use this command.");
return Plugin_Handled;
}
TeleportEntity(client, g_DoomRoomCoord, NULL_VECTOR, NULL_VECTOR);
return Plugin_Handled;
}
__________________