PhantomDamn Posted April 4, 2013 Share Posted April 4, 2013 hola quien me puede ayudar con esto.. por que cuando alguien entra a la zona esta parpadea o hace flash y aparece el outputchatbox correctamente diciendo ( espere 10 minutos para tomar esta zona) ... ahora si el player sale de esta zona antes de estos 10 minutos aun sigue parpadeando como si estuviese aun en ella miren si las coordenadas estan bien local pArea = createRadarArea( 340.75918579102, -2098.7058105469, 213, 248, 255, 255, 255, 180 )-- local pCuboid = createColCuboid( 338, -2095, 7.671875, 210, 245, 15 )-- Saludos... Link to comment
PhantomDamn Posted April 4, 2013 Author Share Posted April 4, 2013 addEventHandler("onResourceStart",resourceRoot,function() outputDebugString("Sistema de territorios modificado por Cocodrilo..") end ) function radar ( player ) local playerGang = getElementData ( player, "gang" ) local turfGang = getElementData ( pCuboid, "getTurfGang", true ) if (turfGang == playerGang) then outputChatBox("Este territorio pertenece a "..turfGang, player, 0, 255, 0, false) else if not getPlayerTeam(player) then return end local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then if ( isTimer ( beachturfTimer ) ) then return end local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( pArea, true ) local turfGang = getElementData ( pCuboid, "getTurfGang", true ) if turfGang then outputChatBox("Estas en territorio "..turfGang..". Permanece aqui por 10 minutos para conquistarlo.", player, 0, 255, 0, false) else outputChatBox("Este Territorio aún no pertenece a nadie. Espera 5 minutos para conquistarlo", player, 0, 255, 0, false) end beachturfTimer = setTimer ( function ( ) local beachTurfCplayers = getElementColShape ( pCuboid ) local players = getElementsWithinColShape ( pCuboid, "player" ) setRadarAreaColor ( pArea, tonumber(r), tonumber(g), tonumber(b), 100 ) for _, player in ipairs ( players ) do outputChatBox("Has conquistado este territorio!", player, 0, 255, 0, false) triggerClientEvent("onTakeTurf", player) givePlayerMoney ( player, 50000 ) setElementData ( pCuboid, "getTurfGang", playerGang ) end setRadarAreaFlashing ( pArea, false ) end ,500000, 1 ) end end end end addEventHandler ( "onColShapeHit", pCuboid, radar ) Link to comment
فاّرس Posted April 4, 2013 Share Posted April 4, 2013 Donde : local pArea = createRadarArea( 340.75918579102, -2098.7058105469, 213, 248, 255, 255, 255, 180 )-- local pCuboid = createColCuboid( 338, -2095, 7.671875, 210, 245, 15 )-- En este: addEventHandler("onResourceStart",resourceRoot,function() outputDebugString("Sistema de territorios modificado por Cocodrilo..") end ) function radar ( player ) local playerGang = getElementData ( player, "gang" ) local turfGang = getElementData ( pCuboid, "getTurfGang", true ) if (turfGang == playerGang) then outputChatBox("Este territorio pertenece a "..turfGang, player, 0, 255, 0, false) else if not getPlayerTeam(player) then return end local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then if ( isTimer ( beachturfTimer ) ) then return end local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( pArea, true ) local turfGang = getElementData ( pCuboid, "getTurfGang", true ) if turfGang then outputChatBox("Estas en territorio "..turfGang..". Permanece aqui por 10 minutos para conquistarlo.", player, 0, 255, 0, false) else outputChatBox("Este Territorio aún no pertenece a nadie. Espera 5 minutos para conquistarlo", player, 0, 255, 0, false) end beachturfTimer = setTimer ( function ( ) local beachTurfCplayers = getElementColShape ( pCuboid ) local players = getElementsWithinColShape ( pCuboid, "player" ) setRadarAreaColor ( pArea, tonumber(r), tonumber(g), tonumber(b), 100 ) for _, player in ipairs ( players ) do outputChatBox("Has conquistado este territorio!", player, 0, 255, 0, false) triggerClientEvent("onTakeTurf", player) givePlayerMoney ( player, 50000 ) setElementData ( pCuboid, "getTurfGang", playerGang ) end setRadarAreaFlashing ( pArea, false ) end ,500000, 1 ) end end end end addEventHandler ( "onColShapeHit", pCuboid, radar ) = ?? Link to comment
PhantomDamn Posted April 5, 2013 Author Share Posted April 5, 2013 que me hace falta? Link to comment
PhantomDamn Posted April 5, 2013 Author Share Posted April 5, 2013 entonces entrada= onColShapeHit y salida=onColShapeLeave Gracias Post editado... Zorro me puedes decir por que el numero "2" se repite en toda las zonas setRadarAreaColor (pArea3, iR2, iG2, iB2, 100); = setRadar en zona 3 setRadarAreaColor (pArea4, iR2, iG2, iB2, 100); = setRadar en la zona 4.. y asi en todas Link to comment
PhantomDamn Posted April 6, 2013 Author Share Posted April 6, 2013 disculpen este otro doble post.. miren como puse el evento onColShapeLeave : addEventHandler("onResourceStart",resourceRoot,function() outputDebugString("Sistema de territorios modificado por Cocodrilo..") end ) function radar ( player ) local playerGang = getElementData ( player, "gang" ) local turfGang = getElementData ( pCuboid, "getTurfGang", true ) if (turfGang == playerGang) then outputChatBox("Este territorio pertenece a "..turfGang, player, 0, 255, 0, false) else if not getPlayerTeam(player) then return end local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then if ( isTimer ( beachturfTimer ) ) then return end local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( pArea, true ) local turfGang = getElementData ( pCuboid, "getTurfGang", true ) if turfGang then outputChatBox("Estas en territorio "..turfGang..". Permanece aqui por 10 minutos para conquistarlo.", player, 0, 255, 0, false) else outputChatBox("Este Territorio aún no pertenece a nadie. Espera 10 minutos para conquistarlo", player, 0, 255, 0, false) end beachturfTimer = setTimer ( function ( ) local beachTurfCplayers = getElementColShape ( pCuboid ) local players = getElementsWithinColShape ( pCuboid, "player" ) setRadarAreaColor ( pArea, tonumber(r), tonumber(g), tonumber(b), 100 ) for _, player in ipairs ( players ) do outputChatBox("Has conquistado este territorio!", player, 0, 255, 0, false) triggerClientEvent("onTakeTurf", player) givePlayerMoney ( player, 50000 ) setElementData ( pCuboid, "getTurfGang", playerGang ) end setRadarAreaFlashing ( pArea, false ) end ,5000, 1 ) end end end end addEventHandler ( "onColShapeHit", pCuboid, radar ) addEventHandler( 'onColShapeLeave', root, function( player ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) end end ) Ya hice esto ahora entro a la zona y setRadarAreaFlashing ( pArea, true ) funciona bien, cuando salgo del area el evento onColShapeLeave hace que deje de flashear... pero al retornar al area nuevamente ya no flashea... que puede ser esto? Link to comment
Sasu Posted April 6, 2013 Share Posted April 6, 2013 Intenta esto: addEventHandler("onResourceStart",resourceRoot,function() outputDebugString("Sistema de territorios modificado por Cocodrilo..") end ) function radar ( player ) local playerGang = getElementData ( player, "gang" ) local turfGang = getElementData ( pCuboid, "getTurfGang", true ) if (turfGang == playerGang) then outputChatBox("Este territorio pertenece a "..turfGang, player, 0, 255, 0, false) else if not getPlayerTeam(player) then return end local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then if ( isTimer ( beachturfTimer ) ) then return end local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( pArea, true ) local turfGang = getElementData ( pCuboid, "getTurfGang", true ) if turfGang then outputChatBox("Estas en territorio "..turfGang..". Permanece aqui por 10 minutos para conquistarlo.", player, 0, 255, 0, false) else outputChatBox("Este Territorio aún no pertenece a nadie. Espera 10 minutos para conquistarlo", player, 0, 255, 0, false) end beachturfTimer = setTimer ( function ( ) local beachTurfCplayers = getElementColShape ( pCuboid ) local players = getElementsWithinColShape ( pCuboid, "player" ) setRadarAreaColor ( pArea, tonumber(r), tonumber(g), tonumber(b), 100 ) for _, player in ipairs ( players ) do outputChatBox("Has conquistado este territorio!", player, 0, 255, 0, false) triggerClientEvent("onTakeTurf", player) givePlayerMoney ( player, 50000 ) setElementData ( pCuboid, "getTurfGang", playerGang ) end setRadarAreaFlashing ( pArea, false ) end ,5000, 1 ) end end end end addEventHandler ( "onColShapeHit", pCuboid, radar ) addEventHandler( 'onColShapeLeave', root, function( player ) if( source == pCuboid ) and isTimer(beachturfTimer) then killTimer(beachturfTimer) setRadarAreaFlashing( pArea, false ) end end ) Link to comment
PhantomDamn Posted April 6, 2013 Author Share Posted April 6, 2013 Sasuke I Love You!!!!!!!!!!!!!! eres un duro Link to comment
PhantomDamn Posted April 7, 2013 Author Share Posted April 7, 2013 @sasuke me podrias traducir esto... ERROR unzipped/truf/serverTurf.lua:2189: attemt to concatenate local 'turfGangs' (a boolean value) y este otro ERROR: unzipped/serveerturf.lua:1179 bad argument # 1 to 'unpack' ( table expected, not nil) creo que me falta mucho por aprender un simple error de estos me deja hecho nada Gracias Link to comment
Recommended Posts