• GodMode
    4 replies, posted
Alright I have 2 questions. 1. Why isnt code working? It wont enable/disable godmode on me. 2. How can I make it a toggleable command. [code] local function ccGodModeOn( ply ) if not ply:HasPriv(ADMIN) then ply:PrintMessage(2, string.format(LANGUAGE.need_admin, "rp_godmodeon")) return end if ply:HasPriv(ADMIN) then ply:GodEnable() end end concommand.Add("rp_godmodeon", ccGodModeOn) local function ccGodModeOff( ply ) if not ply:HasPriv(ADMIN) then ply:PrintMessage(2, string.format(LANGUAGE.need_admin, "rp_godmodeoff")) return end if ply:HasPriv(ADMIN) then ply:GodDisable() end end concommand.Add("rp_godmodeon", ccGodModeOff) [/code]
why not post us with the erorrs?
[QUOTE=dingusnin;24776539]why not post us with the erorrs?[/QUOTE] There are none. I just spawn an NPC and it kills meh.
i was writing the code , but then mah browser quit on me , i cba now , i am watching moovie :P
[QUOTE=Bubka3;24776060]:words:[/QUOTE] [lua] local function ccGodModeOn( ply ) if not ply:HasPriv(ADMIN) then ply:PrintMessage(2, string.format("You need admin for this %s",LANGUAGE.need_admin)) return false elseif ply:HasPriv(ADMIN) then ply:GodEnable() end end concommand.Add("+rp_godmode", ccGodModeOn) local function ccGodModeOff( ply ) if not ply:HasPriv(ADMIN) then ply:PrintMessage(2, string.format("You need admin for this %s",LANGUAGE.need_admin)) return false elseif ply:HasPriv(ADMIN) then ply:GodDisable() end end concommand.Add("-rp_godmode", ccGodModeOff)[/lua] You will have to hold the key doing it this way if you want it to toggle.
Sorry, you need to Log In to post a reply to this thread.