Jump to content

Help wanted please ...


d43dr4

Recommended Posts

Hello guys ...

How r yah !

I want to ask about some codes ...

a friend comes to my server and he asked me for an admin must have Resources Tag

I give him , and after i see a wonderful thing

He spawn a vehicle had infinity Health and dont explode never ..

and throw too many grenades , set his name arabic

________________________________________________________________________

When i asked him he give me this code but he didnt tell me how to do it ( about vehicle ) :

SetVehicleDamageProof 

I searched on wiki , but i dont know how to do it ?

please teach me this

and how to do the other actions ( Without create a script and add to server )

Thx ..

Link to comment

Hi I made a nice version which you can do /collide [which player you should collide] [yes or no] and only admins can set collisions on and off!

It might not work though cause I made it in school and didn't have a chance to test it! If it doesn't work just tell me so I can get home and fix it. ( Credits go to NeXTreme for making the : getPlayerFromParticalName(thePlayerName) which is usefull so you don't have to put the exact name ) Also make sure the ends and elses are correctly because I kind of rushed! It is server side :D Here :

  
-- Damage proof Script for by *Delta^# -- 
  
addCommandHandler ( "collide", 
    function ( player, command, playerName, check )  
        if ( isObjectInACLGroup( "user." .. getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Admin" ) ) ) then 
            if ( playerName and check ) then 
                if (getPlayerFromParticalName (playerName)) then 
                    whichPlayer = (getPlayerFromParticalName (playerName)) 
                    vehicle = getPedOccupiedVehicle ( whichPlayer ) 
                    if ( check == "yes" ) then 
                        damagetrue = setVehicleDamageProof ( vehicle, true ) 
                        if ( damagetrue ) then 
                            outputChatBox ( "#ff8900[iNFO] #ffffffYou have became damage proof by #ff8900"..player, whichPlayer, 255, 137, 0, true ) 
                            outputChatBox ( "#ff8900[iNFO] #ffffffYou have successfully made #ff8900"..whichPlayer.. "#ffffff damage proof", player, 255, 137, 0, true ) 
                        end 
                    elseif ( check == "no" ) then 
                        if ( damagetrue ) then  
                            damagefalse = setVehicleDamageProof ( vehicle, false ) 
                            if ( damagefalse ) then 
                                outputChatBox ( "#ff8900[iNFO] #ffffffYou have unbecame damage proof by #ff8900"..player, whichPlayer, 255, 137, 0, true ) 
                                outputChatBox ( "#ff8900[iNFO] #ffffffYou have successfully made #ff8900"..whichPlayer.. "#ffffff undamage proof", player, 255, 137, 0, true ) 
                            end 
                        else                 
                            outputChatBox ( "#ff8900[iNFO] #ffffffPlayer is already undamage proof!", player, 255, 137, 0, true ) 
                        end 
                    else 
                        outputChatBox ( "#ff8900[iNFO] #ffffffIncorect syntax : #ff8900/collide [player] [yes/no]", player, 255, 137, 0, true ) 
                    end 
                else 
                    outputChatBox ( "#ff8900[iNFO] #ffffffCannot find player : #ff8900 "..playerName, player, 255, 137, 0, true ) 
                end 
            else 
                outputChatBox ( "#ff8900[iNFO] #ffffffIncorect syntax : #ff8900/collide [player] [yes/no]", player, 255, 137, 0, true ) 
            end 
        else 
            outputChatBox ( "#ff8900[iNFO] #ffffffYou are not an Administrator therefore you cannot access this command!", player, 255, 137, 0, true ) 
        end 
    end 
) 
  
function getPlayerFromParticalName(thePlayerName) 
    local thePlayer = getPlayerFromName(thePlayerName) 
    if thePlayer then 
        return thePlayer 
    end 
    for _,thePlayer in ipairs(getElementsByType("player")) do 
        if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then 
            return thePlayer 
        end 
    end 
return false 
end 
  
  

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