Serginix Posted August 8, 2011 Posted August 8, 2011 Hola gente, estaba tratando de hacer un chat, para la gente q este en X Vehiculo, pero la verdad quede trabado, y no me da, quiero decir, se habre el chat, a el jugador q manda el mensaje, pero solo el... me pueden ayudar?... habia hecho esto, los Binds estan por aparte function onChat(player,_,...) local msg = table.concat({...}, " ") local nick = getPlayerName(player) local r,g,b = getTeamColor(getPlayerTeam(player)) local gente = getVehicleOccupant (player) for _,v in ipairs(getElementsByType("player")) do if isPedInVehicle (player) then outputChatBox("#FF00FF(VV)"..nick..": #FF0000"..msg.." *", player, r, g, b, true) -- intente con "gente" y con "_" pero nada.... else outputChatBox("Nesesitas estar en un Vehiculo para usar el Vehicle Chat", player, 255, 0, 0) end end end addCommandHandler("vv",onChat) La otra cosa, esq el mensaje q mandas, se habre 4 Veces en el chat.... haciendo un terrible Spam q dice lo mismo "Proyecto SX" Owner
Castillo Posted August 8, 2011 Posted August 8, 2011 Aver si te entiendo, este script tiene que enviar los menajes que el jugador X a todos los ocupantes del vehiculo que el jugador X este? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Serginix Posted August 8, 2011 Author Posted August 8, 2011 no exactamente Castillo. digamos, tenemos X Vehiculo, en el Vehiculo tenemos 3 Jugadores... todo Ok? Los jugadores del Vehiculo quieren hablar entre si, sin q nadie los vea, entonces usas el comando /vv y el mensaje q envia, solo se les vea a esos 3 Jugadores q estan ADENTRO del X Vehiculo. no se si me exprese bien "Proyecto SX" Owner
Castillo Posted August 8, 2011 Posted August 8, 2011 Eso es lo que yo dije, no? Proba con esto: function onChat(player,_,...) local msg = table.concat({...}, " ") local nick = getPlayerName(player) local r,g,b = getPlayerNametagColor(player) local vehicle = getPedOccupiedVehicle(player) local occupants = getVehicleOccupants(vehicle) local seats = getVehicleMaxPassengers(vehicle) if isPedInVehicle (player) then for seat = 0, seats do local occupant = occupants[seat] if occupant and getElementType(occupant)=="player" then outputChatBox("#FF00FF(VV)"..tostring(nick)..": #FF0000"..tostring(msg).." *", occupant, r, g, b, true) end end else outputChatBox("Nesesitas estar en un Vehiculo para usar el Vehicle Chat", player, 255, 0, 0) end end addCommandHandler("vv",onChat) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Serginix Posted August 8, 2011 Author Posted August 8, 2011 Pzzz, entonces lo q yo dije es mas bien lo q vos dijiste en otras palabras xDDDD Y si funciono de JOya, gracias men, como siempre, eres la Hostia ! "Proyecto SX" Owner
Castillo Posted August 8, 2011 Posted August 8, 2011 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts