Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

Script LUA

- - - - -

  • Please log in to reply
8 replies to this topic

#1
OFFLINE   PIPICHE

PIPICHE

    Member

  • Members
  • PipPip
  • 22 posts
3
A step in the right direction
  • LocationMarseille France
Good morning.
I use a LUA script to make the protection of tag and other uses (custom sounds, ect).
This script is based on the level of player. but it appears that the guid is different depending on silent because this script runs on NQ but not on the Silent.
I put the main lines.
Thank you for telling me that do not agree.
Thank you in advance


function Player.Connect(Slot)
	local player = {}
	--setmetatable(player,Player)
player.Slot=Slot
player.Country=et.gentity_get(Slot, "sess.uci")
player.ProfileName = et.Info_ValueForKey(et.trap_GetUserinfo(Slot), "name")
player.Name="" --Sera renseigne apres
player.Password = et.Info_ValueForKey(et.trap_GetUserinfo(Slot), "password")
player.IP = et.Info_ValueForKey( et.trap_GetUserinfo(Slot ), "ip" )
player.GUID = et.Info_ValueForKey( et.trap_GetUserinfo(Slot ), "cl_guid" )
player.Team =et.gentity_get(Slot, "sess.sessionTeam")
player.Level = et.G_shrubbot_level( Slot )
player.ConnectTime=os.time()
player.EnterTime=os.time()
player.TagViolation=false
player.Alias={}
--Enleve le port
player.IP=string.match(player.IP,"(.*)%:")
	return player
end
function Player.IsSame(ancien)
--Recupere le GUID actuel
local guid=et.Info_ValueForKey( et.trap_GetUserinfo(ancien.Slot ), "cl_guid" )
-- Joueur different ou absent
if guid ~= ancien.GUID then
  return false
end
return true;
end

Edited by PIPICHE, 21 March 2012 - 11:28 AM.


#2
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland
Untested but I would think changing "cl_guid" fields into "sil_guid" might make it work. The cl_guid should work also for those players that have the PunkBuster enabled in the client side.

#3
OFFLINE   PIPICHE

PIPICHE

    Member

  • Members
  • PipPip
  • 22 posts
3
A step in the right direction
  • LocationMarseille France
Hi
I thank you for your quick response.
unfortunately this is not the right solution.
I myself try for testing by enabling punkbuster on my side but there is nothing and if I put the variable that you ask me to change it does not work more.
I am taking other ideas!
thank you

#4
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland
Maybe you could post the whole script for a look. One thing that comes to mind is that the mod has not yet determined the level of the player when the Connect is called. Because of the silent guid, the players are attached to the database records little later then they were before.

#5
OFFLINE   Sol

Sol

    Regular Member

  • Coders
  • PipPipPip
  • 113 posts
28
On a distinguished road
  • LocationPoland
Like gao said, changing "cl_guid" fields into "sil_guid" is the best solution, and It's your best and simplest solution.

#6
OFFLINE   PIPICHE

PIPICHE

    Member

  • Members
  • PipPip
  • 22 posts
3
A step in the right direction
  • LocationMarseille France
Hello I joined more information about my script.
I changed what you told me in cl_guid sil_guid but it did not work either

function Player.Connect(Slot)
	local player = {}
	--setmetatable(player,Player)
player.Slot=Slot
player.Country=et.gentity_get(Slot, "sess.uci")
player.ProfileName = et.Info_ValueForKey(et.trap_GetUserinfo(Slot), "name")
player.Name="" --Sera renseigne apres
player.Password = et.Info_ValueForKey(et.trap_GetUserinfo(Slot), "password")
player.IP = et.Info_ValueForKey( et.trap_GetUserinfo(Slot ), "ip" )
player.GUID = et.Info_ValueForKey( et.trap_GetUserinfo(Slot ), "cl_guid" )
player.Team =et.gentity_get(Slot, "sess.sessionTeam")
player.Level = et.G_shrubbot_level( Slot )
player.ConnectTime=os.time()
player.EnterTime=os.time()
player.TagViolation=false
player.Alias={}
--Enleve le port
player.IP=string.match(player.IP,"(.*)%:")
	return player
end
function Player.IsSame(ancien)
--Recupere le GUID actuel
local guid=et.Info_ValueForKey( et.trap_GetUserinfo(ancien.Slot ), "cl_guid" )


StartLevelOfTagProtection=3

