plugin name : admins report
its report for admins when they reporting name when this player quit and joined anytime its will send msg for admins
commands : !safe <name> clear reports for players
                 : !rp <name> <reason>
config :
[reortForAdmins]
success = "^2Thanks For Report"
alreadyreported = "^2This Player Already in Report list"
clearreports = "^2All Reports Cleard For This player"
i can't upload the php idk why so here is the plugin
Spoiler anzeigen
PHP
		
					
				<?php
    //---------------------------------------------------------
    // Name : GumGes
    // SITE : http://www.manuadminmod.de/
    // PLUG-IN LOCATION : 
    //---------------------------------------------------------
    //CONFIG.cfg :
    //---------------------------------------------------------
        //[reortForAdmins]
        //success = "^2Thanks For Report"
        //alreadyreported = "^2This Player Already in Report list" ==> note : when admin try to report some one he is already in list it will say that 
        //clearreports = "^2All Reports Cleard For This player"
    //---------------------------------------------------------
    //FILES :
    //---------------------------------------------------------
        $fp = fopen(LOGDIR . "/adminsreport.log", "a");
        $fpsafe = fopen(LOGDIR . "/inSAFE.log", "a");
    //---------------------------------------------------------
    // COMMANDS : 
    //---------------------------------------------------------
        $mod->registerCommand("rp",false,"adminsReport");
        $mod->registerCommand("safe",false,"playerIsSafe");
    //---------------------------------------------------------    
    //CHECK :
    //---------------------------------------------------------
        $mod->registerEvent("playerJoined","checks");
    //---------------------------------------------------------
    // MESSAGES : 
    //---------------------------------------------------------
    $mod->SetDefaultCV("reortForAdmins","success","^2Your Report Saved");
    $mod->SetDefaultCV("reortForAdmins","alreadyreported","^2This player Already in Report list");
    $mod->SetDefaultCV("reortForAdmins","clearreports","^2This player now have 0 reports");
    $mod->SetDefaultCV("reortForAdmins","alreadycleard","^2This player Alread Cleard");
    //---------------------------------------------------------
        function adminsReport($guid,$parameters){
            global $mod;
            global $players;
            $search = array_shift($parameters);
            $reason = implode(" ",$parameters);
            $found = $mod->findPlayerGuid($search);
            if($found){
                if(!empty($reason)){
                    $open = fopen(LOGDIR . "/adminsreport.log", "r");
                    $read = fread($open,5000);
                    $exs = explode("\n",$read);
                    $searching = array_search($found,$exs);
                    if($searching !== false){
                        $players[$guid]->say($mod->getCV("reortForAdmins","alreadyreported"));
                    }else{
                        $players[$guid]->say($mod->getCV("reortForAdmins","success"));
                        $adminname = $players[$guid]->getName();
                        $thetarget = $players[$found]->getName();
                        $open = fopen(LOGDIR . "/adminsreport.log", "a");
                        $post = "$found\n$adminname\n$thetarget\n$reason";
                        fwrite($open,$post);
                        fclose($open);
                        return true;
                    }
                }
            }else{
                        $players[$guid]->say($mod->getLngString("playerNotFound", array("<SEARCH>"), array($search)));
                }
        }
    function playerIsSafe($guid,$parameters){
        global $mod;
        global $players;
        $name = implode(" ",$parameters);
        $found = $mod->findPlayerGuid($name);
        if($found){
                $thefile = fopen(LOGDIR . "/adminsreport.log", "r");
                $gg = fread($thefile,5000);
                $inarr = explode("\n",$gg);
                $should = array_search($found,$inarr);
                if($should !== false){
                    $fpsafes = fopen(LOGDIR . "/inSAFE.log", "r");
                    $fl = fread($fpsafes,5000);
                    $safearr = explode("\n",$fl);
                    $se = array_search($found,$safearr);
                    if($se !== false){
                        $players[$guid]->say($mod->getCV("reortForAdmins","alreadycleard"));
                    }else{
                        $players[$guid]->say($mod->getCV("reortForAdmins","clearreports"));
                        $posting = "$found\n";
                        $fpsafes = fopen(LOGDIR . "/inSAFE.log", "a");
                        fwrite($fpsafes,$posting);
                        fclose($fpsafes);
                        return true;
                    }
                }else{
                }
        }else{
            $players[$guid]->say($mod->getLngString("playerNotFound", array("<SEARCH>"), array($name)));
        }
    }
        function checks($guid){
            global $mod;
            global $players;
            $fastfp = fopen(LOGDIR . "/adminsreport.log", "r");
            $getthis = fread($fastfp,5000);
            $arr2 = explode("\n",$getthis);
            $againstart = array_search($guid,$arr2);
            if($againstart !== false){
                $fpsafe = fopen(LOGDIR . "/inSAFE.log", "r");
                $gget = fread($fpsafe,5000);
                $arrsf = explode("\n",$gget);
                $safesearch = array_search($guid,$arrsf);
                if($safesearch !== true){
                        $admins = $mod->getAdmins();
                        $online = array();
                foreach ($admins as $adminguid => $admin){
                    if (array_key_exists($adminguid, $players)) {
                    //here i make new fastfp i know i have up i can use it but make new one with new line better 
                        $fastfps = fopen(LOGDIR . "/adminsreport.log", "r");
                        $reading = fread($fastfps,5000);
                        $array = explode("\n",$reading);
                        $key = array_keys($array,$guid);
                        foreach($key as $keys => $value){
                            //mykey = reason and name and adminname reporter
                            $adminreporter = $value + 1;
                            $theplayername = $value + 2;
                            $reas = $value + 3;
                            $safes = fopen(LOGDIR . "/inSAFE.log", "r");
                            $readin = fread($safes,5000);
                            $arrays = explode("\n",$readin);
                            $geting = array_search($guid,$arrays);
                    }
                    if($geting === false){
                    $players[$adminguid]->say("^2 ".$array[$theplayername]." ^3Reported by ^1 ".$array[$adminreporter]." ^2Reason : ".$array[$reas]);
                        }
                }    
            }
        }
    }
}
?>
	
			Alles anzeigen