molinaa1 Posted June 9, 2014 Share Posted June 9, 2014 Hola:3 Necesitaria un favoraso urgente! Necesito que en este script function onJoin() local cuenta = getAccountName(getPlayerAccount(source)) local check = executeSQLQuery("SELECT * FROM GangMembers where MemberAccount = '" .. cuenta .. "'") if not ( type( check ) == "table" and #check == 0 ) or not check then name = check[1]["GangName"] setElementData(source,"Gang",tostring(name)) executeSQLUpdate("GangMembers", "MemberName = '".. getPlayerName(source) .."'", "MemberAccount = '"..cuenta.."'") local info = executeSQLQuery("SELECT * FROM GangMembers where MemberAccount = '" ..cuenta.. "'") local ce = info[1]["SubLider"] local ca = info[1]["GangAliada"] if tostring(ce) == "Si" then setElementData (source,"gangSubLeader","yes") else setElementData (source,"gangSubLeader","no") end if tostring(ca) ~= "" then setElementData (source,"GangAliada", ca) else setElementData (source,"GangAliada","") end else setElementData(source,"Gang","") setElementData(source,"gangLeader","no") setElementData(source,"gangSubLeader","no") end local check2 = executeSQLQuery("SELECT * FROM Gangs where LeaderAccount = '" .. cuenta .. "'") if not ( type( check2 ) == "table" and #check2 == 0 ) or not check2 then setElementData(source,"gangLeader","yes") name = check[1]["GangName"] executeSQLUpdate("GangMembers", "MemberName = '".. getPlayerName(source) .."'", "MemberAccount = '"..cuenta.."'") executeSQLUpdate("Gangs", "LeaderName = '"..getPlayerName(source).."'", "GangName = '".. name .."'") else setElementData(source,"gangLeader","no") end end addEventHandler("onPlayerLogin",getRootElement(),onJoin) addEventHandler ("onPlayerQuit", root, function () local mygang = getElementData(source,"Gang") if mygang ~= "" then local cuenta = getAccountName(getPlayerAccount(source)) executeSQLUpdate("GangMembers", "MemberLast = 'D: "..day.."/M: "..(mes+1).."'", "MemberAccount = '"..tostring(cuenta).."'") local mk = getElementData (source,"GangMarker") local mark = getElementData (source,"SXGangMarking") if mark and isElement(mark) then destroyElement (getElementData (mark,"GangBlip")) destroyElement (mark) end if mk and isElement(mk) then destroyElement (getElementData (mk,"GangBlip")) destroyElement (mk) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,getPlayerName(source).." Ha Destruido los Puntos de Interes.",150, 35, 150) end end end if getElementData (source, "gangLeader") == "yes" then executeSQLUpdate("Gangs", "LeaderName = '"..getPlayerName(source).."'", "GangName = '".. tostring(mygang) .."'") end end end) addEventHandler ("onPlayerChangeNick", root, function (old, new) if not isGuestAccount (getPlayerAccount(source)) then local mygang = getElementData(source,"Gang") local cuenta = getAccountName(getPlayerAccount(source)) if mygang ~= "" then executeSQLUpdate("GangMembers", "MemberName = '".. tostring(new) .."'", "MemberAccount = '"..tostring(cuenta).."'") if getElementData (source, "gangLeader") == "yes" then executeSQLUpdate("Gangs", "LeaderName = '"..tostring(new).."'", "GangName = '".. tostring(mygang) .."'") end end end end) addEvent("add_member", true) addEventHandler("add_member", getRootElement(), function () local mygang = getElementData(source,"InvitacionGang") local cuenta = getAccountName(getPlayerAccount(source)) if not checkMemberExist(cuenta) then executeSQLInsert ( "GangMembers", "'','No','D: "..day.."/M: "..(mes+1).."','".. mygang .."','".. cuenta .."','".. getPlayerName(source) .."','Nuevo Miembro'" ) setElementData(source,"Gang",tostring(mygang)) setElementData (source, "InvitacionGang", "") local members = executeSQLQuery("SELECT * FROM Gangs where GangName = '" .. tostring(mygang) .. "'") memberss = members[1]["Members"] + 1 executeSQLUpdate("Gangs", "Members = '".. tonumber(memberss) .."'", "GangName = '".. tostring(mygang) .."'") local gangblip = createBlipAttachedTo (source, 41, 2, 255, 0, 0, 255, 0, 9999) setElementVisibleTo (gangblip, root, false) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == mygang then setElementVisibleTo (gangblip, players, true) call(getResourceFromName("guitext"),"outputServerGuiText",players,"Se a añadido el Jugador: ".. getPlayerName (source).. " A Tu Gang.",150,35,150) end end noSerVisible (source) end end) addEvent ("remove_member", true) addEventHandler ("remove_member", getRootElement(), function (player) local pla = getPlayerFromName (player) local mygang = getElementData(source,"Gang") if pla then if getElementData (pla, "gangLeader") ~= "yes" then if getPlayerName(pla) ~= getPlayerName(source) then executeSQLDelete("GangMembers","MemberAccount = '".. getAccountName(getPlayerAccount(pla)) .."' AND GangName = '".. mygang .."'") local members = executeSQLQuery("SELECT * FROM Gangs where GangName = '" .. tostring(mygang) .. "'") if members then memberss = members[1]["Members"] - 1 executeSQLUpdate("Gangs", "Members = '".. tonumber(memberss) .."'", "GangName = '".. tostring(mygang) .."'") end setElementData(pla,"Gang","") setElementData(pla,"gangSubLeader","no") deleteGangBlip(pla) call(getResourceFromName("guitext"),"outputServerGuiText",pla,"Fuiste Kikeado de la Gang "..mygang.." Por "..getPlayerName(source),150,35,150) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == mygang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador: "..getPlayerName(pla).." Fue Kikeado de la Gang por "..getPlayerName(source),150,35,150) end end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"No te puedes Kikear tu mismo.",150,35,150) end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"No Puedes kikear al Lider de la Gang.",255,0,0) end else local check2 = executeSQLQuery("SELECT * FROM Gangs where LeaderName = '" .. player .. "'") if not ( type( check2 ) == "table" and #check2 == 0 ) or not check2 then call(getResourceFromName("guitext"),"outputServerGuiText",source,"NO Puedes Kikear al Creador de la Gang.",255,0,0) else local gang = getElementData (source, "Gang") executeSQLDelete("GangMembers","MemberName = '".. player .."' AND GangName = '".. gang .."'") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador: "..player.." Fue Kikeado de la Gang por "..getPlayerName(source),150,35,150) end end local members = executeSQLQuery("SELECT * FROM Gangs where GangName = '" .. tostring(gang) .. "'") if members then memberss = members[1]["Members"] - 1 executeSQLUpdate("Gangs", "Members = '".. tonumber(memberss) .."'", "GangName = '".. tostring(gang) .."'") end end end end) addEvent ("salirGang", true) addEventHandler ("salirGang", root, function () local yo = getPlayerName (source) local mygang = getElementData(source, "Gang") if mygang ~= "" then executeSQLDelete("GangMembers","MemberAccount = '".. getAccountName(getPlayerAccount(source)) .."' AND GangName = '".. mygang .."'") call(getResourceFromName("guitext"),"outputServerGuiText",source,"Saliste de la Gang: "..mygang,150,35,150) local members = executeSQLQuery("SELECT * FROM Gangs where GangName = '" .. tostring(mygang) .. "'") if members then memberss = members[1]["Members"] - 1 executeSQLUpdate("Gangs", "Members = '".. tonumber(memberss) .."'", "GangName = '".. tostring(mygang) .."'") end for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == mygang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador: "..yo.. " A Salido de Tu Gang.",150,35,150) end end setElementData (source, "Gang", "") setElementData(source,"gangSubLeader","no") setElementData(source,"gangLeader","no") deleteGangBlip(source) end end) addEvent ("set_rank", true) addEventHandler ("set_rank", getRootElement(), function (player, rank) local pla = getPlayerFromName (player) if pla then local mygang = getElementData(pla,"Gang") executeSQLUpdate("GangMembers", "MemberRank = '".. tostring(rank) .."'", "MemberAccount = '"..getAccountName(getPlayerAccount(pla)).."'") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == mygang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador: "..getPlayerName(pla).. " Fue promovido a '"..tostring(rank).."'. Por "..getPlayerName(source),150,35,150) end end else call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador No esta Online.",150,35,150) end end) addEvent ("edit_gang", true) addEventHandler ("edit_gang", getRootElement(), function (subleader) local mygang = getElementData(source,"Gang") local player = getPlayerFromName(subleader) if player then if mygang ~= "" then local cuenta = getAccountName(getPlayerAccount(player)) executeSQLUpdate("GangMembers", "SubLider = 'Si'", "MemberAccount = '"..getAccountName(getPlayerAccount(player)).."'") setElementData(player,"gangSubLeader","yes") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == mygang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador: ".. subleader .." Fue promovido a SubLider de Tu gang ("..mygang..")",150,35,150) end end end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"Porfavor introduce todos los Datos",150,35,150) end end) function checkMemberExist(cuenta) check = executeSQLQuery("SELECT GangName FROM GangMembers WHERE MemberAccount='"..tostring(cuenta).."'") if ( type ( check ) == "table" ) and ( #check == 0 ) then return false else return true end end addEvent ("addGang", true) addEventHandler ("addGang", root, function (gang) if gang ~= "" then if getElementData (source, "Gang") == "" then local cuenta = getAccountName(getPlayerAccount(source)) local check = executeSQLQuery("SELECT GangName FROM Gangs where GangName = '" .. tostring(gang) .. "'") if ( type ( check ) == "table" and #check == 0 ) or not check then executeSQLInsert ( "Gangs", "'150','0','0','Bienvenidos a la Gang "..tostring(gang).."','".. tostring(cuenta) .."','','".. tostring(gang) .."','".. getPlayerName(source) .."','1'" ) executeSQLInsert ( "GangMembers", "'','Si','D: "..day.."/M: "..(mes+1).."','".. tostring(gang) .."','".. tostring(cuenta) .."','".. getPlayerName(source) .."','Lider'" ) call(getResourceFromName("guitext"),"outputServerGuiText",source,"Creaste Una Gang con el Nombre: "..tostring(gang),150,35,150) setElementData (source, "Gang", gang) setElementData (source, "gangLeader", "yes") else call(getResourceFromName("guitext"),"outputServerGuiText",source,"La gang con el Nombre:"..tostring(gang).." Ya Existe.",150,35,150) end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"Tu ya estas en una Gang!",150,35,150) end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"Inserta un Nombre Vliado para Tu Gang!",150,35,150) end end) addEvent ("removerGang", true) addEventHandler ("removerGang", root, function () local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source,"gangLeader") == "yes" then executeSQLDelete("Gangs","GangName = '"..gang.."' AND LeaderAccount = '".. getAccountName(getPlayerAccount(source)).."'") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then deleteGangBlip (players) setElementData (players, "Gang", "") setElementData (players,"gangSubLeader","no") setElementData (players,"gangLeader","no") executeSQLDelete("GangMembers","MemberAccount = '".. getAccountName(getPlayerAccount(players)) .."'") call(getResourceFromName("guitext"),"outputServerGuiText",players,"La Gang ("..gang..") Fue removida, Por el Lider, Ahora tienes que Salir de ella.",150,35,150) end end end end end) addEvent ("VerGangsters", true) addEventHandler ("VerGangsters", root, function () local mygang = getElementData (source, "Gang") if mygang ~= "" then Gangster = executeSQLQuery("SELECT * FROM GangMembers") triggerClientEvent ( source, "PonerLista", source, Gangster) end end) function mandarLasGangs() triggerClientEvent (source,"return_gangslist",source,gangs) end addEvent ("thegangs", true) addEventHandler ("thegangs", root, mandarLasGangs) function gangChat (player,_,...) local gang = getElementData (player, "Gang") local msg = table.concat({...}, " ") if gang ~= "" and gang ~= nil then if msg ~= "" and msg ~= " " then if getElementData(player,"SXGangMute") ~= true then if getElementData (player,"SXGangNoChat") ~= true then --outputServerLog ("(GRUPO-"..gang..")"..getPlayerName(player)..": "..msg) outputDebugString ("(GRUPO-"..gang..")"..getPlayerName(player)..": "..msg) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then if getElementData (players,"SXGangNoChat") ~= true then outputChatBox ("(GRUPO)"..getPlayerName(player)..": #FFFFFF"..msg, players, 150, 35, 150, true) end end end else outputChatBox("No puedes hablar en tu gang, El Chat esta Desabilitado para Ti.", player, 255, 0, 0) end else outputChatBox("No puedes hablar en tu gang, Estas Mutado!", player, 255, 0, 0) end else outputChatBox("Este Mensaje es Demasiado Corto para ser Enviado.", player, 255, 0, 0) end end end addCommandHandler ("gc", gangChat) function gangChatDouble (player,_,...) local gang = getElementData (player, "Gang") local msg = table.concat({...}, " ") if gang ~= "" and gang ~= nil then if msg ~= "" and msg ~= " " then if getElementData(player,"SXGangMute") ~= true then if getElementData (player,"SXGangNoChat") ~= true then --outputServerLog ("(GRUPO-"..gang..")"..getPlayerName(player)..": "..msg) outputDebugString ("(GRUPO-ALIADOS)"..getPlayerName(player)..": "..msg) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang or getElementData(players,"GangAliada") == gang then if getElementData (players,"SXGangNoChat") ~= true then outputChatBox ("(GRUPO-ALIADOS)"..getPlayerName(player)..": #FFFFFF"..msg, players, 150, 35, 150, true) end end end else outputChatBox("No puedes hablar en tu gang, El Chat esta Desabilitado para Ti.", player, 255, 0, 0) end else outputChatBox("No puedes hablar en tu gang, Estas Mutado!", player, 255, 0, 0) end else outputChatBox("Este Mensaje es Demasiado Corto para ser Enviado.", player, 255, 0, 0) end end end addCommandHandler ("gca", gangChatDouble) function onGangLogin () setTimer ( ponerLaInfo, 1000, 1, source) end addEventHandler ("onPlayerLogin", root, onGangLogin) function ponerLaInfo (source) local gang = getElementData (source, "Gang") local cuenta = getAccountName(getPlayerAccount(source)) if mygang ~= "" then executeSQLUpdate("GangMembers", "MemberLast = 'D: "..day.."/M: "..(mes+1).."'", "MemberAccount = '"..cuenta.."'") if getElementData (source,"gangLeader") == "yes" then mio = createBlipAttachedTo (source, 44, 2, 255, 0, 0, 255, 0, 2000) else mio = createBlipAttachedTo (source, 41, 2, 255, 0, 0, 255, 0, 2000) end setElementVisibleTo (mio, root, false) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then if players ~= source then createBlipAttachedTo (players, 41, 2, 255, 0, 0, 255, 0, 2000, source) setElementVisibleTo (mio, players, true) end end end end end function IrInfoGang () local gang = getElementData (source, "Gang") if gang ~= "" then local info = executeSQLQuery("SELECT * FROM Gangs where GangName = '" .. tostring(gang) .. "'") if info then informacion = info[1]["GangInfo"] triggerClientEvent (source, "VerLaInfo", source, informacion) end end end addEvent ("IrInfoGang", true) addEventHandler ("IrInfoGang", root, IrInfoGang) function laGangVer (gang) if gang ~= "" or gang ~= false or gang ~= nil then local info = executeSQLQuery("SELECT * FROM Gangs where GangName = '" .. tostring(gang) .. "'") if info then informa = info[1]["GangInfo"] triggerClientEvent (source, "verLaInfoOtras", source, informa, gang) end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"Porfavor selecciona una Gang de la Lista.",255,0,0) end end addEvent ("laGangVer", true) addEventHandler ("laGangVer", root, laGangVer) function ActualizarLaInfo (info) local gang = getElementData (source, "Gang") if gang ~= "" then executeSQLUpdate("Gangs", "GangInfo = '".. tostring(info) .."'", "GangName = '".. tostring(gang) .."'") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador "..getPlayerName(source).." Actualizo La Informacion de tu Gang.",150,35,150) end end end end addEvent ("ActualizarLaInfo", true) addEventHandler ("ActualizarLaInfo", root, ActualizarLaInfo) addEvent ("removerSubLider", true) addEventHandler ("removerSubLider", root, function (pla) local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source, "gangLeader") == "yes" or getElementData(source,"gangSubLeader") == "yes" then local player = getPlayerFromName(pla) if player then local cuenta = getAccountName(getPlayerAccount(player)) executeSQLUpdate("GangMembers", "SubLider = 'No'", "MemberAccount = '"..getAccountName(getPlayerAccount(player)).."'") setElementData(player,"gangSubLeader","no") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador: ".. pla .." Ahora no es Sub Lider de tu gang. ("..gang..")",150,35,150) end end else executeSQLUpdate("GangMembers", "SubLider = 'No'", "MemberName = '"..pla.."'") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador: ".. pla .." Ahora no es Sub Lider de tu gang. ("..gang..")",150,35,150) end end end end end end) addEvent ("gangmute", true) addEventHandler ("gangmute", root, function (pla) local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source, "gangLeader") == "yes" or getElementData(source,"gangSubLeader") == "yes" then local player = getPlayerFromName(pla) if player then if getElementData (player,"SXGangMute") ~= true then setElementData(player,"SXGangMute",true) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then outputChatBox ("(GRUPO)"..getPlayerName(source).." Muto a "..pla.." En el Gang Chat.",players,255,0,0) end end else setElementData(player,"SXGangMute",false) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then outputChatBox ("(GRUPO)"..getPlayerName(source).." Desmuto a "..pla.." En el Gang Chat.",players,0,255,0) end end end end end end end) addEvent ("markingang", true) addEventHandler ("markingang", root, function (pla) local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source, "gangLeader") == "yes" or getElementData(source,"gangSubLeader") == "yes" then local player = getPlayerFromName(pla) if player then local mark = getElementData (player,"SXGangMarking") if mark and isElement(mark) then destroyElement (getElementData (mark,"GangBlip")) destroyElement (mark) removeElementData (source,"SXGangMarking") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,getPlayerName(source).." Removio el Punto de Interes sobre "..pla,150,35,150) end end else gangblip = createBlipAttachedTo (player, 44) gangmarker = createMarker (0, 0, 0, "checkpoint", 2, 150, 35, 150, 200) attachElements (gangmarker, player) setElementData (gangmarker,"GangBlip",gangblip) setElementVisibleTo (gangmarker,root,false) setElementVisibleTo (gangblip,root,false) setElementData(player,"SXGangMarking",gangmarker) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then setElementVisibleTo (gangblip,players,true) setElementVisibleTo (gangmarker,players,true) call(getResourceFromName("guitext"),"outputServerGuiText",players,getPlayerName(source).." Puso un Punto de Interes sobre "..pla,150,35,150) end end end end end end end) addEvent ("notagang", true) addEventHandler ("notagang", root, function (text) local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source, "gangLeader") == "yes" or getElementData(source,"gangSubLeader") == "yes" then if text and tostring(text) ~= nil then if text ~= "" and text ~= " " then outputDebugString ("(GRUPO-NOTA-"..gang..")"..getPlayerName(source)..": "..text) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then outputChatBox ("(GRUPO-NOTA)"..getPlayerName(source)..": #FFFFFF"..text,players,255,0,0,true) end end end end end end end) addEvent ("refuerzosgang", true) addEventHandler ("refuerzosgang", root, function () local gang = getElementData (source, "Gang") if gang ~= "" then local x, y, z = getElementPosition(source) local r,g,b = getTeamColor(getPlayerTeam(source)) local loc = getZoneName ( x, y, z ) local city = getZoneName ( x, y, z, true ) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang or getElementData (players, "GangAliada") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,getPlayerName(source).." Pide Refuerzos en "..loc.." ("..city..")",r,g,b) end end end end) addEvent ("crearpuntogang", true) addEventHandler ("crearpuntogang", root, function () local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source, "gangLeader") == "yes" or getElementData(source,"gangSubLeader") == "yes" then local mk = getElementData (source,"GangMarker") if not mk and not isElement(mk) then local x, y, z = getElementPosition (source) gangb = createBlip (x, y, z, 44) gangm = createMarker (x, y, z, "checkpoint", 2, 150, 35, 150, 200) setElementData (gangm,"GangBlip",gangb) setElementData (source,"GangMarker", gangm) setElementVisibleTo (gangb, root, false) setElementVisibleTo (gangm, root, false) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then setElementVisibleTo (gangb, players, true) setElementVisibleTo (gangm, players, true) call(getResourceFromName("guitext"),"outputServerGuiText",players,getPlayerName(source).." Ha Puesto un Punto de Interes.",150, 35, 150) end end else destroyElement (getElementData (mk,"GangBlip")) destroyElement (mk) removeElementData (source,"GangMarker") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,getPlayerName(source).." Ha Destruido los Puntos de Interes.",150, 35, 150) end end end end end end) addEvent ("destruirpunto", true) addEventHandler ("destruirpunto", root, function () local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source, "gangLeader") == "yes" or getElementData(source,"gangSubLeader") == "yes" then local mk = getElementData (source,"GangMarker") if mk and isElement(mk) then destroyElement (getElementData (mk,"GangBlip")) destroyElement (mk) removeElementData (source,"GangMarker") for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,getPlayerName(source).." Ha Destruido el Puntos de Interes.",150, 35, 150) end end end end end end) addEvent ("confirmacion", true) addEventHandler ("confirmacion", root, function (player) local gang = getElementData (source, "Gang") local newg = getPlayerFromName (player) if gang ~= "" then if newg then if getElementData(newg, "InvitacionGang") ~= gang then setElementData (newg, "InvitacionGang", gang) call(getResourceFromName("guitext"),"outputServerGuiText",newg,"El Jugador "..getPlayerName(source)..". Te invito a la Gang: "..gang..".",150,35,150) call(getResourceFromName("guitext"),"outputServerGuiText",newg,"Usa F6, y apreta 'Invitaciones' Para unirte a esta Gang.",150,35,150) for index, players in ipairs (getElementsByType("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"El Jugador "..player..". Fue invitado a tu Gang por "..getPlayerName(source)..".",150,35,150) end end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"Este Jugador ya posee una invitacion a tu Gang.",150,35,150) end end end end) function darLeaderGang (nuevo) local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source, "gangLeader") == "yes" then local lea = getPlayerFromName (nuevo) if lea then if gang == getElementData(lea, "Gang") then local cuenta = getAccountName(getPlayerAccount(lea)) executeSQLUpdate("Gangs", "LeaderAccount = '".. tostring(cuenta) .."'", "GangName = '".. tostring(gang) .."'") executeSQLUpdate("Gangs", "LeaderName = '".. tostring(nuevo) .."'", "GangName = '".. tostring(gang) .."'") setElementData (source, "gangLeader", "no") setElementData (lea, "gangLeader", "yes") for index, players in ipairs (getElementsByType ("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"Ahora, El nuevo de Lider de tu Gang ("..gang..") Es: "..nuevo..".",150,35,150) end end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"El jugador: '"..nuevo.."' No esta en tu Gang.",150,35,150) end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"El jugador con nombre: '"..nuevo.."' No se encuentra.",150,35,150) end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"Tu no eres el Lider de tu Gang.",150,35,150) end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"Tu no tienes Gang.",150,35,150) end end addEvent ("NuevoLiderGang", true) addEventHandler ("NuevoLiderGang", root, darLeaderGang) function TrufColor (r, g, b) local gang = getElementData (source, "Gang") if gang ~= "" then if getElementData (source, "gangLeader") == "yes" then local members = executeSQLQuery("SELECT * FROM Gangs where GangName = '" .. tostring(gang) .. "'") if members then local m = members[1]["Members"] if tonumber(m) >= 5 then if tonumber® <= 255 and tonumber® >= 0 and tonumber(g) <= 255 and tonumber(g) >= 0 and tonumber(b) <= 255 and tonumber(b) >= 0 then executeSQLUpdate("Gangs", "R = '"..tonumber®.."'", "GangName = '".. gang .."'") executeSQLUpdate("Gangs", "G = '"..tonumber(g).."'", "GangName = '".. gang .."'") executeSQLUpdate("Gangs", "B = '"..tonumber(b).."'", "GangName = '".. gang .."'") for index, players in ipairs (getElementsByType ("player")) do if getElementData (players, "Gang") == gang then call(getResourceFromName("guitext"),"outputServerGuiText",players,"Se an cambiado los Colores de los Territorios a (El Color de este Mensaje) R: "..r..", G: "..g..", B: "..b,r,g,b) end end for index, trufs in ipairs (getElementsByType ("colshape"), getResourceRootElement()) do if getElementData( trufs, 'GangTruf' ) then if getElementData ( trufs, "GangTruf")[2] == gang then setRadarAreaColor (getElementData(trufs, "GangTruf")[3], r, g, b, 150) end end end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"Los Numeros validos son de 0 a 255.",150,35,150) end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"No ay Suficientes Miembros de la Gang (5 Minimamente).",150,35,150) end end else call(getResourceFromName("guitext"),"outputServerGuiText",source,"No tienes permiso para hacer esto.",150,35,150) end end end addEvent("TrufColor", true) addEventHandler ("TrufColor", root, TrufColor) function noSerVisible (source) local elements = getAttachedElements(source) if (elements) then for i, element in ipairs(elements) do if getBlipIcon(element) == 41 then setElementVisibleTo (element, source, false) end end end end function deleteGangBlip(player) local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (getElementType(element) == "blip") then if getBlipIcon(element) == 41 then destroyElement(element) end end end end end Cuando yo cree una gang me cobre un determinado dinero! porfa ayudenme Link to comment
Guest Posted June 9, 2014 Share Posted June 9, 2014 Éste Script es filtrado.. Y no hace falta decir, viendo el script se mira todo Link to comment
molinaa1 Posted June 9, 2014 Author Share Posted June 9, 2014 Como filtrado? Me lo paso un amigo y necesito ponerle eso, Me ayudas? Link to comment
Bc# Posted June 9, 2014 Share Posted June 9, 2014 Como filtrado? Me lo paso un amigo y necesito ponerle eso, Me ayudas? Filtrado quiere decir que alguien lo robó, o tomó sin el consentimiento del scripter que creó el código, y en este foro no se da ayuda a quienes tienen códigos filtrados. Link to comment
Guest Posted June 9, 2014 Share Posted June 9, 2014 Como filtrado? Me lo paso un amigo y necesito ponerle eso, Me ayudas? Filtrado quiere decir que alguien lo robó, o tomó sin el consentimiento del scripter que creó el código, y en este foro no se da ayuda a quienes tienen códigos filtrados. +1 Link to comment
Tomas Posted June 11, 2014 Share Posted June 11, 2014 Yep, el viejo Gang_Panel del SX... Usado por infinidades de servidores... Para qué no digan que comento por conseguir post te dejo la función que deberás usar: takePlayerMoney Link to comment
Recommended Posts