mirror of
https://github.com/iDisaster/GTAConnected.git
synced 2026-03-09 01:45:22 +00:00
Fix network player list and enhance Red/Black UI theme
- Fix network player list serialization by using pipe-separated strings instead of arrays (fixes "Failed to read network arguments" error) - Enhanced phone blocking with multiple native calls - Redesign UI with deep black background and pulsing red accents
This commit is contained in:
@@ -160,27 +160,27 @@ addNetworkHandler("ModMenu:TeleportToPlayer", function(client, targetId) {
|
||||
|
||||
addNetworkHandler("ModMenu:GetPlayers", function(client) {
|
||||
let clients = getClients();
|
||||
let playerList = [];
|
||||
let playerNames = "";
|
||||
let playerIds = "";
|
||||
|
||||
console.log("[ModMenu] Getting players, found " + clients.length + " clients");
|
||||
|
||||
for (let i = 0; i < clients.length; i++) {
|
||||
let c = clients[i];
|
||||
// Skip the requesting player (optional - include self for testing)
|
||||
// if (c.index === client.index) continue;
|
||||
|
||||
// Only add players with valid data
|
||||
if (c && c.name) {
|
||||
playerList.push({
|
||||
id: c.index,
|
||||
name: c.name || ("Player " + c.index)
|
||||
});
|
||||
if (playerNames.length > 0) {
|
||||
playerNames += "|";
|
||||
playerIds += "|";
|
||||
}
|
||||
playerNames += c.name;
|
||||
playerIds += c.index;
|
||||
console.log("[ModMenu] Added player: " + c.name + " (ID: " + c.index + ")");
|
||||
}
|
||||
}
|
||||
|
||||
console.log("[ModMenu] Sending " + playerList.length + " players to " + client.name);
|
||||
triggerNetworkEvent("ModMenu:PlayerList", client, playerList);
|
||||
console.log("[ModMenu] Sending players to " + client.name + ": " + playerNames);
|
||||
// Send as separate strings instead of array
|
||||
triggerNetworkEvent("ModMenu:PlayerList", client, playerNames, playerIds);
|
||||
});
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user