Jump to content

Problem "SerialCheked"


Mbtdaa

Recommended Posts

hi whats the problem with that code?

 serials = { 
maznn= ["7C27DEB93C7DCE0FEDF877294A46C084"] 
mazn = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
max = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
khald = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
a7md = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
 } 
           
function antiUser() 
for k,v in pairs (serials) do 
 local serials = getPlayerSerial (source) 
 if ( getAccountName(getPlayerAccount(source)) == "serials" ) then 
  if ( serials ) then 
            outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   banSerial( nil, nil, serials, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 
  
  

maznn= ["7C27DEB93C7DCE0FEDF877294A46C084"] 
mazn = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
max = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
khald = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
a7md = ["7C27DEB93C7DCE0FEDF877294A46C084"] 

users - serials

[2014-03-17 13:18:28] SCRIPT ERROR: serial\cod_server.lua:2: unexpected symbol near '[' 
Loading script failed: serial\cod_server.lua:2: unexpected symbol near '[' 
  
' 

Edited by Guest
Link to comment
serials = { 
maznn= ["7C27DEB93C7DCE0FEDF877294A46C084"] 
mazn = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
max = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
khald = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
a7md = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
 } 

Your table is syntactically wrong, should be:

serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 

And your script doesn't make sense and you're missing an end, also banSerial is deprecated and you should use addBan instead, try this:

serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 
          
function antiUser() 
for k,v in pairs (serials) do 
 local serial = getPlayerSerial (source) 
 if (serial == v) then 
     outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   addBan( nil, nil, serial, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 

Link to comment
banPlayer not serial.

[2014-03-17 13:21:58] ERROR: Loading script failed: serial\cod_server.lua:2: unexpected symbol near '[' 

serials = { 
maznn= ["7C27DEB93C7DCE0FEDF877294A46C084"] 
mazn = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
max = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
khald = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
a7md = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
 } 
          
function antiUser() 
for k,v in pairs (serials) do 
 local serials = getPlayerSerial (source) 
 if ( getAccountName(getPlayerAccount(source)) == "serials" ) then 
  if ( serials ) then 
            outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   banPlayer( nil, nil, serials, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 
  
  

Link to comment
  
serials = { 
maznn= ["7C27DEB93C7DCE0FEDF877294A46C084"], 
mazn = ["7C27DEB93C7DCE0FEDF877294A46C084"], 
max = ["7C27DEB93C7DCE0FEDF877294A46C084"], 
khald = ["7C27DEB93C7DCE0FEDF877294A46C084"], 
a7md = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
 } 
          
function antiUser() 
for k,v in pairs (serials) do 
 local serials = getPlayerSerial (source) 
 if ( getAccountName(getPlayerAccount(source)) == "serials" ) then 
  if ( serials ) then 
            outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   banPlayer( nil, nil, serials, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 
  

Link to comment
  
serials = { 
maznn= ["7C27DEB93C7DCE0FEDF877294A46C084"], 
mazn = ["7C27DEB93C7DCE0FEDF877294A46C084"], 
max = ["7C27DEB93C7DCE0FEDF877294A46C084"], 
khald = ["7C27DEB93C7DCE0FEDF877294A46C084"], 
a7md = ["7C27DEB93C7DCE0FEDF877294A46C084"] 
 } 
          
function antiUser() 
for k,v in pairs (serials) do 
 local serials = getPlayerSerial (source) 
 if ( getAccountName(getPlayerAccount(source)) == "serials" ) then 
  if ( serials ) then 
            outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   banPlayer( nil, nil, serials, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 
  

same problem

ERROR: Loading script failed: serial\cod_server.lua:2: unexpected symbol near '[' 

Link to comment

Your code is not going to work. He's comparing an account name against the string 'serials' which doesn't make any sense. Please, stop helping unless you know what you're doing, as what you're doing can be taken as a way to increase your post count. And as you can see, I've already posted a code for him to try.

For the OP, check what I posted above.

Link to comment
Your code is not going to work. He's comparing an account name against the string 'serials' which doesn't make any sense. Please, stop helping unless you know what you're doing, as what you're doing can be taken as a way to increase your post count. And as you can see, I've already posted a code for him to try.

For the OP, check what I posted above.

oK JR what function i need

to do that?

Link to comment

It was meant for Anubhav, try this code:

serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 
          
function antiUser() 
for k,v in pairs (serials) do 
 local serial = getPlayerSerial (source) 
 if (serial == v) then 
     outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   addBan( nil, nil, serial, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 

Link to comment
It was meant for Anubhav, try this code:
serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 
          
function antiUser() 
for k,v in pairs (serials) do 
 local serial = getPlayerSerial (source) 
 if (serial == v) then 
     outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   addBan( nil, nil, serial, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 

thx jr but it's work for any user log adman guest any .. and it's no have band

Link to comment

Not sure I fully get you but, if you want to show the player's name who just logged in then getPlayerName will help you. If you want to show the name of the serial in the table then, in the loop, k will represent the name. For example, the first time the loop runs, k will equals to 'maznn' and v will equal to the serial.

serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 
          
function antiUser() 
for k,v in pairs (serials) do 
 local serial = getPlayerSerial (source) 
 if (serial == v) then 
     outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
     outputChatBox("Your name is "..k, source) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   addBan( nil, nil, serial, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 

Link to comment

I found a better code on wiki.

  
{ 
[ 'maznn' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
[ 'mazn' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
[ 'max' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
[ 'khald' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
[ 'a7md' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
} 
  
addEventHandler ( 'onPlayerLogin', getRootElement ( ), 
    function ( _, theCurrentAccount ) 
    local Serial = Firewall[getAccountName(theCurrentAccount)] 
        if ( Serial ) then 
            if Serial ~= getPlayerSerial ( source ) then 
                banPlayer ( source, false, false, true, getRootElement ( ), 'bye bye You'r not' ) 
            end 
        end 
    end 
) 
  
  
 

Maybe this will work.

Link to comment
I found a better code on wiki.
  
{ 
[ 'maznn' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
[ 'mazn' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
[ 'max' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
[ 'khald' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
[ 'a7md' ] = "7C27DEB93C7DCE0FEDF877294A46C084", 
} 
  
addEventHandler ( 'onPlayerLogin', getRootElement ( ), 
    function ( _, theCurrentAccount ) 
    local Serial = Firewall[getAccountName(theCurrentAccount)] 
        if ( Serial ) then 
            if Serial ~= getPlayerSerial ( source ) then 
                banPlayer ( source, false, false, true, getRootElement ( ), 'bye bye You'r not' ) 
            end 
        end 
    end 
) 
  
  
  
 

Maybe this will work.

no't working

Link to comment

The code won't work. I now understand what you need, try this:

serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 
          
function antiUser(_, acc) 
local name = getAccountName(acc) 
 local serial = getPlayerSerial (source) 
if (serials[name]) then 
    if (serial == serials[name]) then 
     outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   addBan( nil, nil, serial, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 

Link to comment
Not sure I fully get you but, if you want to show the player's name who just logged in then getPlayerName will help you. If you want to show the name of the serial in the table then, in the loop, k will represent the name. For example, the first time the loop runs, k will equals to 'maznn' and v will equal to the serial.
serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 
          
function antiUser() 
for k,v in pairs (serials) do 
 local serial = getPlayerSerial (source) 
 if (serial == v) then 
     outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
     outputChatBox("Your name is "..k, source) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   addBan( nil, nil, serial, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 

it's working for all users jr and the player not have band if he log

Link to comment

Yes, I didn't really understand what you wanted. Try the code in my last post.

Here it is:

serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 
          
function antiUser(_, acc) 
local name = getAccountName(acc) 
 local serial = getPlayerSerial (source) 
if (serials[name]) then 
    if (serial == serials[name]) then 
     outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   addBan( nil, nil, serial, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 

Link to comment
Yes, I didn't really understand what you wanted. Try the code in my last post.

Here it is:

serials = { 
maznn= "7C27DEB93C7DCE0FEDF877294A46C084", 
mazn = "7C27DEB93C7DCE0FEDF877294A46C084", 
max = "7C27DEB93C7DCE0FEDF877294A46C084", 
khald = "7C27DEB93C7DCE0FEDF877294A46C084", 
a7md = "7C27DEB93C7DCE0FEDF877294A46C084", 
 } 
          
function antiUser(_, acc) 
local name = getAccountName(acc) 
 local serial = getPlayerSerial (source) 
if (serials[name]) then 
    if (serial == serials[name]) then 
     outputChatBox ( "#FF0000* #00C4FFSerial was checked it is", getRootElement(), 0, 255, 0, true ) 
  else 
   outputChatBox ( "** Warning ** #FFff00he is Tradition and not", getRootElement(), 255, 0, 0, true ) 
   addBan( nil, nil, serial, source, "bye bye You'r not"  ) 
  end 
 end 
end 
addEventHandler("onPlayerLogin",root,antiUser) 

I'm sorry to bother you, but the player did not band for log =(

WARNING: serial\cod_server.lua:17: Access denied @ 'addBan' 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...