Jump to content

Lua Help!


Recommended Posts

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;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...