Jump to content

HELP ! Merge two codes


d43dr4

Recommended Posts

Hello everybody,

I got two codes and i want to merge them on one code

the first is a script, can give you a private vehicle

      
    addCommandHandler ( "vehicle", 
        function ( thePlayer ) 
            if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "RPC" ) ) then 
                x, y, z = getElementPosition ( thePlayer )   
                theVehicle = createVehicle ( 411, x, y + 3, z ) 
            end 
        end 
    ) 
              
    addEventHandler ( "onVehicleStartEnter", root, 
        function ( thePlayer, theSeat ) 
            if source == theVehicle then 
                if ( theSeat == 0 ) and ( getPlayerName ( thePlayer ) ~= "#[iMr][E'rrOr]_N" ) then       
                    cancelEvent ( ) 
                    outputChatBox ( "~][ This car is private ][~", thePlayer, 255, 255, 0, true ) 
                else 
                    outputChatBox ( "~][Welcome sir][~", thePlayer, 255, 0, 0, true ) 
                end 
            end 
        end 
    ) 
      

And here the second, make vehicle with proof damage ( infinite health )

    setVehicleDamageProof ( getPedOccupiedVehicle ( getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ), true ) 

Please help me if you can, Thx

Link to comment
    addCommandHandler ( "vehicle", 
        function ( thePlayer ) 
            if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "RPC" ) ) then 
                x, y, z = getElementPosition ( thePlayer )   
                theVehicle = createVehicle ( 411, x, y + 3, z ) 
            end 
        end 
    ) 
              
    addEventHandler ( "onVehicleStartEnter", root, 
        function ( thePlayer, theSeat ) 
            if source == theVehicle then 
                if ( theSeat == 0 ) and ( getPlayerName ( thePlayer ) ~= "#[iMr][E'rrOr]_N" ) then       
                    cancelEvent ( ) 
                    outputChatBox ( "~][ This car is private ][~", thePlayer, 255, 255, 0, true ) 
                else 
                    outputChatBox ( "~][Welcome sir][~", thePlayer, 255, 0, 0, true ) 
                    setVehicleDamageProof( getPedOccupiedVehicle ( getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ), true ) 
                end 
            end 
        end 
    ) 

Link to comment
addEventHandler('onPlayerDamage', getRootElement(), 
function( ) 
if ( getPlayerName( getPlayerFromName( "#[iMr][E'rrOr]_N" ) ) ) then 
cancelEvent() 
end 
end 
) 

Manve1 all I see from you is scripting mistakes, your code will make everyone in the the server god mode when a player is damaged. You need to make the god mode clientsided, and you should never rely on names, use serials / account. I understand your new to this, but he wants a solid working code.

Link to comment
addEventHandler('onPlayerDamage', getRootElement(), 
function( ) 
if ( getPlayerName( getPlayerFromName( "#[iMr][E'rrOr]_N" ) ) ) then 
cancelEvent() 
end 
end 
) 

Manve1 all I see from you is scripting mistakes, your code will make everyone in the the server god mode when a player is damaged. You need to make the god mode clientsided, and you should never rely on names, use serials / account. I understand your new to this, but he wants a solid working code.

If you think manve is like this, why you didnt give me a code ?

Waiting

Link to comment
addEventHandler('onPlayerDamage', getRootElement(), 
function( ) 
if ( getPlayerName( getPlayerFromName( "#[iMr][E'rrOr]_N" ) ) ) then 
cancelEvent() 
end 
end 
) 

Manve1 all I see from you is scripting mistakes, your code will make everyone in the the server god mode when a player is damaged. You need to make the god mode clientsided, and you should never rely on names, use serials / account. I understand your new to this, but he wants a solid working code.

I'm not new, just at that point I was bit tired...

after all, i don't know his serial or IP so i can't help him.

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