tested my server Thanks works fine
but If another player enters the same name. how to kick?
Beiträge von codclubtr
-
-
sorry google translate:
player name write of the file whitelist.lst
guid number, not writing
Is it possible to -
I am from Turkey
regestered.php oyuncunun guid numarasına göre sunucuya alıyor veya sunucudan atıyor.Bunu oyuncunun ismine (nick) göre yapabilirmiyiz.Call of duty 2 de maalesef pb guid üretemiyor.Cod4 ve cod5 de pb guid numarası çıkıyor.whitelist.lst dosyasını veya regestered.php yi oyuncunun ismine göre ayarlayabilirmiyiz?
-
Can we in this mode, the player names not by guid number.Because players, this guid number does not cod2 server
-
PHP
Alles anzeigen$mod->registerEvent("playerJoined", "registered_main"); $mod->setDefaultCV("registered", "enabled", 1); $mod->setDefaultCV("registered", "kickreason", "Molimo registrajte se na www.h8breed.com"); $file = $configdir . "plugins/whitelist.lst"; // path to your file, place it in your configfolder into folder plugins $results = explode(",", file_get_contents($file)); $whitelist = array(); foreach($results as $result) { $whitelist[] = trim($result); } function registered_main($guid) { global $mod, $players; $usersreg = array("guid","guid","guid"); if($mod->getCV("registered", "enabled") == 0) { return; } if (!in_array($guid, $whitelist)) { $players[$guid]->kick($mod->getCV("registered", "kickreason")); } }
I did like the following
Code
Alles anzeigen$mod->registerEvent("playerJoined", "registered_main"); $mod->setDefaultCV("registered", "enabled", 1); $mod->setDefaultCV("registered", "kickreason", "Molimo registrajte se na www.h8breed.com"); $file = $configdir . "plugins/whitelist.lst"; // path to your file, place it in your configfolder into folder plugins $results = explode(",", file_get_contents($file)); $whitelist = array(); foreach($results as $result) { $whitelist[] = trim($result); } function registered_main($guid) { global $mod, $players; $usersreg = array("96c0e9e8","guid","guid"); if($mod->getCV("registered", "enabled") == 0) { return; } if (!in_array($guid, $whitelist)) { $players[$guid]->kick($mod->getCV("registered", "kickreason")); } }
I created the folder configplugins into the directory adminmod and I created the file into whitelist.lst
whitelist.lst I have written to the file number of the guid (96c0e9e8)
joined server and I received this error in ssh
[12.03.11 14:00:22] Notice: Player '^1player' joined, PID: 2, GUID: 0
[12.03.11 14:00:22] PHP-Error: Notice in home/xxxxx/.gameservers/cod2_9/adminmod/plugins/registered.php:21 => Un defined variable: whitelist
[12.03.11 14:00:22] PHP-Error: Warning in home/xxxx/.gameservers/cod2_9/adminmod/plugins/registered.php:21 => i n_array(): Wrong datatype for second argument
[12.03.11 14:00:22] !! Warning: ConfigVar [registered]kickreason NOT set, using default: 'Molimo registrajte se n a https://www.gsmanager.de/www.h8breed.com'
[12.03.11 14:00:22] Notice: Player '^1player' got kicked (by: MOD), reason: Molimo registrajte se na www.h 8breed.com, PID: 2, GUID: 0
[12.03.11 14:00:23] Notice: Player '^1player' quit, PID: 2, GUID: 0
-
Hi all;
badwordlist player joined nameprotection pingkicker and welcomemessages does not work.How to fix?Code
Alles anzeigen[main] ip = "95.1********" port = ********* logfile = "**************" rconpassword = "********" timezone = "Europe/Berlin" prefix = "!" language = "en" antispam = 2 logrcon = 0 antistartupbug = "" fixguidrelax = 1 pmprefix = "" responsefailcmds = 0 [kickban] defaultkickreason = "^1Admin Tarafindan Kicklendiniz" defaultbanreason = "^1Admin Tarafindan Banlandiniz" usepb = 0 pbtempbanduration = 5 announce = 1 maxtempbantime = 1440 [welcomemessages] enabled = 1 master = "^1Dikkatt:^7<PLAYER_NAME>^1 oyuna girdi!" admin = "^2Hosgeldiniz^7<PLAYER_NAME>^1 oyuna girdi!" member = "^2Hosgeldiniz ^7<PLAYER_NAME>^2" user = "^2Hosgeldiniz ^7<PLAYER_NAME>^2" default = "^2Hosgeldiniz ^7<PLAYER_NAME>" whisper = 2 [banner] enabled = 1 time = 120 [randommapcycle] enabled = 0 maps = "<maps.cfg>" gametypes = "war" notlastmaps = 3 notlastgt = 1 [badwords] enabled = 1 warnstokick = 1 mode = "kick" kickreason = "COLOR-|FOX|SUNUCULARINDA KUFUR YASAKTIR.ARTIK BUNU OGRENIN" [warns] enabled = 1 warnstokick = 2 mode = "kick" kickreason = "" [pingkicker] enabled = 1 maxping = 250 checkinterval = 30 warnstokick = 2 mode = "kick" kickreason = "Kusura bakma pingin cok yüksek" [nameprotection] enabled = 1 badnamekick = 1 badnamekickmode = "kick" badnamekickreason = "Isminizde yasak kelimeler var: <PART>" adminnamekick = 0 adminnamekickmode = "kick" adminnamekickreason = "Adminle ismin ayni.Degistir" maxnamechanges = 1 maxnamechangeskickmode = "kick" maxnamechangeskickreason = "Max. isim degistirme limitini astin" uppercasedisallow = 0 uppercasekickreason = "Please do not use only upper case letters in your nickname" uppercasekickmode = "kick" [modstuff] checkforupdates = 1 checkinterval = 6 announceinterval = 5 serverlist = 1 serverlistip = "********************" [customcommands] pbsay = "pb_sv_say -1 <ARG>" kickme = "pb_sv_kick <PLAYER:PBID> 0 <ARG:OPT:You kicked yourself>" payback = "pb_sv_kick <LAST_KILLER:PBID> 0 ^1NEVER KILL AN ADMIN!" [spreemessages_config] enabled = 1 firstblood = 1 killsprees = 1 deathsprees = 1 spreeendsfrom = 10 multikills = 1 spreeends = 1 [spreemessages_messages] firstblood = "^7<PLAYER_NAME> ^1drew first blood!" multikill = "^7!! ^1Multikill ^7> ^2<PLAYER_NAME>^7 < ^1Multikill^7 !!" monsterkill = "^7!!!! ^1MONSTERKILL ^7>>> ^2<PLAYER_NAME>^7 <<< ^1MONSTER KILL ^7!!!!" end_kill = "^2<PLAYER_NAME>^1's killing spree ended (^2<KILLS> ^1kills). He was killed by ^3<KILLER_NAME>^1!" end_teamkill = "^2<PLAYER_NAME>^1's killing spree ended (^2<KILLS> ^1kills). He was killed by TEAMMATE ^3<KILLER_NAME>^1!" end_selfkill = "^2<PLAYER_NAME>^1's killing spree ended (^2<KILLS> ^1kills). He killed ^3himself^1, what a pity!" 5 = "^7<PLAYER_NAME> ^1is on a ^3killing spree! ^1(^2<KILLS> ^1kills in a row)" 10 = "^7<PLAYER_NAME> ^1is on a ^3rampage! ^1(^2<KILLS> ^1kills in a row)" 15 = "^7<PLAYER_NAME> ^1is ^3dominating! ^1(^2<KILLS> ^1kills in a row)" 20 = "^7<PLAYER_NAME> ^1is ^3unstoppable! ^1(^2<KILLS> ^1kills in a row)" 25 = "^7<PLAYER_NAME> ^1is ^3godlike!! ^1(^2<KILLS> ^1kills in a row)" 30 = "^7<PLAYER_NAME> ^1is ^3wicked sick!!! ^1(^2<KILLS> ^1kills in a row)" 35 = "^7<PLAYER_NAME> ^1is ^3real Potter!!! ^1(Woohoo, ^2<KILLS> ^1kills in a row!)" -10 = "^7<PLAYER_NAME> ^1seems to have a bad day ... (^2<DEATHS>^1 deaths without a ^2kill^1)" -15 = "^7<PLAYER_NAME> ^1is on the best way to get ^3victim^1 of the day... (^2<DEATHS> ^1deaths w/o ^2kill^1)" -20 = "^7<PLAYER_NAME> ^1really gets his ^3ass kicked!^1 Oh well, ^2<DEATHS> ^1deaths without a ^2kill^1..." [mapvote] enabled = 0 type = 2 mapcount = 3 duration = 620 announce = 90 maps = "<maps.cfg>" gametypes = "surv" notlastmaps = 5 notlastgt = 1 votestoskip = "50%" [weaponrestrictions] enabled = 0 weapons = "gl,frag_grenade_short" warnstokick = 2 mode = "tempban" kickreason = "Used a restricted weapon: <WEAPON>" [statistics] statsstring = "^2Kills: <KILLS> ^1Deaths: <DEATHS> ^3K/D: <KPD> ^2time: <ONLINETIME> min ^3K/M: <KPM> ^2HS: <HEADSHOTS> ^7TKs: <TEAMKILLS>" whisperstats = 0 savestats = "mysql" [antiteamkiller] enabled = 0 min = -3 start = 0 warn = 3 kick = 4 teamkill = 1 kill = 0.1 mode = "tempban" kickreason = "Made too many teamkills" forgive = 1 forgivetime = 30 forgivepoints = 0.5 [aliases] k = "kick" b = "ban" rm = "quitmod" mr = "quitmod" setlevel = "setgroup" admincheck = "checkadmin" owned = "fun owned" pwned = "fun owned" killed = "fun killed" bye = "fun bye" pizza = "fun pizza" beer = "fun beer" coke = "fun coke" whoiam = "fun whoiam" groups = "setgroup listgroups dummy" f = "forgive" y = "yes" n = "no" j = "yes" ja = "yes" nein = "no" votekick = "vote kick" votemap = "vote map" voteban = "vote ban" banlist = "pbbanlist" unban = "pbunban" godmode = "fun godmode" aimbot = "fun aimbot" sex = "fun sex" kamikaze = "fun kamikaze" death = "fun death" bigadmin = "fun bigadmin" off = "readconfig off" on = "readconfig" [funmessages] enabled = 1 killed = "^7<PLAYER_NAME> ^1was last killed by ^7<PLAYER_LASTKILLER> ^1with a ^7<PLAYER_LASTWEAPONDEATH>" owned = "^7<PLAYER_NAME> ^1killed ^7<PLAYER_LASTVICTIM> ^1with a ^7<PLAYER_LASTWEAPONKILL>" bye = "^7<PLAYER_NAME>^2 waves his hand to say ^1GOOD BYE^2. We surely meet later!" pizza = "^2Someone calls Mario and he brings ^7<PLAYER_NAME>^2 a hot pepperoni pizza!" beer = "^2A nice sexy waitress brings ^7<PLAYER_NAME>^2 a nice pint of beer!" coke = "^2Ah... A delicious glass of cold Coca Cola[tm] (*thinks ^7<PLAYER_NAME>^2 while he's drinking*)" whoiam = "^2My name is ^7<PLAYER_NAME>^2, I'm in the team ^7<PLAYER_TEAM>^2 with a ^7<PLAYER_LASTWEAPONKILL>^2 and have ^7<PLAYER_KILLS>^2 Kills" godmode = "^1GODMODE^2 is now enabled for player ^7<PLAYER_NAME>" aimbot = "^3<PLAYER_NAME> ^2turned on his ^1AIM-BOT!" sex = "^2SEX is not the answer. SEX is the question and ^7<PLAYER_NAME> ^2is the answer!!" kamikaze = "^7<PLAYER_NAME> ^2is desperately trying to figure out why kamikaze pilots wore helmets." death = "^2Hello ^7<PLAYER_NAME>^2, this is ^7Death. ^2Please answer when you're ready." bigadmin = "^1Ooooooh, ^3Big Admin is watching ^1YOU!" [voting] enabled = 0 duration = 45 interval = 120 annouce = 15 minplayers = 3 maxvotesperplayer = 2 timelimit = 0 ignoremapchange = 0 allowkick = 1 allowban = 1 allowmap = 1 allownextmap = 1 allowsetnextmap = 1 allowgametype = 1 allowhardcore = 1 allowrestart = 1 allowedmaps = "<maps.cfg>" allowedgametypes = "war,dom,koth,dm,sab,sd" banduration = 0 [ftp] enabled = 0 host = "95******" port = 22 user = "k*****" password = "el*******" passive = 1 [tcp_query] enabled = 1 ip = "95******" port = 1337 logintimeout = 30 defaulaction = "say" sayprefix = "^3TCP-Admin (<ADMIN>): ^7" admingroups = "master,admin" disallowedcommands = "vote,yes,no,stats,session" maxconnections = 5 [statistics_mysql] host = "localhost" user = "******" password = "******" database = "manu" prefix = "mam01_"
-
thanks but now new error
[07.12.10 21:22:46] Notice: Player '^1|FOX|^9-^3Dayi' joined, PID: 2, GUID: 0
[07.12.10 21:22:46] PHP-Error: Catchable Fatal Error in home/foxpink/.gameserver s/cod2_9/adminmod/plugins/registered.php:13 => Object of class player could not be converted to string -
I found the error
but now this error
[07.12.10 21:05:22] Notice: Player '^1|FOX|^9-^3Dayi' joined, PID: 2, GUID: 0
[07.12.10 21:05:22] PHP-Error: Notice in home/foxpink/.gameservers/cod2_9/adminmod/plugins/registered.php:13 => Undefined variable: Guid
[07.12.10 21:05:22] PHP-Error: Notice in home/foxpink/.gameservers/cod2_9/adminmod/plugins/registered.php:13 => Undefined index: -
the now gives this error
Parse error: syntax error, unexpected $end in /home/foxpink/.gameservers/cod2_9/adminmod/plugins/registered.php on line 22
PHP
Alles anzeigen<?php $mod->registerEvent("playerJoined", "registered_main"); $mod->setDefaultCV("registered", "enabled", 1); $mod->setDefaultCV("registered", "kickreason", "Not allowed to join"); function registered_main($guid) { global $mod; global $players; $allowed = array("32fcafa"); if(in_array("$players[$Guid]",$allowed)) { return; } else { $players[$guid]->kick($mod->getCV("registered", "kickreason")); } ?>
-
PHP
Alles anzeigen<?php $mod->registerEvent("playerJoined", "registered_main"); $mod->setDefaultCV("registered", "enabled", 1); $mod->setDefaultCV("registered", "kickreason", "Not allowed to join"); function registered_main($guid) { global $mod; global $players $allowed = array("32fcafa"); if(in_array("$players[$Guid]",$allowed)) { return; } else { $players[$guid]->kick($mod->getCV("registered", "kickreason")); } ?>
error
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/foxpink/.gameservers/cod2_9/adminmod/plugins/registered.php on line 10
how to fix?
-
Thanks [Huhn] Killer
but, guid number of players that will be written where -
Only registered users will enter the server not encrypted
-
I only want registered players
to be able to access the game. I figured the best way to do that would
be to restrict the players based on GUID. Is there any way to do that? thanks