Jump to content

Explosive bullets


CapY

Recommended Posts

I have downloaded explosive bullets from community and i want to make it for members only , why this dont work ?

Server:

  
  
function bulletexplosion (hitX, hitY, hitZ) 
    createExplosion ( hitX, hitY, hitZ, 2 ) 
end 
  
addEventHandler("bulletboom",getRootElement(),bulletexplosion) 
  
function ( thePlayer ) 
  
 local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
         
        if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "FGMembers" ) ) then 
            
            addEvent("bulletboom",true) 
            else 
            cancelEvent("bulletboom",true) 
        end 
    end 
)  
  

If client needed i will post it .

Link to comment

Try this:

function bulletexplosion (hitX, hitY, hitZ) 
    createExplosion ( hitX, hitY, hitZ, 2 ) 
end 
  
function ( thePlayer ) 
  
 local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        
        if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "FGMembers" ) ) then 
            
            addEvent("bulletboom",true) 
           addEventHandler("bulletboom",getRootElement(),bulletexplosion) 
        end 
    end 
) 

Link to comment

Jacob , that's dont work.

And event is not triggered to client side ( do i need client anymore? )

Client:

function weaponfired (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
        triggerServerEvent ("bulletboom", source, hitX, hitY, hitZ ) 
end 
  
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer (), weaponfired ) 

And on the server there is error on 5 line . '(name)' expected near '('

Server:

function bulletexplosion (hitX, hitY, hitZ) 
    createExplosion ( hitX, hitY, hitZ, 2 ) 
end 
  
function ( thePlayer ) 
  
 local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        
        if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "FGMembers" ) ) then 
            
            addEvent("bulletboom",true) 
           addEventHandler("bulletboom",getRootElement(),bulletexplosion) 
        end 
    end 
) 

Link to comment

That function is not attached to anything.

here:

function bulletexplosion (hitX, hitY, hitZ) 
    createExplosion ( hitX, hitY, hitZ, 2 ) 
end 
  
addEventHandler("onPlayerLogin", root, 
function ( _, acc ) 
  
 local accName = getAccountName ( acc ) 
        
        if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "FGMembers" ) ) then 
            
            addEvent("bulletboom",true) 
           addEventHandler("bulletboom",getRootElement(),bulletexplosion) 
        end 
    end 
) 

Of course client is needed.

Now the player must log in, and it will check if he's in FGMembers.

Link to comment

Why this trigger doesnt works ?

function bulletexplosion (hitX, hitY, hitZ) 
    triggerClientEvent("weaponfired",weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    createExplosion ( hitX, hitY, hitZ, 2 ) 
end 
  
addEventHandler("onPlayerLogin", root, 
function ( _, acc ) 
  
 local accName = getAccountName ( acc ) 
        
        if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "FGMembers" ) ) then 
            
            addEvent("bulletboom",true) 
           addEventHandler("bulletboom",getRootElement(),bulletexplosion) 
        end 
    end 
) 

Link to comment

What is not good now ?

server:

function bulletexplosion (hitX, hitY, hitZ) 
    triggerClientEvent("onClientPlayerWeaponFire",weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    createExplosion ( hitX, hitY, hitZ, 2 ) 
end 
  
addEventHandler("onPlayerLogin", root, 
function ( _, acc ) 
  
 local accName = getAccountName ( acc ) 
        
        if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "FGMembers" ) ) then 
            
            addEvent("bulletboom",true) 
           addEventHandler("bulletboom",getRootElement(),bulletexplosion) 
        end 
    end 
) 

client:

function weaponfired (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
        triggerServerEvent ("bulletboom", source, hitX, hitY, hitZ ) 
end 
  
addEvent( "onClientPlayerWeaponFire", true ) 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer (), weaponfired ) 

Link to comment

DUDE, what in the world is this.

Here:

server:

function bulletexplosion (hitX, hitY, hitZ) 
    createExplosion ( hitX, hitY, hitZ, 2 ) 
end 
  
addEventHandler("onPlayerLogin", root, 
function ( _, acc ) 
  
 local accName = getAccountName ( acc ) 
        
        if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "FGMembers" ) ) then 
            
            addEvent("bulletboom",true) 
           addEventHandler("bulletboom",getRootElement(),bulletexplosion) 
        end 
    end 
) 

client:

function weaponfired (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
        triggerServerEvent ("bulletboom", source, hitX, hitY, hitZ ) 
end 
addEventHandler ( "onClientPlayerWeaponFire", root, weaponfired ) 

Link to comment

server:

function bulletexplosion (hitX, hitY, hitZ) 
    if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "FGMembers" ) ) then 
         createExplosion ( hitX, hitY, hitZ, 2 ) 
    end 
end 
addEvent("bulletboom",true) 
 addEventHandler("bulletboom",getRootElement(),bulletexplosion) 

client:

function weaponfired (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
        triggerServerEvent ("bulletboom", source, hitX, hitY, hitZ ) 
end 
addEventHandler ( "onClientPlayerWeaponFire", root, weaponfired ) 

Link to comment

Then you are not in FGMembers.

Or you are using a different name from your account name:

server:

function bulletexplosion (hitX, hitY, hitZ) 
    if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "FGMembers" ) ) then 
         createExplosion ( hitX, hitY, hitZ, 2 ) 
    end 
end 
addEvent("bulletboom",true) 
 addEventHandler("bulletboom",getRootElement(),bulletexplosion) 

Link to comment

server:

function bulletexplosion (hitX, hitY, hitZ) 
    if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "FGMembers" ) ) then 
         createExplosion ( hitX, hitY, hitZ, 2 ) 
    end 
end 
addEvent("bulletboom",true) 
 addEventHandler("bulletboom",getRootElement(),bulletexplosion) 

This will check for the player's account name, if it's in FGMembers it should work, if he's in FGMembers.

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