if isNewName then
  -- Protection tag Team
  local wocolor=string.lower(et.Q_CleanStr(name))

  -- Interception de certains nom de joueurs qui resistent aux bans (non ip fixe)
  if wocolor=="demonen" then
   et.trap_DropClient( cno, "Your IP isn't valid!", 180 )
  end
  --interception team NDK
  local res=string.match(wocolor,"^ndk ")
  if res~=nil then
   et.trap_DropClient( cno, "Team Banned.", 180 )
  end
  res=string.match(wocolor,"^%*ndk%*")
  if res~=nil then
   et.trap_DropClient( cno, "Team Banned.", 180 )
  end

  res=string.match(wocolor,"(m)([^a-z]?)(t)(.?)(c)")
  if res~=nil then
   if Players[cno].Level<StartLevelOfTagProtection then
	Players[cno].TagViolation=true
	et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("!rename \"%d ^1<^8TIPIAK^1>\"\n",cno ))
	et.G_globalSound( "sound/weapons/radio/callArty_axis.wav")
   end
  end
  -- Protection tag BOT
  res=string.match(wocolor,"(%[bot%])")
  if res~=nil then
   if Players[cno].Level<StartLevelOfTagProtection then
	et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("!rename \"%d %s\"\n",cno,Players[cno].Alias[1] ))
	et.G_globalSound( "sound/weapons/radio/callArty_axis.wav")
   end
  end
end

My script makes sure that if a person does not have the level 3 if he puts his name to our "tag" I renamed it to "Tipiak"
it works on the NQ not Silent.
even worse with me a superadmin level 7 if I put on a private slot I renamed "Tipiak" but if I go with a level 0 on a normal slot nothing happens?
I confess that I understand anything can you help me?

Edited by PIPICHE, 29 March 2012 - 02:46 PM.


#7
OFFLINE   PIPICHE

PIPICHE

    Member

  • Members
  • PipPip
  • 22 posts
3
A step in the right direction
  • LocationMarseille France

Hello I joined more information about my script.
I changed what you told me in cl_guid sil_guid but it did not work either

function Player.Connect(Slot)
	local player = {}
	--setmetatable(player,Player)
player.Slot=Slot
player.Country=et.gentity_get(Slot, "sess.uci")
player.ProfileName = et.Info_ValueForKey(et.trap_GetUserinfo(Slot), "name")
player.Name="" --Sera renseigne apres
player.Password = et.Info_ValueForKey(et.trap_GetUserinfo(Slot), "password")
player.IP = et.Info_ValueForKey( et.trap_GetUserinfo(Slot ), "ip" )
player.GUID = et.Info_ValueForKey( et.trap_GetUserinfo(Slot ), "cl_guid" )
player.Team =et.gentity_get(Slot, "sess.sessionTeam")
player.Level = et.G_shrubbot_level( Slot )
player.ConnectTime=os.time()
player.EnterTime=os.time()
player.TagViolation=false
player.Alias={}
--Enleve le port
player.IP=string.match(player.IP,"(.*)%:")
	return player
end
function Player.IsSame(ancien)
--Recupere le GUID actuel
local guid=et.Info_ValueForKey( et.trap_GetUserinfo(ancien.Slot ), "cl_guid" )


StartLevelOfTagProtection=3

if isNewName then
  -- Protection tag Team
  local wocolor=string.lower(et.Q_CleanStr(name))

  -- Interception de certains nom de joueurs qui resistent aux bans (non ip fixe)
  if wocolor=="demonen" then
   et.trap_DropClient( cno, "Your IP isn't valid!", 180 )
  end
  --interception team NDK
  local res=string.match(wocolor,"^ndk ")
  if res~=nil then
   et.trap_DropClient( cno, "Team Banned.", 180 )
  end
  res=string.match(wocolor,"^%*ndk%*")
  if res~=nil then
   et.trap_DropClient( cno, "Team Banned.", 180 )
  end

  res=string.match(wocolor,"(m)([^a-z]?)(t)(.?)(c)")
  if res~=nil then
   if Players[cno].Level<StartLevelOfTagProtection then
	Players[cno].TagViolation=true
	et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("!rename \"%d ^1<^8TIPIAK^1>\"\n",cno ))
	et.G_globalSound( "sound/weapons/radio/callArty_axis.wav")
   end
  end
  -- Protection tag BOT
  res=string.match(wocolor,"(%[bot%])")
  if res~=nil then
   if Players[cno].Level<StartLevelOfTagProtection then
	et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("!rename \"%d %s\"\n",cno,Players[cno].Alias[1] ))
	et.G_globalSound( "sound/weapons/radio/callArty_axis.wav")
   end
  end
