bentleymta Posted February 6, 2016 Share Posted February 6, 2016 (edited) in my server I faced a problem. Players send spam with renames nicknames. Example: Lua code joinquit: g_Root = getRootElement() countryNames = { AD="Andorra", AE="Arabia", AF="Afghanistan", AG="Antigua and Barbuda", AI="Anguilla", AL="Albania", AM="Armenia", AN="Netherlands Antilles", AO="Angola", AP="Asia", AR="Argentina", AS="American Samoa", AT="Austria", AU="Australia", AW="Aruba", AZ="Azerbaijan", BA="Bosnia and Herzegovina", BB="Barbados", BD="Bangladesh", BE="Belgium", BF="Burkina Faso", BG="Bulgaria", BH="Bahrain", BI="Burundi", BJ="Benin", BM="Bermuda", BN="Brunei Darussalam", BO="Bolivia", BR="Brazil", BS="Bahamas", BT="Bhutan", BW="Botswana", BY="Belarus", BZ="Belize", CA="Canada", CD="Congo The Democratic", CF="Central African Republic", CH="Switzerland", CI="Ivory Coast ", CK="Cook Islands", CL="Chile", CM="Cameroon", CN="China", CO="Colombia", CR="Costa Rica", CS="Serbia and Montenegro", CU="Cuba", CY="CY", CZ="Czech Republic", DE="Germany", DJ="Djibouti", DK="Denmark", DO="Dominican Republic", DZ="Algeria", EC="Ecuador", EE="Estonia", EG="Egypt", ER="Eritrea", ES="Spain", ET="Ethiopia", EU="Europa", FI="Finland", FJ="Fiji (Fiyi)", FM="Micronesia, Federal States", FO="Faeroe Islands", FR="France", GA="Gabon", GB="United Kingdom", GD="Grenada", GE="Georgia", GF="French Guiana", GH="Ghana", GI="GibraItar", GL="Greenland", GM="Gambia", GR="Greece", GT="Guatemala", GU="Guam", GW="Guinea", GY="Guyana", HK="Hong Kong", HN="Honduras", HR="Croatia (Croacia)", HT="Haiti", HU="Hungary (Hungria)", ID="Indonesia", IE="Ireland (Irlanda)", IL="Israel", IN="India", IO="India Ocean", IQ="Iraq", IR="Iran", IS="Iceland (Islandia)", IT="Italy (Italia)", JM="Jamaica", JO="Jordan (Jordania)", JP="Japan (Japon)", KE="Kenya (Kenia)", KG="Kyrgyzstan", KH="Cambodia (Cambolla)", KI="Kiribati", KN="Saint Kitts And Nevis", KR="Korea", KW="Kuwait", KY="Cayman Islands", KZ="Kazakhstan", LA="Democratic Republic", LB="Lebanon", LC="Santa Lucia", LI="Liechtenstein", LK="Sri Lanka", LR="Liberia", LS="Lesotho", LT="LithuaniaI", LU="Luxembourg", LV="Latvia (Letonia)", LY="Libya (Libia)", MA="Morocco (Marruecos)", MC="Monaco", MD="Moldova", MG="Madagascar", MK="MK", ML="Mali", MM="Myanmar", MN="Mongolia", MO="Macau", MP="MP", MR="Mauritania", MT="Malta", MU="Mauricio", MV="Maldivas", MW="Malawi", MX="Mexico", MY="Malaysia", MZ="Mozambique", NA="NAMIBIA", NC="New Caledonia", NE="Nigger", NF="Norfolk Island", NG="Nigeria", NI="Nicaragua", NL="Netherlands", NO="Norway", NP="Nepal", NR="Nauru", NU="Niue", NZ="New Zealand", OM="Oman", PA="Panama", PE="Peru", PF="French Polynesia", PG="Papua New Guinea", PH="Philippines", PK="Pakistan", PL="Poland (Polonia)", PR="Puerto Rico", PS="Palestinian territories", PT="Portugal", PW="Palau", PY="Paraguay", QA="Qatar", RO="Romania", RU="Russian", RW="Rwanda", SA="Saudi Arabian", SB="Solomon Islands", SC="Seychelles", SD="Sudan", SE="Sweden", SG="Singapore", SI="Slovenia", SK="Slovak Republic", SL="Sierra Leone", SM="San Marino", SN="Senegal", SR="Suriname", SV="El Salvador", SY="Syrian Arab Republic", SZ="Swaziland", TG="Togo", TH="Thailand", TJ="Tajikistan", TM="Turkmenistan", TN="Tunisia", TO="Tonga", TR="Turkey", TT="Trinidad Tobago", TV="Tuvalu", TW="Taiwan Province China", TZ="Tanzania", UA="Ukraine", UG="Uganda", US="United States", UY="Uruguay", UZ="Uzbekistan", VA="Vatican City", VE="Venezuela", VG="Virgin Islands (British)", VI="Virgin Islands (U.S.)", VN="Vietnam", VU="Vanuatu", WS="Samoa", YE="Yemen", YU="Formally Yugoslavia", ZA="South Africa", ZM="Zambia", ZW="Zimbabwe", ZZ="Reserved" } addEventHandler('onPlayerJoin',g_Root, function () local country = exports['admin']:getPlayerCountry(source) setElementData(source,'Country',country) outputChatBox('#fefefe' .. getPlayerName(source) .. '#ff5000 Has Joined To Server. #ffffff[#fefefe' .. countryNames[tostring(country)] .. '#ffffff] ', getRootElement(), 2, 255, 2, true) end ) addEventHandler('onPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('#ffffff[#fefefeChange-Nick#ffffff] #fefefe' .. oldNick .. ' #ff5000 is now known #fefefe' .. newNick, getRootElement(), 3, 180, 255, true) end ) addEventHandler('onPlayerQuit', g_Root, function(reason) outputChatBox('#ffffff[#fefefe' .. reason .. '#ffffff] #fefefe' .. getPlayerName(source) .. ' #ff5000 Has Left The Game.', getRootElement(), 255, 0, 0, true) end ) I will be grateful if you help me, thanks Edited February 7, 2016 by Guest Link to comment
SpecT Posted February 6, 2016 Share Posted February 6, 2016 Check the Admin resource. Link to comment
Tomas Posted February 6, 2016 Share Posted February 6, 2016 antispam = {} addEventHandler('onPlayerChangeNick', g_Root, function(oldNick, newNick) if ( not isTimer(antispam[source]) ) then outputChatBox('#ffffff[#fefefeChange-Nick#ffffff] #fefefe' .. oldNick .. ' #ff5000 is now known #fefefe' .. newNick, getRootElement(), 3, 180, 255, true) setTimer(function(p) antispam[p] = true end, 5000, 1, source) end end ) Link to comment
bentleymta Posted February 7, 2016 Author Share Posted February 7, 2016 I solved problem. 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