AeroXbird Posted June 23, 2008 Share Posted June 23, 2008 hey guys, ive got this lil question. Is it possible to give my admins On my server unlimited health Because on my server Where getting a lil Crazy of the cheaters with miniguns and Youre killed before you know it So here the question cane one of you guys please make a code for me Wich i can use to give The ADMINS ONLY unlimited health Regardings, Fatalitry Link to comment
robhol Posted June 23, 2008 Share Posted June 23, 2008 http://development.mtasa.com/index.php? ... ayerDamage should get you going. To prevent damage, use the Loss parameter and give the health back. To prevent abuse, you should only use it if the admin really IS attacked with an illegal weapon. do this with the attackerweapon parameter. Link to comment
Gamesnert Posted June 23, 2008 Share Posted June 23, 2008 I don't really think that was his problem... I think he meant that of that only admins should get it. So check if the player is an admin, and then execute the given script. (I really hope he meant that, I need such a thing too ) Link to comment
DutchCaffeine Posted June 23, 2008 Share Posted June 23, 2008 It's very simple: (get this as an tutorial, and type it over NOT copy, you can learn of it.) local noDeathTimer = nil local noDeathActive = false local maxHealth = 100 local useArmor = false -- The next variable will only be use able if you set useArmour to true local maxArmor = 100 -- Make a function, like this: function toggleNoDeath(toggle) if toggle == true then -- Set a timer: setTimer(string function, time, timeToExecute, [arguments]) noDeathTimer = setTimer("updateHealth", 1000, 0) -- 1000 is one seccond. 0 is unlimeted execute. noDeathActive = true -- This is ready here end if toggle == false then -- Just kill the timer noDeathActive = false killTimer(noDeathTimer) end end function updateHealth() setElementHealth(source, maxHealth) if useArmor == true then setPlayerArmor(source, maxArmor) end end -- Create the command function setNoDeath(source) if source then -- Check for admin, i don't know how. if hasObjectPermissionTo ( playerSource, "function.kickPlayer", false ) then if noDeathActive == true then toggleNoDeath(false) else toggleNoDeath(true) end end end end addCommandHandler("nodeath", getRootElement(), setNoDeath) hope it is helping you! Link to comment
robhol Posted June 23, 2008 Share Posted June 23, 2008 It's very simple: (get this as an tutorial, and type it over NOT copy, you can learn of it.) [...] hope it is helping you! Probably not - miniguns can swat you down from 100armor + 100hp in way less than one second. OnPlayerDamage is more reliable since it can restore the damage as soon as it occurs (in ideal environments, which is to say no lag), it might even be possible to cancel the event itself and then the damage is never even dealt, but i don't know if that's possible with this particular event. Link to comment
eAi Posted June 23, 2008 Share Posted June 23, 2008 Please don't abuse the ACL like that Add your own 'resource.YourResourceName.infinitehealth' ACL right, don't check for kickplayer etc. This allows the admin to configure it so that any group could have infinite health without giving them kickplayer access... Link to comment
Ace_Gambit Posted June 23, 2008 Share Posted June 23, 2008 You can only cancel damage to a player on the client side. Calling cancelEvent() in onClientPlayerDamage will do the trick. Link to comment
robhol Posted June 23, 2008 Share Posted June 23, 2008 You can only cancel damage to a player on the client side. Calling cancelEvent() in onClientPlayerDamage will do the trick. Well, you could do that and remote control it with Events from the server. Or just make it all clientside. Link to comment
AeroXbird Posted June 24, 2008 Author Share Posted June 24, 2008 lol thanks alexander Im going to try it now Maybe It works We'll see Link to comment
AeroXbird Posted June 27, 2008 Author Share Posted June 27, 2008 Noppes Nada nothing didnt worked I tryed to Edit some stuf but it still dousnt work can somebody else Give me an anti cheat script So the Health script isnt needed anymore Link to comment
Playsinator Posted September 24, 2009 Share Posted September 24, 2009 Please don't abuse the ACL like that Add your own 'resource.YourResourceName.infinitehealth' ACL right, don't check for kickplayer etc. This allows the admin to configure it so that any group could have infinite health without giving them kickplayer access... Sorry for opening up an old thread. I do not know if i have understood this: I can set "infinite Health" in the ACL? Then i dont check how. And sorry 2 4 the question, but i am no scripter, so i need your help Playsi PS.: Again i am not perfect in the english language, so please collect the mistakes and sell them ^^ Link to comment
Dark Dragon Posted September 24, 2009 Share Posted September 24, 2009 acl is a list of allowed and disallowed actions for different user types (normal,admin,moderator,[...]) you can script functions which only work for admins,moderators or whatever group of people you want to have. you could also add a "trusted users" list for example, and only make them able to votekick others. the possibilities are up to your imagination. the only thing you'll have to use is hasObjectPermissionTo. Link to comment
Playsinator Posted September 25, 2009 Share Posted September 25, 2009 Well, i am no scripter. Thats why i asked how this can work... to give the Admin infinite health. Is this possible? Playsi Link to comment
Dark Dragon Posted September 25, 2009 Share Posted September 25, 2009 yes it is. you only have to cancelEvent() the onClientPlayerDamage event. but in order to only make this work for admins you should add an acl entry. Link to comment
Playsinator Posted September 25, 2009 Share Posted September 25, 2009 What do you mean? Where do i put the cancel-code in? Playsi PS.: Sorry but i am new here Link to comment
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