Azortharion Posted November 6, 2012 Share Posted November 6, 2012 (edited) So basically what the title says. I Googled and got to many threads on the forum, copying Castillo's many scripts, and having my friend write a meta.xml for them. (I have no clue of all this). In-game, however, I could get the "Godmode has been Enabled" thingie in the chatbox, but it had no effect. My admin friend and I could still kill each other. We added the resource (called it godmode) to the admin ACL but it did not help. Could someone throw in a script here that includes a command + an Admin-only check? Thanks a lot for helping out tarded me. EDIT: How come /warp and /goto do not work on my server? Can someone add a slash command script, simply "/goto will warp you to their location? Also needing an antiblur script that removes the blur when you drive fast and use nitrous. ALSO needing a one-tap nitrous system (e.g, instead of nitrous charges, I want it to be like NFS-style, you hold it down and release when you want it to stop). -- It's a whole bunch to ask, but I'd kill for those things on my server! Edited November 6, 2012 by Guest Link to comment
Castillo Posted November 6, 2012 Share Posted November 6, 2012 We don't accept requests here, learn to script or pay someone to do it. You could post your current script and see if we can find the problem. Link to comment
Azortharion Posted November 6, 2012 Author Share Posted November 6, 2012 We don't accept requests here, learn to script or pay someone to do it.You could post your current script and see if we can find the problem. Well alright, written by yourself under "server" and "client", I called the script files simply "server.lua,", and "client.lua". For the godmode: server: function toggleGodMode(thePlayer) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if getElementData(thePlayer,"invincible") then setElementData(thePlayer,"invincible",false) outputChatBox("God Mode is now Disabled.",thePlayer,0,255,0) else setElementData(thePlayer,"invincible",true) outputChatBox("God Mode is now Enabled.",thePlayer,0,255,0) end end end addCommandHandler("godmode",toggleGodMode) Client: addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(source,"invincible") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"invincible") then cancelEvent() end end) And the meta.xml my friend made: <meta> <script src="client.lua" /> <script src="server.lua" /> </meta> Link to comment
xTravax Posted November 6, 2012 Share Posted November 6, 2012 i think i have forgotten to write client side or server side in meta..i forgot how to do it..damn(im hux) Link to comment
Castillo Posted November 6, 2012 Share Posted November 6, 2012 Exactly, the client script has to be defined as client side in meta.xml P.S: function toggleGodMode ( thePlayer ) local account = getPlayerAccount ( thePlayer ) if ( not account or isGuestAccount ( account ) ) then return end local accountName = getAccountName ( account ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then local state = ( not getElementData ( thePlayer, "invincible" ) ) setElementData ( thePlayer, "invincible", state ) outputChatBox ( "God Mode is now ".. ( state and "Enabled" or "Disabled" ) ..".", thePlayer, 0, 255, 0 ) end end addCommandHandler ( "godmode", toggleGodMode ) same script, but "improved". Link to comment
Azortharion Posted November 6, 2012 Author Share Posted November 6, 2012 Thank you, Castillo! So unlike the ones who created the old threads and got it working, I'm gonna explain others who seek help how to do it: here is everything you need: server.lua file (edit in notepad, save as .lua) function toggleGodMode ( thePlayer ) local account = getPlayerAccount ( thePlayer ) if ( not account or isGuestAccount ( account ) ) then return end local accountName = getAccountName ( account ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then local state = ( not getElementData ( thePlayer, "invincible" ) ) setElementData ( thePlayer, "invincible", state ) outputChatBox ( "God Mode is now ".. ( state and "Enabled" or "Disabled" ) ..".", thePlayer, 0, 255, 0 ) end end addCommandHandler ( "godmode", toggleGodMode ) Client.lua (same procedure, put this in notepad and save as client.lua addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(source,"invincible") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"invincible") then cancelEvent() end end) Next create "meta.xml", same procedure, only you save as "meta.xml" now: Put them all in a .zip (NOT .RAR) document and upload to your server. Thanks a lot again. Link to comment
50p Posted November 7, 2012 Share Posted November 7, 2012 https://community.multitheftauto.com/index.php?p= ... ils&id=427 Link to comment
xTravax Posted November 7, 2012 Share Posted November 7, 2012 https://community.multitheftauto.com/index.php?p=resources&s=details&id=427 This is for Freeroam Server,not race. Link to comment
50p Posted November 7, 2012 Share Posted November 7, 2012 https://community.multitheftauto.com/index.php?p=resources&s=details&id=427 This is for Freeroam Server,not race. ...ALSO needing a one-tap nitrous system (e.g, instead of nitrous charges, I want it to be like NFS-style, you hold it down and release when you want it to stop). -- It's a whole bunch to ask, but I'd kill for those things on my server! Link to comment
xTravax Posted November 7, 2012 Share Posted November 7, 2012 https://community.multitheftauto.com/index.php?p=resources&s=details&id=427 This is for Freeroam Server,not race. ...ALSO needing a one-tap nitrous system (e.g, instead of nitrous charges, I want it to be like NFS-style, you hold it down and release when you want it to stop). -- It's a whole bunch to ask, but I'd kill for those things on my server! I'm not retarded.he wants nitro holding system for Freeroam hes my damn friend. Link to comment
Azortharion Posted November 7, 2012 Author Share Posted November 7, 2012 https://community.multitheftauto.com/index.php?p=resources&s=details&id=427 This is for Freeroam Server,not race. ...ALSO needing a one-tap nitrous system (e.g, instead of nitrous charges, I want it to be like NFS-style, you hold it down and release when you want it to stop). -- It's a whole bunch to ask, but I'd kill for those things on my server! It is a freeroam server, I did not mention it was a race server in that quote at all. 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