end

My script makes sure that if a person does not have the level 3 if he puts his name to our "tag" I renamed it to "Tipiak"
it works on the NQ not Silent.
even worse with me a superadmin level 7 if I put on a private slot I renamed "Tipiak" but if I go with a level 0 on a normal slot nothing happens?
I confess that I understand anything can you help me?


Hello I joined more information about my script.
I changed what you told me in cl_guid sil_guid but it did not work either

function Player.Connect(Slot)
	local player = {}
	--setmetatable(player,Player)
player.Slot=Slot
player.Country=et.gentity_get(Slot, "sess.uci")
player.ProfileName = et.Info_ValueForKey(et.trap_GetUserinfo(Slot), "name")
player.Name="" --Sera renseigne apres
player.Password = et.Info_ValueForKey(et.trap_GetUserinfo(Slot), "password")
player.IP = et.Info_ValueForKey( et.trap_GetUserinfo(Slot ), "ip" )
player.GUID = et.Info_ValueForKey( et.trap_GetUserinfo(Slot ), "cl_guid" )
player.Team =et.gentity_get(Slot, "sess.sessionTeam")
player.Level = et.G_shrubbot_level( Slot )
player.ConnectTime=os.time()
player.EnterTime=os.time()
player.TagViolation=false
player.Alias={}
--Enleve le port
player.IP=string.match(player.IP,"(.*)%:")
	return player
end
function Player.IsSame(ancien)
--Recupere le GUID actuel
local guid=et.Info_ValueForKey( et.trap_GetUserinfo(ancien.Slot ), "cl_guid" )


StartLevelOfTagProtection=3

if isNewName then
  -- Protection tag Team
  local wocolor=string.lower(et.Q_CleanStr(name))

  -- Interception de certains nom de joueurs qui resistent aux bans (non ip fixe)
  if wocolor=="demonen" then
   et.trap_DropClient( cno, "Your IP isn't valid!", 180 )
  end
  --interception team NDK
  local res=string.match(wocolor,"^ndk ")
  if res~=nil then
   et.trap_DropClient( cno, "Team Banned.", 180 )
  end
  res=string.match(wocolor,"^%*ndk%*")
  if res~=nil then
   et.trap_DropClient( cno, "Team Banned.", 180 )
  end

  res=string.match(wocolor,"(m)([^a-z]?)(t)(.?)(c)")
  if res~=nil then
   if Players[cno].Level<StartLevelOfTagProtection then
	Players[cno].TagViolation=true
	et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("!rename \"%d ^1<^8TIPIAK^1>\"\n",cno ))
	et.G_globalSound( "sound/weapons/radio/callArty_axis.wav")
   end
  end
  -- Protection tag BOT
  res=string.match(wocolor,"(%[bot%])")
  if res~=nil then
   if Players[cno].Level<StartLevelOfTagProtection then
	et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("!rename \"%d %s\"\n",cno,Players[cno].Alias[1] ))
	et.G_globalSound( "sound/weapons/radio/callArty_axis.wav")
   end
  end
end

My script makes sure that if a person does not have the level 3 if he puts his name to our "tag" I renamed it to "Tipiak"
it works on the NQ not Silent.
even worse with me a superadmin level 7 if I put on a private slot I renamed "Tipiak" but if I go with a level 0 on a normal slot nothing happens?
I confess that I understand anything can you help me?


Even this simple command does not return the correct information.
It returns well my number slot but not my level!

Tools.PrintToConsoleClient(cno,string.format("\031 ^x[DEBUG INFO.]Level #%d",Players[cno].Level))
	Tools.PrintToConsoleClient(cno,string.format("\031 ^x[DEBUG INFO.]Slot #%d",Players[cno].Slot))


#8
OFFLINE   Sol

Sol

    Regular Member

  • Coders
  • PipPipPip
  • 113 posts
28
On a distinguished road
  • LocationPoland

Even this simple command does not return the correct information.
It returns well my number slot but not my level!

Players[cno].Level

I don't see Players declaration, could you show all the code?

Edited by Sol, 02 April 2012 - 12:35 PM.


#9
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

I really hate to bump this, but i've had this problem before, here is a simple fix that i use.

 

local sguid = string.sub(string.upper(et.Info_ValueForKey( et.trap_GetUserinfo( client ), "sil_guid" )), 1, 32)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users