depato123 Posted May 27, 2013 Share Posted May 27, 2013 1º ¿Hay alguna manera de remplazar el "teamsay" por otro nombre que diga "Radio"? por favor denmen ejemplos estoy buscando desde hace mucho hacer este resource. me dijeron que era muy complicado por eso no me anime a hacerlo 2º crossMissionStartMarker = createMarker (-2515.83,2353.17,3.98,"cylinder",1.5,0,255,255) addEventHandler ("onMarkerHit", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Prueba de manejo.", player, 127, 0, 255, false) outputChatBox (" Bienvenido a la prueba de manejo", player, 255, 255, 255, false) outputChatBox (" Por 100$ podras acceder a un circuito de prueba", player, 255, 255, 255, false) outputChatBox (" Podras ganar 500$ como ayuda para tu auto si pasas la prueba", player, 255, 255, 255, false) outputChatBox (" Para comenzar di /startprueba", player, 255, 255, 255, false) end end) addEventHandler ("onMarkerLeave", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Te has ido de la prueba.", player, 127, 0, 255, false) end end) addCommandHandler ("startprueba", function(player, command) if (isElementWithinMarker (player, crossMissionStartMarker)) and (getPlayerMoney (player) >= 500) then takePlayerMoney (player, 500) outputChatBox ("Mission started!", player, 255, 0, 0, false) local missionVehicle = createVehicle(410, -2506.69, 2347.30, 4.69, 0, 0, 180) setElementInterior (missionVehicle, 0) setElementDimension (missionVehicle, 10) setElementInterior (player, 0) setElementDimension (player, 10) warpPedIntoVehicle (player, missionVehicle) showPlayerHudComponent (player, "ammo", false) showPlayerHudComponent (player, "area_name", false) showPlayerHudComponent (player, "armour", false) showPlayerHudComponent (player, "breath", false) showPlayerHudComponent (player, "clock", false) showPlayerHudComponent (player, "health", false) showPlayerHudComponent (player, "money", false) showPlayerHudComponent (player, "radar", false) showPlayerHudComponent (player, "vehicle_name", false) showPlayerHudComponent (player, "weapon", false) setTimer (onEndMission, 120000, 1, player, getPedOccupiedVehicle (player)) end end) function onEndMission (player, vehicle) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (vehicle) == 410) then destroyElement (vehicle) showPlayerHudComponent (player, "ammo", true) showPlayerHudComponent (player, "area_name", true) showPlayerHudComponent (player, "armour", true) showPlayerHudComponent (player, "breath", true) showPlayerHudComponent (player, "clock", true) showPlayerHudComponent (player, "health", true) showPlayerHudComponent (player, "money", true) showPlayerHudComponent (player, "radar", true) showPlayerHudComponent (player, "vehicle_name", true) showPlayerHudComponent (player, "weapon", true) setElementDimension (player, 0) setTimer (setElementInterior, 500, 1, player, 0) setTimer (setElementPosition, 1500, 1, player, -2515.75,2356.14,4.98) setTimer (setPedRotation, 0, 1, player, 0) outputChatBox ("La prueba ha terminado", player, 255, 0, 0, false) end end addEventHandler ("onVehicleExit", getRootElement(), function(player, seat, jacked) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (source) == 410) then setTimer (warpPedIntoVehicle, 500, 1, player, source) outputChatBox ("Oops! you fall off!", player, 255, 0, 0, false) end end) addEventHandler ("onMarkerHit", getRootElement(), function(hitElement, matchingDimension) if (getElementType (hitElement) == "player") and (matchingDimension == true) and (getElementDimension (hitElement) == 10) and (getElementInterior (hitElement) == 0) and (getElementDimension (hitElement) == 10) then givePlayerMoney (hitElement, 100) playSoundFrontEnd (hitElement, 43) local x,y,z = getElementPosition (source) setTimer (createNewStuntMarker, 20000, 1, x,y,z) destroyElement(source) end end) function createNewStuntMarker(x,y,z) local coolMarker = createMarker (x,y,z,"corona",0.5,101,0,254,255,getRootElement()) setElementInterior (coolMarker, 0) setElementDimension (coolMarker, 10) end addEventHandler ("onPlayerQuit", getRootElement(), function() if (getElementDimension (source) == 10) then setElementInterior (player, 0) setElementPosition (player, -2515.75,2356.14,4.98) end end) ¿Hay alguna manera de evitar que los usuarios que tengan otro skin que no sea el 25 no puedan hacer la prueba que esta en el .lua? PD: me di cuenta que lo postie mal Link to comment
BorderLine Posted May 27, 2013 Share Posted May 27, 2013 1: function sendMessageToTeamPlayers ( message, messageType ) if ( messageType == 2 ) then team = getPlayerTeam(source) if (team) then r, g, b = getTeamColor( team ) end local tplayers = getPlayersInTeam ( team ) for index, tplayers in ipairs( tplayers ) do outputChatBox( "[RADIO]"..getPlayerName ( source )..":#ffffff ".. message, tplayers, r, g, b, true ) end cancelEvent ( ) end end addEventHandler ( "onPlayerChat", getRootElement(), sendMessageToTeamPlayers ) 2: if getElementModel(source) ~= 25 then.... Link to comment
depato123 Posted May 28, 2013 Author Share Posted May 28, 2013 2: if getElementModel(source) ~= 25 then.... No me funciona eso ¿en que linea lo pondría? Link to comment
Renkon Posted May 28, 2013 Share Posted May 28, 2013 Piensa tú en qué linea deberías ponerlo con el fin de que te funcione. Tu te esfuerzas y nosotros te ayudamos. Nosotros no lo hacemos por tí. Saludos Link to comment
FraN-724 Posted May 28, 2013 Share Posted May 28, 2013 (edited) Intenta esto crossMissionStartMarker = createMarker (-2515.83,2353.17,3.98,"cylinder",1.5,0,255,255) addEventHandler ("onMarkerHit", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then if ( getElementModel ( source) == 25 ) then outputChatBox ("Prueba de manejo.", player, 127, 0, 255, false) outputChatBox (" Bienvenido a la prueba de manejo", player, 255, 255, 255, false) outputChatBox (" Por 100$ podras acceder a un circuito de prueba", player, 255, 255, 255, false) outputChatBox (" Podras ganar 500$ como ayuda para tu auto si pasas la prueba", player, 255, 255, 255, false) outputChatBox (" Para comenzar di /startprueba", player, 255, 255, 255, false) else outputChatBox ("No tienes el skin 25 para hacer esta mision", player, 255, 0, 0, true) end end end) addEventHandler ("onMarkerLeave", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Te has ido de la prueba.", player, 127, 0, 255, false) end end) addCommandHandler ("startprueba", function(player, command) if (isElementWithinMarker (player, crossMissionStartMarker)) and (getPlayerMoney (player) >= 500) then takePlayerMoney (player, 500) outputChatBox ("Mission started!", player, 255, 0, 0, false) local missionVehicle = createVehicle(410, -2506.69, 2347.30, 4.69, 0, 0, 180) setElementInterior (missionVehicle, 0) setElementDimension (missionVehicle, 10) setElementInterior (player, 0) setElementDimension (player, 10) warpPedIntoVehicle (player, missionVehicle) showPlayerHudComponent (player, "ammo", false) showPlayerHudComponent (player, "area_name", false) showPlayerHudComponent (player, "armour", false) showPlayerHudComponent (player, "breath", false) showPlayerHudComponent (player, "clock", false) showPlayerHudComponent (player, "health", false) showPlayerHudComponent (player, "money", false) showPlayerHudComponent (player, "radar", false) showPlayerHudComponent (player, "vehicle_name", false) showPlayerHudComponent (player, "weapon", false) setTimer (onEndMission, 120000, 1, player, getPedOccupiedVehicle (player)) end end) function onEndMission (player, vehicle) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (vehicle) == 410) then destroyElement (vehicle) showPlayerHudComponent (player, "ammo", true) showPlayerHudComponent (player, "area_name", true) showPlayerHudComponent (player, "armour", true) showPlayerHudComponent (player, "breath", true) showPlayerHudComponent (player, "clock", true) showPlayerHudComponent (player, "health", true) showPlayerHudComponent (player, "money", true) showPlayerHudComponent (player, "radar", true) showPlayerHudComponent (player, "vehicle_name", true) showPlayerHudComponent (player, "weapon", true) setElementDimension (player, 0) setTimer (setElementInterior, 500, 1, player, 0) setTimer (setElementPosition, 1500, 1, player, -2515.75,2356.14,4.98) setTimer (setPedRotation, 0, 1, player, 0) outputChatBox ("La prueba ha terminado", player, 255, 0, 0, false) end end addEventHandler ("onVehicleExit", getRootElement(), function(player, seat, jacked) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (source) == 410) then setTimer (warpPedIntoVehicle, 500, 1, player, source) outputChatBox ("Oops! you fall off!", player, 255, 0, 0, false) end end) addEventHandler ("onMarkerHit", getRootElement(), function(hitElement, matchingDimension) if (getElementType (hitElement) == "player") and (matchingDimension == true) and (getElementDimension (hitElement) == 10) and (getElementInterior (hitElement) == 0) and (getElementDimension (hitElement) == 10) then givePlayerMoney (hitElement, 100) playSoundFrontEnd (hitElement, 43) local x,y,z = getElementPosition (source) setTimer (createNewStuntMarker, 20000, 1, x,y,z) destroyElement(source) end end) function createNewStuntMarker(x,y,z) local coolMarker = createMarker (x,y,z,"corona",0.5,101,0,254,255,getRootElement()) setElementInterior (coolMarker, 0) setElementDimension (coolMarker, 10) end addEventHandler ("onPlayerQuit", getRootElement(), function() if (getElementDimension (source) == 10) then setElementInterior (player, 0) setElementPosition (player, -2515.75,2356.14,4.98) end end) Edited May 28, 2013 by Guest Link to comment
depato123 Posted May 28, 2013 Author Share Posted May 28, 2013 Piensa tú en qué linea deberías ponerlo con el fin de que te funcione.Tu te esfuerzas y nosotros te ayudamos. Nosotros no lo hacemos por tí. Saludos Le sacas el animo de hacer algo a cualquier persona. En fin, lo intente poner entre la linea 5 y 6, 7 y 9 pero no funcionan en ninguno de las 2 Link to comment
Renkon Posted May 28, 2013 Share Posted May 28, 2013 Piensa tú en qué linea deberías ponerlo con el fin de que te funcione.Tu te esfuerzas y nosotros te ayudamos. Nosotros no lo hacemos por tí. Saludos Le sacas el animo de hacer algo a cualquier persona. En fin, lo intente poner entre la linea 5 y 6, 7 y 9 pero no funcionan en ninguno de las 2 Hombre! No es sacar ánimo. Es enseñarte a como trabajar y no querer recibir todo servido. Si quieres ser exitoso tendrás que sacrificarte. Tu debes de intentar e intentar, y SOLO si no puedes hacerlo, solicitar ayuda. Link to comment
FraN-724 Posted May 28, 2013 Share Posted May 28, 2013 Yo creo que esta bien lo que dice Renkon porque no haces ni el mínimo esfuerzo de hacer el script solo, no aprenderás nunca así si te seguimos ayudando ni nada, intenta ver sólito como funcionan las cosas e ir probando funciones etc. Link to comment
BorderLine Posted May 28, 2013 Share Posted May 28, 2013 Intenta esto crossMissionStartMarker = createMarker (-2515.83,2353.17,3.98,"cylinder",1.5,0,255,255) addEventHandler ("onMarkerHit", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then if ( getElementModel ( source ) == 25 ) then outputChatBox ("Prueba de manejo.", player, 127, 0, 255, false) outputChatBox (" Bienvenido a la prueba de manejo", player, 255, 255, 255, false) outputChatBox (" Por 100$ podras acceder a un circuito de prueba", player, 255, 255, 255, false) outputChatBox (" Podras ganar 500$ como ayuda para tu auto si pasas la prueba", player, 255, 255, 255, false) outputChatBox (" Para comenzar di /startprueba", player, 255, 255, 255, false) else outputChatBox ("No tienes el skin 25 para hacer esta mision", player, 255, 0, 0, true) end end end) addEventHandler ("onMarkerLeave", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Te has ido de la prueba.", player, 127, 0, 255, false) end end) addCommandHandler ("startprueba", function(player, command) if (isElementWithinMarker (player, crossMissionStartMarker)) and (getPlayerMoney (player) >= 500) then takePlayerMoney (player, 500) outputChatBox ("Mission started!", player, 255, 0, 0, false) local missionVehicle = createVehicle(410, -2506.69, 2347.30, 4.69, 0, 0, 180) setElementInterior (missionVehicle, 0) setElementDimension (missionVehicle, 10) setElementInterior (player, 0) setElementDimension (player, 10) warpPedIntoVehicle (player, missionVehicle) showPlayerHudComponent (player, "ammo", false) showPlayerHudComponent (player, "area_name", false) showPlayerHudComponent (player, "armour", false) showPlayerHudComponent (player, "breath", false) showPlayerHudComponent (player, "clock", false) showPlayerHudComponent (player, "health", false) showPlayerHudComponent (player, "money", false) showPlayerHudComponent (player, "radar", false) showPlayerHudComponent (player, "vehicle_name", false) showPlayerHudComponent (player, "weapon", false) setTimer (onEndMission, 120000, 1, player, getPedOccupiedVehicle (player)) end end) function onEndMission (player, vehicle) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (vehicle) == 410) then destroyElement (vehicle) showPlayerHudComponent (player, "ammo", true) showPlayerHudComponent (player, "area_name", true) showPlayerHudComponent (player, "armour", true) showPlayerHudComponent (player, "breath", true) showPlayerHudComponent (player, "clock", true) showPlayerHudComponent (player, "health", true) showPlayerHudComponent (player, "money", true) showPlayerHudComponent (player, "radar", true) showPlayerHudComponent (player, "vehicle_name", true) showPlayerHudComponent (player, "weapon", true) setElementDimension (player, 0) setTimer (setElementInterior, 500, 1, player, 0) setTimer (setElementPosition, 1500, 1, player, -2515.75,2356.14,4.98) setTimer (setPedRotation, 0, 1, player, 0) outputChatBox ("La prueba ha terminado", player, 255, 0, 0, false) end end addEventHandler ("onVehicleExit", getRootElement(), function(player, seat, jacked) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (source) == 410) then setTimer (warpPedIntoVehicle, 500, 1, player, source) outputChatBox ("Oops! you fall off!", player, 255, 0, 0, false) end end) addEventHandler ("onMarkerHit", getRootElement(), function(hitElement, matchingDimension) if (getElementType (hitElement) == "player") and (matchingDimension == true) and (getElementDimension (hitElement) == 10) and (getElementInterior (hitElement) == 0) and (getElementDimension (hitElement) == 10) then givePlayerMoney (hitElement, 100) playSoundFrontEnd (hitElement, 43) local x,y,z = getElementPosition (source) setTimer (createNewStuntMarker, 20000, 1, x,y,z) destroyElement(source) end end) function createNewStuntMarker(x,y,z) local coolMarker = createMarker (x,y,z,"corona",0.5,101,0,254,255,getRootElement()) setElementInterior (coolMarker, 0) setElementDimension (coolMarker, 10) end addEventHandler ("onPlayerQuit", getRootElement(), function() if (getElementDimension (source) == 10) then setElementInterior (player, 0) setElementPosition (player, -2515.75,2356.14,4.98) end end) Arregla, Pusiste getElementModel (Source) y es (player) depato, lo que dice Renkon es cierto, nadie quiere hecharte abajo los animos, pon de tu parte tambien, ya te di un codigo completo para que salga RADIO en vez de team, no aremos todo por ti, Pon de tu parte Link to comment
FraN-724 Posted May 28, 2013 Share Posted May 28, 2013 Dale, es que segui tu ejemplo Yakuza y no me di cuenta, ahora si crossMissionStartMarker = createMarker (-2515.83,2353.17,3.98,"cylinder",1.5,0,255,255) addEventHandler ("onMarkerHit", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then if ( getElementModel ( player ) == 25 ) then outputChatBox ("Prueba de manejo.", player, 127, 0, 255, false) outputChatBox (" Bienvenido a la prueba de manejo", player, 255, 255, 255, false) outputChatBox (" Por 100$ podras acceder a un circuito de prueba", player, 255, 255, 255, false) outputChatBox (" Podras ganar 500$ como ayuda para tu auto si pasas la prueba", player, 255, 255, 255, false) outputChatBox (" Para comenzar di /startprueba", player, 255, 255, 255, false) else outputChatBox ("No tienes el skin 25 para hacer esta mision", player, 255, 0, 0, true) end end end) addEventHandler ("onMarkerLeave", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Te has ido de la prueba.", player, 127, 0, 255, false) end end) addCommandHandler ("startprueba", function(player, command) if (isElementWithinMarker (player, crossMissionStartMarker)) and (getPlayerMoney (player) >= 500) then takePlayerMoney (player, 500) outputChatBox ("Mission started!", player, 255, 0, 0, false) local missionVehicle = createVehicle(410, -2506.69, 2347.30, 4.69, 0, 0, 180) setElementInterior (missionVehicle, 0) setElementDimension (missionVehicle, 10) setElementInterior (player, 0) setElementDimension (player, 10) warpPedIntoVehicle (player, missionVehicle) showPlayerHudComponent (player, "ammo", false) showPlayerHudComponent (player, "area_name", false) showPlayerHudComponent (player, "armour", false) showPlayerHudComponent (player, "breath", false) showPlayerHudComponent (player, "clock", false) showPlayerHudComponent (player, "health", false) showPlayerHudComponent (player, "money", false) showPlayerHudComponent (player, "radar", false) showPlayerHudComponent (player, "vehicle_name", false) showPlayerHudComponent (player, "weapon", false) setTimer (onEndMission, 120000, 1, player, getPedOccupiedVehicle (player)) end end) function onEndMission (player, vehicle) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (vehicle) == 410) then destroyElement (vehicle) showPlayerHudComponent (player, "ammo", true) showPlayerHudComponent (player, "area_name", true) showPlayerHudComponent (player, "armour", true) showPlayerHudComponent (player, "breath", true) showPlayerHudComponent (player, "clock", true) showPlayerHudComponent (player, "health", true) showPlayerHudComponent (player, "money", true) showPlayerHudComponent (player, "radar", true) showPlayerHudComponent (player, "vehicle_name", true) showPlayerHudComponent (player, "weapon", true) setElementDimension (player, 0) setTimer (setElementInterior, 500, 1, player, 0) setTimer (setElementPosition, 1500, 1, player, -2515.75,2356.14,4.98) setTimer (setPedRotation, 0, 1, player, 0) outputChatBox ("La prueba ha terminado", player, 255, 0, 0, false) end end addEventHandler ("onVehicleExit", getRootElement(), function(player, seat, jacked) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (source) == 410) then setTimer (warpPedIntoVehicle, 500, 1, player, source) outputChatBox ("Oops! you fall off!", player, 255, 0, 0, false) end end) addEventHandler ("onMarkerHit", getRootElement(), function(hitElement, matchingDimension) if (getElementType (hitElement) == "player") and (matchingDimension == true) and (getElementDimension (hitElement) == 10) and (getElementInterior (hitElement) == 0) and (getElementDimension (hitElement) == 10) then givePlayerMoney (hitElement, 100) playSoundFrontEnd (hitElement, 43) local x,y,z = getElementPosition (source) setTimer (createNewStuntMarker, 20000, 1, x,y,z) destroyElement(source) end end) function createNewStuntMarker(x,y,z) local coolMarker = createMarker (x,y,z,"corona",0.5,101,0,254,255,getRootElement()) setElementInterior (coolMarker, 0) setElementDimension (coolMarker, 10) end addEventHandler ("onPlayerQuit", getRootElement(), function() if (getElementDimension (source) == 10) then setElementInterior (player, 0) setElementPosition (player, -2515.75,2356.14,4.98) end end) Link to comment
Recommended Posts