I need a firstkill plugin that will show who was killed by whom with what weapon
I know this plugin is possible to write..so please can someone write it for me? It'll be a great help thanx :smile:
I need a firstkill plugin that will show who was killed by whom with what weapon
I know this plugin is possible to write..so please can someone write it for me? It'll be a great help thanx :smile:
Config:
[firstblood]
enabled = 1
message = "^7<PLAYER_NAME> ^1killed ^7<VICTIM_NAME> ^1with ^7<WEAPON> ^1for first blood!"
Have fun its not tested.
<?php
/*
Author: Voices
Config:
[firstblood]
enabled = 1
message = "^7<PLAYER_NAME> ^1killed ^7<VICTIM_NAME> ^1with ^7<WEAPON> ^1for first blood!"
*/
$firstblood = new firstblood();
$mod->registerEvent("playerKill", "triggerFirstblood", $firstblood);
$mod->setDefaultCV("firstblood", "enabled", 0);
$mod->setDefaultCV("firstblood", "message", "^7<PLAYER_NAME> ^1killed ^7<VICTIM_NAME> ^1with ^7<WEAPON> ^1for first blood!");
class firstblood {
    private $players;
    private $mod;
    private $firstblood = false;
    public function __construct() {
        $this->players = &$GLOBALS["players"];
        $this->mod = &$GLOBALS["mod"];
    }
    public function triggerFirstblood($params) {
        list($killer, $victim, $weapon, $damage, $bodypart) = $params;
        if (!$this->mod->getCV("firstblood", "enabled")) {
            return;
        }
        if (!$this->firstblood) {            
            $search = array(
                "<PLAYER_NAME>",
                "<WEAPON>",
                "<VICTIM_NAME>"
            );
            $replace = array (
                $this->players[$player]->getName(),
                $this->mod->getLongWeaponName($weapon),
                $this->players[$victim]->getName()
            );
            $this->mod->rconSay(str_replace($search, $replace, $this->mod->getCV("firstblood", "message")));                
        }
        $this->firstblood = true;    
    }
}
?>@Voices Thanks for making this plugin....but it is sad that its not working ......can you see whats wrong??? :sad: