Jump to content

MisterQuestions

Members
  • Posts

    460
  • Joined

  • Last visited

Everything posted by MisterQuestions

  1. Hi, how to fix hunter msg, when player gets hunter make appear that msg´s pls addEvent('onPlayerPickUpRacePickup') addEventHandler("onPlayerPickUpRacePickup", getRootElement(), function hunterMsg(number, sort, model) if sort == "vehiclechange" then if model == 425 then local mapname = call(getResourceFromName("mapmanager"),"getRunningGamemodeMap") setHunterOnMap(mapname) if not hunterMsg then outputChatBox( "#ff0000[#ff9e00HFUNTER ALERT#ff0000]:El jugador:" .. getPlayerNametagText(player).. "llego al hunter", getRootElement(),255,255,255,true ) outputChatBox( "#ff0000[#ff9e00HFUNTER ALERT#ff0000]:#ffffffEl color del cielo & agua ahora es #FF0000DEFAULT", getRootElement(),255,255,255,true ) outputChatBox( "#ff0000[#ff9e00PM#ff0000]" .. getPlayerNametagText(player).. "#ffffff:Corre por tu vida!", getRootElement(),255,255,255,true ) triggerClientEvent("onServerSendHunterMessage",getRootElement(),hunterHundleInfo) hunterMsg = false end if getActivePlayerCount() <= 0 then setElementHealth(source, 0) end end end end)
  2. Hi, i need help about do "server.lua" of this panel please help me! CODE REMOVED BY Solidsnake14
  3. <team name="Players" tag="" color="#FFFFFF" aclGroup="Everyone" required="-ffw-"></team> <team name="Fast Fucking War Server Owner" tag="-ffw-" color="#FF0000" aclGroup="Owner" required="-ffw-"></team> <team name="Fast Fucking War Team-Mananger" tag="-ffw-" color="#ff5000" aclGroup="Team-Mananger" required="-ffw-"></team> <team name="Fast Fucking War Administradores" tag="-ffw-" color="#0000FF" aclGroup="Admin" required="-ffw-"></team> <team name="Fast Fucking War Moderadores" tag="-ffw-" color="#FFFF00" aclGroup="Moderator" required="-ffw-"></team> <team name="Fast Fucking War Miembros" tag="-ffw-" color="#00FF00" aclGroup="Miembros" required="-ffw-"></team> team name="Fast Fucking War Trial-Miembros" tag="-ffw-" color="#00FFFF" aclGroup="Trial-Miembros" required="-ffw-"></team> <team name="Fast Fucking War V.I.P" tag="-ffw-" color="#33CC00" aclGroup="V.I.P" required="-ffw-"></team> Thats autoteams code, so...how to do...when players login set team if the is on specified acl... This is server.lua of autoteams. teams = {} function toggleClientPanel(player) triggerClientEvent(player, "opendaShitForme", getRootElement() ) end function onSomeoneLoggedIn() local accountName = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accountName,aclGetGroup("Owner")) then unbindKey(source,"F1","down", toggleClientPanel) bindKey(source,"F1","down", toggleClientPanel) end end addEventHandler("onPlayerLogin", getRootElement(), onSomeoneLoggedIn) function sendGridtoClient() local theteams = {} local rootNode = xmlLoadFile("config.xml") local children = xmlNodeGetChildren(rootNode) for _,node in pairs(children) do local attributes = xmlNodeGetAttributes(node) local name = attributes.name theteams[name] = attributes end xmlUnloadFile(rootNode) triggerClientEvent(source, "hereIsDaListNub", getRootElement(), theteams) end addEvent("gimmeTheFuckinList", true) addEventHandler("gimmeTheFuckinList", getRootElement(), sendGridtoClient) function saveNewTeams(theteams) local thexml = xmlCreateFile("config.xml", "teams") for name,settings in next,theteams do local child = xmlCreateChild(thexml, "team") xmlNodeSetAttribute(child, "name", name) xmlNodeSetAttribute(child, "tag", settings.tag) xmlNodeSetAttribute(child, "color", settings.color) xmlNodeSetAttribute(child, "aclGroup", settings.aclGroup) xmlNodeSetAttribute(child, "required", settings.required) end xmlSaveFile(thexml) xmlUnloadFile(thexml) initiate() end addEvent("hereIzDaFuckinList", true) addEventHandler("hereIzDaFuckinList", getRootElement(), saveNewTeams) function startedResource() for k,v in pairs(getElementsByType("player")) do local accountName = getAccountName(getPlayerAccount(v)) if isObjectInACLGroup("user."..accountName,aclGetGroup("Admin")) then if (isKeyBound (v,"F3") == false) then unbindKey(v,"F3","down", toggleClientPanel) bindKey(v,"F3","down", toggleClientPanel) end end end end addEventHandler("onResourceStart",getResourceRootElement(),startedResource) ------------ -- Events -- ------------ function playerJoined() check(source) end addEventHandler("onPlayerJoin",getRootElement(),playerJoined) function playerChangedNick(oldNick,newNick) -- Use timer to wait until the nick really has changed setTimer(check,100,1,source) end addEventHandler("onPlayerChangeNick",getRootElement(),playerChangedNick) function playerQuit() removePlayerFromTeam(source) end addEventHandler("onPlayerQuit",getRootElement(),playerQuit) -- Check for ACL Groups on login/logout function loggedIn() check(source) end addEventHandler("onPlayerLogin",getRootElement(),loggedIn) function loggedOut() check(source) unbindKey(source,"F3","down", toggleClientPanel) end addEventHandler("onPlayerLogout",getRootElement(),loggedOut) --- -- Reads the settings and creates the teams if enabled. -- function initiate() teams = {} for k,v in pairs(getElementsByType("team")) do local players = getPlayersInTeam (v) for playerKey, playerValue in ipairs ( players ) do setPlayerTeam( playerValue, nil) end destroyElement(v) end local rootNode = xmlLoadFile("config.xml") local children = xmlNodeGetChildren(rootNode) if children == false then outputDebugString("children == false") return end for _,node in pairs(children) do local attributes = xmlNodeGetAttributes(node) local name = attributes.name teams[name] = attributes if not toboolean(get("noEmptyTeams")) then local color = {getColorFromString(attributes.color)} if not color[1] then color = {255,255,255} end teams[name].team = createTeam(name,unpack(color)) end end for k,v in pairs(getElementsByType("player")) do check(v) end xmlUnloadFile(rootNode) end addEventHandler("onResourceStart",getResourceRootElement(),initiate) --------------- -- Functions -- --------------- --- -- Checks the player's nick and ACL Groups and sets his team if necessary. -- -- @param player player: The player element -- function check(player) if not isElement(player) or getElementType(player) ~= "player" then debug("No player") return end local nick = getPlayerName(player) --set player white setPlayerNametagColor(player, 255,255,255) local accountName = getAccountName(getPlayerAccount(player)) for name,data in pairs(teams) do local tagMatch = false local aclGroupMatch = false if data.tag ~= nil and string.find(nick,data.tag,1,true) then tagMatch = true end if data.aclGroup ~= nil and accountName and isObjectInACLGroup("user."..accountName,aclGetGroup(data.aclGroup)) then aclGroupMatch = true end if data.required == "both" then if tagMatch and aclGroupMatch then addPlayerToTeam(player,name) --Check Vehicle color (and set it to team color) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if getPedOccupiedVehicleSeat(player) == 0 then if getPlayerTeam(player) then local r,g,b = getTeamColor(getPlayerTeam(player)) setVehicleColor(vehicle,r,g,b,r,g,b,r,g,b,r,g,b) setPlayerNametagColor(player, r,g,b) else setVehicleColor(vehicle,255,255,255,255,255,255,255,255,255,255,255,255) end end end return end else if tagMatch or aclGroupMatch then addPlayerToTeam(player,name) --Check Vehicle color (and set it to team color) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if getPedOccupiedVehicleSeat(player) == 0 then if getPlayerTeam(player) then local r,g,b = getTeamColor(getPlayerTeam(player)) setVehicleColor(vehicle,r,g,b,r,g,b,r,g,b,r,g,b) setPlayerNametagColor(player, r,g,b) else setVehicleColor(vehicle,255,255,255,255,255,255,255,255,255,255,255,255) end end end return end end end removePlayerFromTeam(player) --Check Vehicle color (and set it to team color) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if getPedOccupiedVehicleSeat(player) == 0 then if getPlayerTeam(player) then local r,g,b = getTeamColor(getPlayerTeam(player)) setVehicleColor(vehicle,r,g,b,r,g,b,r,g,b,r,g,b) setPlayerNametagColor(player, r,g,b) else setVehicleColor(vehicle,255,255,255,255,255,255,255,255,255,255,255,255) end end end end --- -- Adds a player to the team appropriate for the name. -- It is not checked if the team is really defined in the table, since -- it should only be called if it is. -- -- Creates the team if it doesn't exist. -- -- @param player player: The player element -- @param string name: The name of the team -- function addPlayerToTeam(player,name) local oldteam = getPlayerTeam(player) local team = teams[name].team if not isElement(team) or getElementType(team) ~= "team" then local color = {getColorFromString(teams[name].color)} if not color[1] then color = {255,255,255} end team = createTeam(teams[name].name,unpack(color)) teams[name].team = team elseif team == oldteam then return end triggerEvent("onPlayerTeamChange", player, oldteam, team) setPlayerTeam(player,team) debug("Added player '"..getPlayerName(player).."' to team '"..name.."'") end --- -- Removes a player from a team. Also checks if any team -- needs to be removed. --
  4. function PlayerJoin addEventHandler ( "onResourceStart", root, SetTeam ) outputChatBox ( "Set Team Creado por #ff5000-ffw-#6600CCRandom*" .. joinedPlayerName .. " to ".. serverName .."!" , source, 255, 255, 255 ) end addEventHandler ( "onPlayerJoin", getRootElement(), CrearTeam ) end function CreateTeam ( source, commandName, teamName ) local theTeam = createTeam ( Fast Fucking War Server Owner ) -- create a new team with the specified name if theTeam then else isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then -- if it was successfully created setPlayerTeam ( source, Fast Fucking War Server Owner ) -- add the player to the new team end end Help im triying to do a new one please!
  5. Please guys help me!!i van give admin for player whi help me
  6. Hey, Im new here, cause i need to edit autoteams mananger, I already have teams and tags addes and ACL, but i want to set group to player by acl. Ej: Player 1 ACL Owner, Set Team Owner Can some body help me? teams = {} function toggleClientPanel(player) triggerClientEvent(player, "opendaShitForme", getRootElement() ) end function onSomeoneLoggedIn() local accountName = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accountName,aclGetGroup("Admin")) then unbindKey(source,"F3","down", toggleClientPanel) bindKey(source,"F3","down", toggleClientPanel) end end addEventHandler("onPlayerLogin", getRootElement(), onSomeoneLoggedIn) function sendGridtoClient() local theteams = {} local rootNode = xmlLoadFile("config.xml") local children = xmlNodeGetChildren(rootNode) for _,node in pairs(children) do local attributes = xmlNodeGetAttributes(node) local name = attributes.name theteams[name] = attributes end xmlUnloadFile(rootNode) triggerClientEvent(source, "hereIsDaListNub", getRootElement(), theteams) end addEvent("gimmeTheFuckinList", true) addEventHandler("gimmeTheFuckinList", getRootElement(), sendGridtoClient) function saveNewTeams(theteams) local thexml = xmlCreateFile("config.xml", "teams") for name,settings in next,theteams do local child = xmlCreateChild(thexml, "team") xmlNodeSetAttribute(child, "name", name) xmlNodeSetAttribute(child, "tag", settings.tag) xmlNodeSetAttribute(child, "color", settings.color) xmlNodeSetAttribute(child, "aclGroup", settings.aclGroup) xmlNodeSetAttribute(child, "required", settings.required) end xmlSaveFile(thexml) xmlUnloadFile(thexml) initiate() end addEvent("hereIzDaFuckinList", true) addEventHandler("hereIzDaFuckinList", getRootElement(), saveNewTeams) function startedResource() for k,v in pairs(getElementsByType("player")) do local accountName = getAccountName(getPlayerAccount(v)) if isObjectInACLGroup("user."..accountName,aclGetGroup("Admin")) then if (isKeyBound (v,"F3") == false) then unbindKey(v,"F3","down", toggleClientPanel) bindKey(v,"F3","down", toggleClientPanel) end end end end addEventHandler("onResourceStart",getResourceRootElement(),startedResource) ------------ -- Events -- ------------ function playerJoined() check(source) end addEventHandler("onPlayerJoin",getRootElement(),playerJoined) function playerChangedNick(oldNick,newNick) -- Use timer to wait until the nick really has changed setTimer(check,100,1,source) end addEventHandler("onPlayerChangeNick",getRootElement(),playerChangedNick) function playerQuit() removePlayerFromTeam(source) end addEventHandler("onPlayerQuit",getRootElement(),playerQuit) -- Check for ACL Groups on login/logout function loggedIn() check(source) end addEventHandler("onPlayerLogin",getRootElement(),loggedIn) function loggedOut() check(source) unbindKey(source,"F3","down", toggleClientPanel) end addEventHandler("onPlayerLogout",getRootElement(),loggedOut) --- -- Reads the settings and creates the teams if enabled. -- function initiate() teams = {} for k,v in pairs(getElementsByType("team")) do local players = getPlayersInTeam (v) for playerKey, playerValue in ipairs ( players ) do setPlayerTeam( playerValue, nil) end destroyElement(v) end local rootNode = xmlLoadFile("config.xml") local children = xmlNodeGetChildren(rootNode) if children == false then outputDebugString("children == false") return end for _,node in pairs(children) do local attributes = xmlNodeGetAttributes(node) local name = attributes.name teams[name] = attributes if not toboolean(get("noEmptyTeams")) then local color = {getColorFromString(attributes.color)} if not color[1] then color = {255,255,255} end teams[name].team = createTeam(name,unpack(color)) end end for k,v in pairs(getElementsByType("player")) do check(v) end xmlUnloadFile(rootNode) end addEventHandler("onResourceStart",getResourceRootElement(),initiate) --------------- -- Functions -- --------------- --- -- Checks the player's nick and ACL Groups and sets his team if necessary. -- -- @param player player: The player element -- function check(player) if not isElement(player) or getElementType(player) ~= "player" then debug("No player") return end local nick = getPlayerName(player) --set player white setPlayerNametagColor(player, 255,255,255) local accountName = getAccountName(getPlayerAccount(player)) for name,data in pairs(teams) do local tagMatch = false local aclGroupMatch = false if data.tag ~= nil and string.find(nick,data.tag,1,true) then tagMatch = true end if data.aclGroup ~= nil and accountName and isObjectInACLGroup("user."..accountName,aclGetGroup(data.aclGroup)) then aclGroupMatch = true end if data.required == "both" then if tagMatch and aclGroupMatch then addPlayerToTeam(player,name) --Check Vehicle color (and set it to team color) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if getPedOccupiedVehicleSeat(player) == 0 then if getPlayerTeam(player) then local r,g,b = getTeamColor(getPlayerTeam(player)) setVehicleColor(vehicle,r,g,b,r,g,b,r,g,b,r,g,b) setPlayerNametagColor(player, r,g,b) else setVehicleColor(vehicle,255,255,255,255,255,255,255,255,255,255,255,255) end end end return end else if tagMatch or aclGroupMatch then addPlayerToTeam(player,name) --Check Vehicle color (and set it to team color) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if getPedOccupiedVehicleSeat(player) == 0 then if getPlayerTeam(player) then local r,g,b = getTeamColor(getPlayerTeam(player)) setVehicleColor(vehicle,r,g,b,r,g,b,r,g,b,r,g,b) setPlayerNametagColor(player, r,g,b) else setVehicleColor(vehicle,255,255,255,255,255,255,255,255,255,255,255,255) end end end return end end end removePlayerFromTeam(player) --Check Vehicle color (and set it to team color) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if getPedOccupiedVehicleSeat(player) == 0 then if getPlayerTeam(player) then local r,g,b = getTeamColor(getPlayerTeam(player)) setVehicleColor(vehicle,r,g,b,r,g,b,r,g,b,r,g,b) setPlayerNametagColor(player, r,g,b) else setVehicleColor(vehicle,255,255,255,255,255,255,255,255,255,255,255,255) end end end end --- -- Adds a player to the team appropriate for the name. -- It is not checked if the team is really defined in the table, since -- it should only be called if it is. -- -- Creates the team if it doesn't exist. -- -- @param player player: The player element -- @param string name: The name of the team -- function addPlayerToTeam(player,name) local oldteam = getPlayerTeam(player) local team = teams[name].team if not isElement(team) or getElementType(team) ~= "team" then local color = {getColorFromString(teams[name].color)} if not color[1] then color = {255,255,255} end team = createTeam(teams[name].name,unpack(color)) teams[name].team = team elseif team == oldteam then return end triggerEvent("onPlayerTeamChange", player, oldteam, team) setPlayerTeam(player,team) debug("Added player '"..getPlayerName(player).."' to team '"..name.."'") end --- -- Removes a player from a team. Also checks if any team -- needs to be removed. --
×
×
  • Create New...