Cleanup vehicle options and enhance player interaction features

- Remove vehicle upgrades menu and replace with vehicle extras toggle
- Vehicle extras now show ON/OFF state and can be toggled per-extra
- Change Flip Vehicle to a toggle that keeps vehicle upright
- Repair Vehicle now also cleans the vehicle
- Move Super Jump from Fun Options to Self Options as a toggle
- Add player submenu in Network Options with Teleport, Heal, Spectate
- Add spectate player functionality with position following
- Add heal player functionality
- Fix teleport to player by properly setting selectedPlayer

https://claude.ai/code/session_01UiW74fDBzxs2RxKoFbaTpY
This commit is contained in:
Claude
2026-01-28 16:48:26 +00:00
parent a786f40773
commit 0b5a7eb08a
2 changed files with 309 additions and 68 deletions

View File

@@ -278,6 +278,78 @@ addNetworkHandler("ModMenu:Fun", function(client, option) {
triggerNetworkEvent("ModMenu:ExecuteFun", client, option);
});
// ============================================================================
// NETWORK HANDLERS - Player Actions
// ============================================================================
addNetworkHandler("ModMenu:HealPlayer", function(client, targetId) {
console.log("[ModMenu] " + client.name + " requesting to heal player ID: " + targetId);
let clients = getClients();
for (let i = 0; i < clients.length; i++) {
if (clients[i].index == targetId) {
console.log("[ModMenu] Found target player: " + clients[i].name);
if (clients[i].player) {
try {
// Tell the target client to heal themselves
triggerNetworkEvent("ModMenu:ExecuteHeal", clients[i]);
triggerNetworkEvent("ModMenu:Notification", client, "Healed: " + clients[i].name);
triggerNetworkEvent("ModMenu:Notification", clients[i], client.name + " healed you!");
console.log("[ModMenu] Heal event sent to " + clients[i].name);
} catch(e) {
console.log("[ModMenu] Error healing player: " + e);
triggerNetworkEvent("ModMenu:Notification", client, "Error healing player!");
}
} else {
triggerNetworkEvent("ModMenu:Notification", client, "Player not spawned!");
}
return;
}
}
triggerNetworkEvent("ModMenu:Notification", client, "Player not found!");
});
addNetworkHandler("ModMenu:SpectatePlayer", function(client, targetId) {
console.log("[ModMenu] " + client.name + " requesting to spectate player ID: " + targetId);
let clients = getClients();
for (let i = 0; i < clients.length; i++) {
if (clients[i].index == targetId) {
console.log("[ModMenu] Found target player: " + clients[i].name);
if (clients[i].player) {
try {
let targetPos = clients[i].player.position;
// Send spectate event to client with target info
triggerNetworkEvent("ModMenu:ExecuteSpectate", client, targetId, clients[i].name, targetPos.x, targetPos.y, targetPos.z);
console.log("[ModMenu] Spectate event sent to " + client.name);
} catch(e) {
console.log("[ModMenu] Error getting spectate info: " + e);
triggerNetworkEvent("ModMenu:Notification", client, "Error spectating player!");
}
} else {
triggerNetworkEvent("ModMenu:Notification", client, "Player not spawned!");
}
return;
}
}
triggerNetworkEvent("ModMenu:Notification", client, "Player not found!");
});
addNetworkHandler("ModMenu:UpdateSpectate", function(client, targetId) {
let clients = getClients();
for (let i = 0; i < clients.length; i++) {
if (clients[i].index == targetId && clients[i].player) {
try {
let targetPos = clients[i].player.position;
triggerNetworkEvent("ModMenu:SpectatePosition", client, targetPos.x, targetPos.y, targetPos.z);
} catch(e) {}
return;
}
}
});
// ============================================================================
// INITIALIZATION
// ============================================================================