Jump to content

Ayuda con mi script!


Flipi

Recommended Posts

Necesito ayuda con mi script, se trata de que un grupo de ACL tiene acceso a armas, mientras que los que no pertenecen al grupo no pueden acceder a esas armas.

armas = { 
[38] = true ; 
[35] = true ; 
[36] = true ; 
[37] = true ; 
[16] = true ; 
[17] = true ; 
[18] = true ; 
[39] = true ; 
  
function antiweapon ( previousWeaponID, currentWeaponID ) 
    if ( armas[getElementModel ( source )] ) and ( seat == 0 ) then 
        local weapon = getWeaponNameFromID ( currentWeaponID ) 
        local accountName = getAccountName ( getPlayerAccount ( player ) ) 
        if ( not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Secret" ) ) ) then 
            cancelEvent ( ) 
  outputChatBox("Estas armas son solo para ~Secret Option~", thePlayer, 0,128,255, true) 
        end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", root, antiweapon ) 

Link to comment
armas = { 
[38] = true ; 
[35] = true ; 
[36] = true ; 
[37] = true ; 
[16] = true ; 
[17] = true ; 
[18] = true ; 
[39] = true  
} 
  
function antiweapon ( previousWeaponID, currentWeaponID, thePlayer ) 
    if ( armas[getElementModel ( thePlayer )] ) and ( seat == 0 ) then 
     local accName = getAccountName ( getPlayerAccount ( thePlayer ) )  
     if  ( not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Secret" ) ) then 
            cancelEvent ( ) 
  outputChatBox("Estas armas son solo para ~Secret Option~", thePlayer, 0,128,255, true) 
        end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", root, antiweapon ) 

Link to comment
armas = { 
[38] = true, 
[35] = true, 
[36] = true, 
[37] = true, 
[16] = true, 
[17] = true, 
[18] = true, 
[39] = true 
 } 
function antiweapon ( previousWeaponID, currentWeaponID ) 
    if ( armas[ currentWeaponID ] ) then 
        if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Secret" ) ) ) then 
            cancelEvent ( ) 
            outputChatBox("Estas armas son solo para ~Secret Option~", source, 0,128,255, true) 
        end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", root, antiweapon ) 

Pero creo que mejor sería evitar que dispare poniendo en false el toggleControl

Link to comment

Pero donde se pondria el togglecontrol? asi?

armas = { 
[38] = true, 
[35] = true, 
[36] = true, 
[37] = true, 
[16] = true, 
[17] = true, 
[18] = true, 
[39] = true 
 } 
function antiweapon ( previousWeaponID, currentWeaponID ) 
    if ( armas[ currentWeaponID ] ) then 
            toggleControl ( source, "fire", false ) 
        if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Secret" ) ) ) then 
            cancelEvent ( ) 
            outputChatBox("Estas armas son solo para ~Secret Option~", source, 0,128,255, true) 
        end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", root, antiweapon ) 

Link to comment
armas = { 
[38] = true, 
[35] = true, 
[36] = true, 
[37] = true, 
[16] = true, 
[17] = true, 
[18] = true, 
[39] = true 
 } 
function antiweapon ( previousWeaponID, currentWeaponID, source) 
    if ( armas[ currentWeaponID ] ) then 
        if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Secret" ) ) ) then 
            cancelEvent ( ) 
                        toggleControl ( source, "fire", false ) 
            outputChatBox("Estas armas son solo para ~Secret Option~", source, 0,128,255, true) 
        end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", root, antiweapon ) 

Link to comment
armas = { 
[38] = true, 
[35] = true, 
[36] = true, 
[37] = true, 
[16] = true, 
[17] = true, 
[18] = true, 
[39] = true 
 } 
function antiweapon ( previousWeaponID, currentWeaponID, source) 
    if ( armas[ currentWeaponID ] ) then 
     local accName = getAccountName ( getPlayerAccount ( source ) ) 
     if ( not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Secret" ) ) ) then 
            cancelEvent ( ) 
                        toggleControl ( source, "fire", false ) 
            outputChatBox("Estas armas son solo para ~Secret Option~", source, 0,128,255, true) 
        end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", root, antiweapon ) 

Link to comment
  • Recently Browsing   0 members

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