Jump to content

Player GodMode Function?


Recommended Posts

Posted

You must cancel that event, is not only way.

You can use a command handler client side of course.

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

That's not what he want's, he want's a command to enable/disable God Mode.

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

Well here is my script to ask you if it will work

function togdamage ( attacker, weapon, bodypart ) 
    if ( weapon == 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 or 11 or 12 or 13 or 14 or 15 or 16 or 17 or 18 or 19 or 20 or 21 or 22 or 23 or 24 or 25 or 26 or 27 or 28 or 29 or 30 or 31 or 32 or 33 or 34 or 35 or 36 or 37 or 38 or 39 or 40 ) then 
        cancelEvent() 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), togdamage ) 
addCommandHandler ("godmode",togdamage)   

Posted
local godModeState = false 
  
addCommandHandler ( "godmode", 
    function ( ) 
        godModeState = ( not godModeState ) 
        outputChatBox ( "God Mode is now ".. ( godModeState and "Enabled" or "Disabled" ) ..".", 0, 255, 0 ) 
    end 
) 
  
function togdamage ( attacker, weapon, bodypart ) 
    if ( godModeState ) then 
        cancelEvent ( ) 
    end 
end 
addEventHandler ( "onClientPlayerDamage", localPlayer, togdamage ) 

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
if ( weapon == 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 or 11 or 12 or 13 or 14 or 15 or 16 or 17 or 18 or 19 or 20 or 21 or 22 or 23 or 24 or 25 or 26 or 27 or 28 or 29 or 30 or 31 or 32 or 33 or 34 or 35 or 36 or 37 or 38 or 39 or 40 ) 

WTF? It will be better, not?

if (weapon =< 40) then 

Software Engineer & Entrepreneur Running Lustrel and VilarikA • Highly engaged on open source community

Posted

This condition doesn't exists

=<
Syntax error.

It's correct.

if weapon >= 0 and weapon <= 40 then 

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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