Beiträge von Ancestral
-
-
thanks a lot!
-
What happends if I want to check or generate de array with the content of a text file?
Maybe some expert can help, this is a untested idea. (I´m not a programmer)
PHP
Alles anzeigen<?php $mod->registerEvent("playerJoined", "registered_main"); $mod->setDefaultCV("registered", "enabled", 1); $mod->setDefaultCV("registered", "kickreason", "Not allowed to join"); $allowed_users_filehandle = fopen(LOGDIR . "/users.log", "a"); // OPENING THE FILE function registered_main($guid) { global $mod; global $players; global $allowed_users_filehandle; $users = file_get_contents("./log/users.log") // I dont know if this is the right way to put the content of a file in an array or string. // Here we can compare the guid with $users if (strpos($users, $guid) !== false) { $players[$guid]->kick($mod->getCV("registered", "kickreason")); } ?>
If any real programmer can check would be great!
-
update; I tried the example on my server and works fine.
Another quick question, what is the command for say something to the player?
Like !myping , and say to the player his ping.
thanks!
-
Hi all, I´m new to MAM and I have very little programming skills, anybody knows where I can find information on creating new users commands?
Example:
Like !kicklaggers
to call a funtion wicht kick every player with more than 100 ping.I have a php with this
PHP
Alles anzeigen<?php $mod->registerCommand("kickthemall", false, "ktm"); function ktm($param) { kick them all code } ?>
Also any guide on creating custom php plugins is welcome.
thanks!