Jump to content

[Question] SWAT Job


gghvcffcv

Recommended Posts

Posted

Hello guys, How could i restrict this for an ACL Group, i tried but it didn't work, if anyone can help me Please.

Server:

createTeam ( "SWAT", 0, 0, 255 ) 
  
function aceptarr ( ) 
    local theTeam = getTeamFromName ( "SWAT" ) 
    if ( theTeam ) then 
        setPlayerTeam ( source, theTeam ) 
        setPlayerNametagColor ( source, 0, 0, 255 ) 
        setElementModel ( source, 285 ) 
        giveWeapon ( source, 31, 550 ) 
        giveWeapon ( source, 23, 550 ) 
        giveWeapon ( source, 3, 550 ) 
        giveWeapon ( source, 29, 550 ) 
        giveWeapon ( source, 46, 550 ) 
        giveWeapon ( source, 41, 5000 ) 
    end 
end 
addEvent( "onGreeting", true ) 
addEventHandler( "onGreeting", root, aceptarr ) 

Client:

marker5 = createMarker( 1288.17566, -1641.94141, 12.54688, "Cylinder", 1, 0, 0, 255, 200) 
pedi = createPed ( 285, 1288.17566, -1641.94141, 13.54688, 270) 
blipA = createBlip ( 1288.17566, -1641.94141, 13.54688, 58, 2, 255, 0,0, 255) 
  
function panel(hitElement) 
    if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
        local playerTeam = getPlayerTeam ( localPlayer ) 
        if ( playerTeam ) then           
            local oldTeamName = getTeamName ( playerTeam ) 
            if ( oldTeamName ~= "SWAT" ) then 
            setElementFrozen (pedi, true) 
                panel = guiCreateWindow(443, 132, 416, 514, "S.W.A.T Job", false) 
                guiWindowSetSizable(panel, false) 
  
                aceptar = guiCreateButton(16, 282, 169, 72, "Accept", false, panel) 
                cerrar = guiCreateButton(230, 282, 169, 72, "Close", false, panel) 
                memo = guiCreateMemo(12, 26, 382, 238, "Welcome to the SWAT Job Accept this job if you are an SWAT\nIf you aren't a swat You cannot accept this Job.", false, panel) 
        
                showCursor (true) 
                addEventHandler ("onClientGUIClick", aceptar, aceptarr, false ) 
                addEventHandler ("onClientGUIClick", cerrar, cerrarr, false ) 
                guiMemoSetReadOnly(memo, true)     
            end 
        end 
    end     
end 
addEventHandler("onClientMarkerHit", marker5, panel ) 
  
function aceptarr ( thePlayer ) 
triggerServerEvent ( "onGreeting", localPlayer) 
guiSetVisible ( panel, false ) 
showCursor(false) 
end 
  
  
function cerrarr ( hitElement ) 
guiSetVisible ( panel, false ) 
showCursor(false) 
end 

Posted

Use the following functions:

getPlayerAccount 
getAccountName 
aclGetGroup 
isObjectInACLGroup 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Use the following functions:
getPlayerAccount 
getAccountName 
aclGetGroup 
isObjectInACLGroup 

function aceptarr () 
        local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name 
        if isObjectInACLGroup ("user."..accName, aclGetGroup ( "SWAT" ) ) then -- Does he have access to Admin functions? 
        local theTeam = getTeamFromName ( "SWAT" ) 
        if ( theTeam ) then 
        setPlayerTeam ( source, theTeam ) 
        setPlayerNametagColor ( source, 0, 0, 255 ) 
        setElementModel ( source, 285 ) 
        giveWeapon ( source, 31, 550 ) 
        giveWeapon ( source, 23, 550 ) 
        giveWeapon ( source, 3, 550 ) 
        giveWeapon ( source, 29, 550 ) 
        giveWeapon ( source, 46, 550 ) 
        giveWeapon ( source, 41, 5000 ) 
end 
end 
end 
addEvent( "onGreeting", true ) 
addEventHandler( "onGreeting", root, aceptarr ) 

Posted

Change 'thePlayer' to 'source'.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

No, it has to be 'root', please think before posting.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i think no need for this

  
createTeam ( "SWAT", 0, 0, 255 ) 
local theTeam = getTeamFromName ( "SWAT" ) 
  

just make it

  
local theTeam = createTeam ( "SWAT", 0, 0, 255 ) 
  

Ingame Name: Arnold

If you need my help, contact me on Skype @bshr.ara

NOTE:DO NOT ASK ME FOR SCRIPTS, ASK ME FOR HELP

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...