Jump to content

Script LUA


PIPICHE

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Management
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.
Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

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))

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 years later...

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...