GerardWay Posted April 13, 2013 Posted April 13, 2013 Could anybody make me a quick script that allows an Admin to walk underwater if he types "/water" and then disable it when he types "/water" again please? Thank You so much to anyone who does
xXMADEXx Posted April 13, 2013 Posted April 13, 2013 You can just use "setElementPosition" and, make the position under water somewhere. The Ultimate Lua Tutorial! | MTA PHP SDK
PaiN^ Posted April 13, 2013 Posted April 13, 2013 (edited) Edit : Ok, Let him learn Edited April 13, 2013 by Guest " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
iPrestege Posted April 13, 2013 Posted April 13, 2013 Server addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for _,p in next, getElementsByType ( 'player' ) do local acc = getPlayerAccount ( p ); if isGuestAccount ( acc ) then return end; local accName = getAccountName ( acc ); if isObjectInACLGroup ( 'user.'..accName, aclGetGroup ( 'Admin' ) ) then setElementData ( p, 'isAdmin', true ); end end end ); addEventHandler ( 'onPlayerLogin', root, function ( _,acc ) local accName = getAccountName ( acc ) if isObjectInACLGroup ( 'user.'..accName, aclGetGroup ( 'Admin' ) ) then setElementData ( source, 'isAdmin', true ); end end ); addEventHandler ( 'onPlayerLogout', root, function ( ) setElementData ( source, 'isAdmin', false ); end ); Client function noDamage ( ) if isElementInWater ( localPlayer ) and getElementData ( localPlayer, 'isAdmin' ) == true then cancelEvent ( ); end end cancel = false; addCommandHandler ( 'water', function ( ) if cancel == false then addEventHandler ( 'OnClientPlayerDamage', root, noDamage ); cancel = true; else removeEventHandler ( 'OnClientPlayerDamage', root, noDamage ); end end ); We know you're a professional, but why not let him learn a little bit?
Kenix Posted April 13, 2013 Posted April 13, 2013 #Pai_[N] Your code is nonsense. The Way You Want: Just read a {RoG}xXMADEXx's post. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
PaiN^ Posted April 13, 2013 Posted April 13, 2013 #Pai_[N] Your code is nonsense ... May i ask why ? " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
PaiN^ Posted April 13, 2013 Posted April 13, 2013 On? Because of one mistake, It's nonsense !! I don't think that what he meant .. " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Kenix Posted April 13, 2013 Posted April 13, 2013 (edited) 1) 'OnClientPlayerDamage' event doesn't existed. You should know. Right is 'onClientPlayerDamage' 2) You just cancel damage in water but author this topic wants to walk underwater. Why? So you need just change a position of player. 3) Better storage in element data player's acl group instead of isAdmin/Moderator, ... Edited April 13, 2013 by Guest http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
PaiN^ Posted April 13, 2013 Posted April 13, 2013 1) 'OnClientPlayerDamage' event doesn't existed. You should know. Right is 'onClientPlayerDamage'2) You just cancel damage in water but author this topic wants to walk underwater. About the "On" thing, It's just a typing mistake, But you're right, All i thought about was the damage and not the ability to walk . Abologise =D + Thanx for the info .. " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now