Looking for how to add the team the killer was on.
thank you.
Looking for how to add the team the killer was on.
thank you.
What do you want exactly?
Kick if killer used a restricted weapon on a certain team "allies"
like this maybe, Where have the if to look $team and see if it = allies. thanks
function weaponrestrictions_main($parameters) {
global $mod;
global $players;
global $logging;
list($killer_guid, $victim_guid, $weapon, $team) = $parameters;
if (!$mod->getCV("weaponrestrictions", "enabled")) {
return;
}
if ($players[$killer_guid]->isProtected()) {
return;
}
if ($team == "allies" ) {
$players[$killer_guid]->weaponrestrictions_warns ++;
$weaponlong = $mod->getLongWeaponName($weapon);
if ($players[$killer_guid]->weaponrestrictions_warns >= $mod->getCV("weaponrestrictions", "warnstokick")) {
switch ($mod->getCV("weaponrestrictions", "mode")) {
case "tempban":
$players[$killer_guid]->tempBan(str_replace("", $weaponlong, $mod->getCV("weaponrestrictions", "kickreason1")));
break;
case "kick":
$players[$killer_guid]->kick(str_replace("", $weaponlong, $mod->getCV("weaponrestrictions", "kickreason1")));
break;
case "ban":
$players[$killer_guid]->ban(str_replace("", $weaponlong, $mod->getCV("weaponrestrictions", "kickreason1")));
break;
}
}
else {
$players[$killer_guid]->say($mod->getLngString("usedRestrictedWeapon", array("", "", ""), array($weaponlong, $players[$killer_guid]->weaponrestrictions_warns, $mod->getCV("weaponrestrictions", "warnstokick"))));
$logging->write(MOD_NOTICE, "Player '".$players[$killer_guid]->getName()."' has been warned for using restricted weapon: $weapon, PID: ".$players[$killer_guid]->getPID().", GUID: ".$killer_guid);
}
}
Alles anzeigen