Jump to content

Help wanted please ...


d43dr4

Recommended Posts

Posted

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

Just Smile !

Posted

You can create a command to turn your vehicle with damage proof with the following functions:

addCommandHandler 
getPedOccupiedVehicle 
setVehicleDamageProof 

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

Show us what you tried.

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 Type setVehicleDamageProof and i press on server

On chat showed : Command executed! Result: function: 03B02CA8

But the vehicle health still decreased ..

Just Smile !

Posted

Because that's not what you have to do, you have to get the vehicle of the player you are trying to set the damage proof to.

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

You can do this:

setVehicleDamageProof ( getPedOccupiedVehicle ( getPlayerFromName ( "INSERTPLAYERNAME" ) ), true ) 

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

Thx Castillo , now how to change the name ( name that shown on players stomache ) ^^

Or how to make this vehicle private for me ( If someone try to enter said : this is not yous )

Just Smile !

Posted

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 
  
  

delta.png

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