Mbtdaa Posted March 17, 2014 Share Posted March 17, 2014 (edited) 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 March 17, 2014 by Guest Link to comment
JR10 Posted March 17, 2014 Share Posted March 17, 2014 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
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 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
Anubhav Posted March 17, 2014 Share Posted March 17, 2014 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
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 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
JR10 Posted March 17, 2014 Share Posted March 17, 2014 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
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 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
JR10 Posted March 17, 2014 Share Posted March 17, 2014 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
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 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
JR10 Posted March 17, 2014 Share Posted March 17, 2014 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
Anubhav Posted March 17, 2014 Share Posted March 17, 2014 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
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 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
JR10 Posted March 17, 2014 Share Posted March 17, 2014 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
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 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
JR10 Posted March 17, 2014 Share Posted March 17, 2014 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
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 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
JR10 Posted March 17, 2014 Share Posted March 17, 2014 Are you sure that the player logged in with one of the accounts in the table and his serial was different? Anything in /debugscript 3? If not, try explaining what you really want to accomplish. Link to comment
Anubhav Posted March 17, 2014 Share Posted March 17, 2014 Add this to your ACL in Admin Group. Remember to replace the word ResourceName with your resource name. Link to comment
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 ooh i was write a difrrent name in group thx all it's works Link to comment
JR10 Posted March 17, 2014 Share Posted March 17, 2014 You need to change ResourceName to the name of the resource that script is in. Link to comment
Anubhav Posted March 17, 2014 Share Posted March 17, 2014 (edited) Np. EDIT: Even i said to change it. You din't read-__- Edited March 17, 2014 by Guest Link to comment
Mbtdaa Posted March 17, 2014 Author Share Posted March 17, 2014 You need to change ResourceName to the name of the resource that script is in. thx jr for helping Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now