Julian09123 Posted September 24, 2016 Share Posted September 24, 2016 Hola quisiera saber como hacer para que a todos les salga el mensaje de Has joined blabla function joinHomeTeam() guiSetVisible(Window, false) showCursor(false) -- Window closed localPlayer = getLocalPlayer() local PlayerName = getPlayerName(getLocalPlayer()) triggerServerEvent("joinHomeTeam", getRootElement(), localPlayer) outputChatBox ( PlayerName.. " #00ff00Has Joined to " .. homeName .. "" ,255, 255, 255, true ) end function joinEnemyTeam() guiSetVisible(Window, false) showCursor(false) -- Window closed localPlayer = getLocalPlayer() local PlayerName = getPlayerName(getLocalPlayer()) triggerServerEvent("joinEnemyTeam", getRootElement(), localPlayer) outputChatBox ( PlayerName.. " #00ff00Has Joined to " .. enemyName .. "" ,255, 255, 255, true ) end function joinSpectatorsTeam() guiSetVisible(Window, false) showCursor(false) -- Window closed localPlayer = getLocalPlayer() local PlayerName = getPlayerName(getLocalPlayer()) triggerServerEvent("joinSpectatorsTeam", getRootElement(), localPlayer) outputChatBox ( PlayerName.. " #00ff00Has Joined to Spectators" ,255, 255, 255, true ) end Como hago para que les salga a todos? por que me sale a mi solo y a los otros a ellos nomas Link to comment
Tomas Posted September 24, 2016 Share Posted September 24, 2016 -- server side addEvent("outputall", true) addEventHandler("outputall", root, function (msg) outputChatBox(msg, root, 255, 255, 255, true) end ) Y en vez de usar outputChatBox(blabla) usas esto: triggerServerEvent("outputall", root, PlayerName.. " #00ff00Has Joined to Spectators) Link to comment
Julian09123 Posted September 25, 2016 Author Share Posted September 25, 2016 Hice eso pero el Home y enemy me salen dos veces y el spectators una vez function joinHomeTeam() guiSetVisible(Window, false) showCursor(false) -- Window closed localPlayer = getLocalPlayer() local PlayerName = getPlayerName(getLocalPlayer()) triggerServerEvent("joinHomeTeam", getRootElement(), localPlayer) triggerServerEvent("outputall2", root, PlayerName.. " #00ff00Has Joined to " ..homeName) end function joinEnemyTeam() guiSetVisible(Window, false) showCursor(false) -- Window closed localPlayer = getLocalPlayer() local PlayerName = getPlayerName(getLocalPlayer()) triggerServerEvent("joinEnemyTeam", getRootElement(), localPlayer) triggerServerEvent("outputall3", root, PlayerName.. " #00ff00Has Joined to " ..enemyName) end function joinSpectatorsTeam() guiSetVisible(Window, false) showCursor(false) -- Window closed localPlayer = getLocalPlayer() local PlayerName = getPlayerName(getLocalPlayer()) triggerServerEvent("joinSpectatorsTeam", getRootElement(), localPlayer) triggerServerEvent("outputall", root, PlayerName.. " #00ff00Has Joined to Spectators") end addEvent("outputall", true) addEventHandler("outputall", root, function (msg) outputChatBox(msg, root, 255, 255, 255, true) end ) addEvent("outputall2", true) addEventHandler("outputall2", root, function (msg2) outputChatBox(msg2, root, 255, 255, 255, true) end ) addEvent("outputall3", true) addEventHandler("outputall2", root, function (msg3) outputChatBox(msg3, root, 255, 255, 255, true) end ) Listo, me habia equivocado en una linea! Graciasss Tomas! Link to comment
Tomas Posted September 25, 2016 Share Posted September 25, 2016 No es necesario que crees un evento para cada uno, usa el mismo. Link to comment
Julian09123 Posted September 25, 2016 Author Share Posted September 25, 2016 Listo, Gracias!! Link to comment
Recommended Posts