Jump to content

[help] creat team


Recommended Posts

function createDonatorsTeamOnStart () 
    DonatorsTeam = createTeam ( "Clan Name", 0, 0, 0 )-- create a new team and named it 'Donators' 
end 
addEventHandler("onResourceStart", resourceRoot, createDonatorsTeamOnStart) -- add an event handler 
  
function setDonatorsTeam() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Donators")) then -- if he is Donators 
   setPlayerTeam(source, DonatorsTeam) -- set him to Donators team 
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setDonatorsTeam) -- add an event handler 
addEventHandler("onPlayerSpawn",getRootElement(),setDonatorsTeam) 
  

This is my Donators script you can use it

Link to comment
function createDonatorsTeamOnStart () 
    DonatorsTeam = createTeam ( "Clan Name", 0, 0, 0 )-- create a new team and named it 'Donators' 
end 
addEventHandler("onResourceStart", resourceRoot, createDonatorsTeamOnStart) -- add an event handler 
  
function setDonatorsTeam() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Donators")) then -- if he is Donators 
   setPlayerTeam(source, DonatorsTeam) -- set him to Donators team 
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setDonatorsTeam) -- add an event handler 
addEventHandler("onPlayerSpawn",getRootElement(),setDonatorsTeam) 
  

This is my Donators script you can use it

in team.lua

??

Link to comment
function createDonatorsTeamOnStart () 
    DonatorsTeam = createTeam ( "Clan Name", 0, 0, 0 )-- create a new team and named it 'Donators' 
end 
addEventHandler("onResourceStart", resourceRoot, createDonatorsTeamOnStart) -- add an event handler 
  
function setDonatorsTeam() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Donators")) then -- if he is Donators 
   setPlayerTeam(source, DonatorsTeam) -- set him to Donators team 
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setDonatorsTeam) -- add an event handler 
addEventHandler("onPlayerSpawn",getRootElement(),setDonatorsTeam) 
  

This is my Donators script you can use it

in team.lua

??

you can set name which you want and it is client side

Link to comment
function createDonatorsTeamOnStart () 
    DonatorsTeam = createTeam ( "Clan Name", 0, 0, 0 )-- create a new team and named it 'Donators' 
end 
addEventHandler("onResourceStart", resourceRoot, createDonatorsTeamOnStart) -- add an event handler 
  
function setDonatorsTeam() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Donators")) then -- if he is Donators 
   setPlayerTeam(source, DonatorsTeam) -- set him to Donators team 
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setDonatorsTeam) -- add an event handler 
addEventHandler("onPlayerSpawn",getRootElement(),setDonatorsTeam) 
  

This is my Donators script you can use it

addEventHandler("onResourceStart", resourceRoot, 
function() 
DonatorsTeam = createTeam ( "Clan Name", 0, 0, 0 ) 
end) 
  
function setDonatorsTeam(player) 
       local accName = getAccountName ( getPlayerAccount ( player ) ) 
        if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "GroupName" ) ) then 
   setPlayerTeam(player, DonatorsTeam) 
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setDonatorsTeam) 
addEventHandler("onPlayerSpawn",getRootElement(),setDonatorsTeam) 
Link to comment
function createDonatorsTeamOnStart () 
    DonatorsTeam = createTeam ( "Clan Name", 0, 0, 0 )-- create a new team and named it 'Donators' 
end 
addEventHandler("onResourceStart", resourceRoot, createDonatorsTeamOnStart) -- add an event handler 
  
function setDonatorsTeam() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Donators")) then -- if he is Donators 
   setPlayerTeam(source, DonatorsTeam) -- set him to Donators team 
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setDonatorsTeam) -- add an event handler 
addEventHandler("onPlayerSpawn",getRootElement(),setDonatorsTeam) 
  

This is my Donators script you can use it

addEventHandler("onResourceStart", resourceRoot, 
function() 
DonatorsTeam = createTeam ( "Clan Name", 0, 0, 0 ) 
end) 
  
function setDonatorsTeam(player) 
       local accName = getAccountName ( getPlayerAccount ( player ) ) 
        if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "GroupName" ) ) then 
   setPlayerTeam(player, DonatorsTeam) 
   end 
end 
addEventHandler("onPlayerLogin",getRootElement(),setDonatorsTeam) 
addEventHandler("onPlayerSpawn",getRootElement(),setDonatorsTeam) 

You're code is wrong change the player to source the player is not defined.

Link to comment

it is okey now i creat the script

   local marker = createMarker(  1585.7399902344, -1689.7290039063, 6.21815, "Cylinder", 1.5, 0, 69, 139, 0) 
     
     GUIEditor_Button = {} 
         GUIEditor_Memo = {} 
         GUIEditor_Label = {} 
          
        function guiMyCwindow(w,h,t) 
          local x,y = guiGetScreenSize() 
          return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) 
        end 
         
        windowjob = guiMyCwindow(301,250,"Swat") 
        guiSetVisible(windowjob, false) 
        GUIEditor_Button[1] = guiCreateButton(22,200,108,35,"Take job",false,windowjob) 
        GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) 
        GUIEditor_Button[2] = guiCreateButton(179,200,110,36,"Cancel",false,windowjob) 
        GUIEditor_Memo[1] = guiCreateMemo(19,33,273,100,"To be a swat members, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) 
         guiEditSetReadOnly(GUIEditor_Memo[1],true) 
          
        function Swat_Team(hitElement) 
             if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
                  if not guiGetVisible(windowjob) then 
                       guiSetVisible(windowjob, true) 
                       showCursor(true) 
                  end 
             end 
        end  
         addEventHandler("onClientMarkerHit", marker, Swat_Team) 
          
        function Swatjobleave(leaveElement) 
             if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then 
                  if guiGetVisible(windowjob) then 
                       guiSetVisible(windowjob, false) 
                       showCursor(false) 
                  end 
             end 
        end 
        addEventHandler("onClientMarkerLeave", marker, Swatjobleave) 
         
        function joinTeam() 
             triggerServerEvent("setSwat",localPlayer) 
             guiSetVisible(windowjob, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) 
          
        function removeSwatWindow() 
             guiSetVisible(windowjob, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSwatWindow, false) 
         

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...