PurpleLePro Posted April 12, 2013 Share Posted April 12, 2013 So today i was trying to do a few things with lua and just messing around with it but i think something is wrong yet i can't figure it out.. Modname = "asd" Version = "asd" Author = "asd" donguids = { "SilentGuid", } function et_InitGame(levelTime,randomSeed,restart) maxclients = tonumber( et.trap_Cvar_Get( "sv_maxClients" ) ) et.RegisterModname(Modname .. " by "..Author.." " .. Version) end function et_ClientCommand(client, command) local sguid = et.gentity_get(client, "sess.guid") local cmd = string.lower(command) if sguid == table.getn(donguids) then if cmd == "don1" then et.trap_SendServerCommand(client, "print \"You are a donator! \n") end else et.trap_SendServerCommand(client, "print \"^1You are not a Donator, Donate to the server to use these commands! \n") end What im trying to do is to check the users Silent Guid(silentID) then check if there ID is is the donguids table then if so allow them to use the command, if not tell them you are not a donator. But each time i try it out it just auto prints outs et.trap_SendServerCommand(client, "print \"^1You are not a Donator, Donate to the server to use these commands! \n") Does anyone have any ideas or suggestions? Would appreciate it thanks c; Quote Link to comment Share on other sites More sharing options...
Dragonji Posted April 12, 2013 Share Posted April 12, 2013 (edited) Check what sguid returns, you may be surprised.et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("chat %s ^8<- full sguid\n", sguid)) Edited April 12, 2013 by Dragonji Quote Link to comment Share on other sites More sharing options...
PurpleLePro Posted April 12, 2013 Author Share Posted April 12, 2013 Thanks now i know whats wrong, total mishap on my part c; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.