mirror of
https://github.com/PhantomGamesDevelopment/TWM2.git
synced 2026-03-02 20:10:31 +00:00
Change set 10/11
Adds all of the progress as of 10/11. NOTE: Do not run the mod right now as there are a lot of features that won't work (IE: Player Zombies, All Zombie Types other than Normal).
This commit is contained in:
parent
9a456d079b
commit
739d77d1e2
37 changed files with 1689 additions and 746 deletions
710
scripts/admin.cs
710
scripts/admin.cs
|
|
@ -13,6 +13,8 @@ $VoteMessage["VoteGreedMode", 0] = "enable Hoard Mode";
|
|||
$VoteMessage["VoteGreedMode", 1] = "disable Hoard Mode";
|
||||
$VoteMessage["VoteHoardMode", 0] = "enable Greed Mode";
|
||||
$VoteMessage["VoteHoardMode", 1] = "disable Greed Mode";
|
||||
$VoteMessage["VoteLivingWorldMode", 0] = "enable Living World Mode";
|
||||
$VoteMessage["VoteLivingWorldMode", 1] = "disable Living World Mode";
|
||||
// JTL
|
||||
$VoteMessage["VotePurebuild", 0] = "enable pure building";
|
||||
$VoteMessage["VotePurebuild", 1] = "disable pure building";
|
||||
|
|
@ -57,421 +59,343 @@ $VoteMessage["VotePrisonDeploySpam", 0] = "enable jailing deploy spammers";
|
|||
$VoteMessage["VotePrisonDeploySpam", 1] = "disable jailing deploy spammers";
|
||||
// End JTL
|
||||
|
||||
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %playerVote)
|
||||
{
|
||||
//DEMO VERSION - only voteKickPlayer is allowed
|
||||
if ((isDemo()) && %typeName !$= "VoteKickPlayer")
|
||||
{
|
||||
messageClient(%client, '', "All voting options except to kick a player are disabled in the DEMO VERSION.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(%typeName $= "VoteChangeMission" && !$TWM2::AllowCMVotes && !%client.isSuperAdmin) {
|
||||
messageClient(%client, '', "The host has disabled mission votes, only Super Admins may change the mission.");
|
||||
return;
|
||||
}
|
||||
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %playerVote) {
|
||||
if(%typeName $= "VoteChangeMission" && !$TWM2::AllowCMVotes && !%client.isSuperAdmin) {
|
||||
messageClient(%client, '', "The host has disabled mission votes, only Super Admins may change the mission.");
|
||||
return;
|
||||
}
|
||||
// haha - who gets the last laugh... No admin for you!
|
||||
if( %typeName $= "VoteAdminPlayer" && (!$Host::allowAdminPlayerVotes && !%client.isSuperAdmin))
|
||||
return;
|
||||
|
||||
// haha - who gets the last laugh... No admin for you!
|
||||
if( %typeName $= "VoteAdminPlayer" && (!$Host::allowAdminPlayerVotes && !%client.isSuperAdmin))
|
||||
return;
|
||||
%typePass = true;
|
||||
|
||||
%typePass = true;
|
||||
// if not a valid vote, turn back.
|
||||
//Phantom139: Spring Cleaning... TWM2 3.9.2
|
||||
// Old format: if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerCascade" )
|
||||
if($VoteMessage[%typeName $= "") {
|
||||
switch$(%typeName):
|
||||
case "VoteTeamDamage" or "VoteHoardMode" or "VoteGreedMode" or "VotePurebuild" or "VoteLivingWorldMode"
|
||||
or "VoteCascadeMode" or "VoteExpertMode" or "VoteVehicles" or "VoteSatchelCharge" or "VoteOnlyOwnerDeconstruct"
|
||||
or "VoteOnlyOwnerCascade" or "VoteOnlyOwnerRotate" or "VoteOnlyOwnerCubicReplace" or "VoteRemoveDeployables"
|
||||
or "VoteGlobalPowerCheck" or "VoteRemoveDupDeployables" or "VoteRemoveNonPoweredDeployables" or "VoteRemoveOrphanedDeployables"
|
||||
or "VoteInvincibleArmors" or "VoteInvincibleDeployables" or "VoteUndergroundMode" or "VoteHazardMode" or "VotePrison"
|
||||
or "VotePrisonKilling" or "VotePrisonTeamKilling" or "VotePrisonDeploySpam":
|
||||
// Looks like we missed a message, but the type is ok, allow pass.
|
||||
default:
|
||||
%typePass = false;
|
||||
}
|
||||
// End JTL
|
||||
|
||||
// if not a valid vote, turn back.
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteTeamDamage" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteHoardMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteGreedMode" )
|
||||
// JTL
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePurebuild" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteCascadeMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteExpertMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteVehicles" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteSatchelCharge" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerDeconstruct" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerCascade" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerRotate" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerCubicReplace" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteRemoveDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteGlobalPowerCheck" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteRemoveDupDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteRemoveNonPoweredDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteRemoveOrphanedDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteInvincibleArmors" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteInvincibleDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteUndergroundMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteHazardMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePrison" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePrisonKilling" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePrisonTeamKilling" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePrisonDeploySpam" )
|
||||
%typePass = false;
|
||||
// End JTL
|
||||
if(( $VoteMessage[ %typeName, $TeamDamage ] $= "" && %typeName $= "VoteTeamDamage" ))
|
||||
%typePass = false;
|
||||
// JTL
|
||||
if(( $VoteMessage[ %typeName, $Host::Purebuild ] $= "" && %typeName $= "VotePurebuild" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::LivingWorldMode ] $= "" && %typeName $= "VoteLivingWorldMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Cascade ] $= "" && %typeName $= "VoteCascadeMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::ExpertMode ] $= "" && %typeName $= "VoteExpertMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Vehicles ] $= "" && %typeName $= "VoteVehicles" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::SatchelChargeEnabled ] $= "" && %typeName $= "VoteSatchelCharge" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerDeconstruct ] $= "" && %typeName $= "VoteOnlyOwnerDeconstruct" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerCascade ] $= "" && %typeName $= "VoteOnlyOwnerCascade" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerRotate ] $= "" && %typeName $= "VoteOnlyOwnerRotate" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerCubicReplace ] $= "" && %typeName $= "VoteOnlyOwnerCubicReplace" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::InvincibleArmors ] $= "" && %typeName $= "VoteInvincibleArmors" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::InvincibleDeployables ] $= "" && %typeName $= "VoteInvincibleDeployables" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::AllowUnderground ] $= "" && %typeName $= "VoteUndergroundMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Hazard::Enabled ] $= "" && %typeName $= "VoteHazardMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::Enabled ] $= "" && %typeName $= "VotePrison" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::Kill ] $= "" && %typeName $= "VotePrisonKilling" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::TeamKill ] $= "" && %typeName $= "VotePrisonTeamKilling" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::DeploySpam ] $= "" && %typeName $= "VotePrisonDeploySpam" ))
|
||||
%typePass = false;
|
||||
// End JTL
|
||||
|
||||
if(( $VoteMessage[ %typeName, $TeamDamage ] $= "" && %typeName $= "VoteTeamDamage" ))
|
||||
%typePass = false;
|
||||
// JTL
|
||||
if(( $VoteMessage[ %typeName, $Host::Purebuild ] $= "" && %typeName $= "VotePurebuild" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Cascade ] $= "" && %typeName $= "VoteCascadeMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::ExpertMode ] $= "" && %typeName $= "VoteExpertMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Vehicles ] $= "" && %typeName $= "VoteVehicles" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::SatchelChargeEnabled ] $= "" && %typeName $= "VoteSatchelCharge" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerDeconstruct ] $= "" && %typeName $= "VoteOnlyOwnerDeconstruct" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerCascade ] $= "" && %typeName $= "VoteOnlyOwnerCascade" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerRotate ] $= "" && %typeName $= "VoteOnlyOwnerRotate" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerCubicReplace ] $= "" && %typeName $= "VoteOnlyOwnerCubicReplace" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::InvincibleArmors ] $= "" && %typeName $= "VoteInvincibleArmors" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::InvincibleDeployables ] $= "" && %typeName $= "VoteInvincibleDeployables" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::AllowUnderground ] $= "" && %typeName $= "VoteUndergroundMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Hazard::Enabled ] $= "" && %typeName $= "VoteHazardMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::Enabled ] $= "" && %typeName $= "VotePrison" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::Kill ] $= "" && %typeName $= "VotePrisonKilling" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::TeamKill ] $= "" && %typeName $= "VotePrisonTeamKilling" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::DeploySpam ] $= "" && %typeName $= "VotePrisonDeploySpam" ))
|
||||
%typePass = false;
|
||||
// End JTL
|
||||
if( !%typePass )
|
||||
return; // -> bye ;)
|
||||
|
||||
if( !%typePass )
|
||||
return; // -> bye ;)
|
||||
// z0dd - ZOD, 10/03/02. This was busted, BanPlayer was never delt with.
|
||||
if( %typeName $= "BanPlayer" ) {
|
||||
if( !%client.isSuperAdmin || %arg1.isAdmin ) {
|
||||
return; // -> bye ;)
|
||||
}
|
||||
else {
|
||||
ban( %arg1, %client );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// z0dd - ZOD, 10/03/02. This was busted, BanPlayer was never delt with.
|
||||
if( %typeName $= "BanPlayer" )
|
||||
{
|
||||
if( !%client.isSuperAdmin || %arg1.isAdmin )
|
||||
{
|
||||
return; // -> bye ;)
|
||||
}
|
||||
else
|
||||
{
|
||||
ban( %arg1, %client );
|
||||
return;
|
||||
}
|
||||
}
|
||||
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
||||
|
||||
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
||||
// JTL
|
||||
//Phantom139: Spring Cleaning... TWM2 3.9.2
|
||||
if(!%isAdmin) {
|
||||
switch$(%typeName) {
|
||||
case "VoteVehicles" or "VoteSatchelCharge" or "VoteOnlyOwnerDeconstruct" or "VoteOnlyOwnerCascade"
|
||||
or "VoteOnlyOwnerRotate" or "VoteOnlyOwnerCubicReplace" or "VoteRemoveDeployables" or "VoteGlobalPowerCheck"
|
||||
or "VoteRemoveDupDeployables" or "VoteRemoveNonPoweredDeployables" or "VoteRemoveOrphanedDeployables"
|
||||
or "VoteInvincibleArmors" or "VoteInvincibleDeployables" or "VoteUndergroundMode" or "VoteHazardMode"
|
||||
or "VotePrison" or "VotePrisonKilling" or "VotePrisonTeamKilling" or "VotePrisonDeploySpam":
|
||||
%typePass = false;
|
||||
}
|
||||
}
|
||||
|
||||
// JTL
|
||||
if(%typeName $= "VoteVehicles" && !%isAdmin)
|
||||
if(%typeName $= "VoteVehicles" && !%isAdmin)
|
||||
if(%typeName $= "VoteSatchelCharge" && !%isAdmin)
|
||||
if(%typeName $= "VoteOnlyOwnerDeconstruct" && !%isAdmin)
|
||||
if(%typeName $= "VoteOnlyOwnerCascade" && !%isAdmin)
|
||||
if(%typeName $= "VoteOnlyOwnerRotate" && !%isAdmin)
|
||||
if(%typeName $= "VoteOnlyOwnerCubicReplace" && !%isAdmin)
|
||||
if(%typeName $= "VoteRemoveDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteGlobalPowerCheck" && !%isAdmin)
|
||||
if(%typeName $= "VoteRemoveDupDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteRemoveNonPoweredDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteRemoveOrphanedDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteInvincibleArmors" && !%isAdmin)
|
||||
if(%typeName $= "VoteInvincibleDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteUndergroundMode" && !%isAdmin)
|
||||
if(%typeName $= "VoteHazardMode" && !%isAdmin)
|
||||
if(%typeName $= "VotePrison" && !%isAdmin)
|
||||
if(%typeName $= "VotePrisonKilling" && !%isAdmin)
|
||||
if(%typeName $= "VotePrisonTeamKilling" && !%isAdmin)
|
||||
if(%typeName $= "VotePrisonDeploySpam" && !%isAdmin)
|
||||
%typePass = false;
|
||||
if( !%typePass )
|
||||
return; // -> bye ;)
|
||||
// End JTL
|
||||
|
||||
if( !%typePass )
|
||||
return; // -> bye ;)
|
||||
// End JTL
|
||||
// keep these under the server's control. I win.
|
||||
if( !%playerVote )
|
||||
%actionMsg = $VoteMessage[ %typeName ];
|
||||
else if( %typeName $= "VoteTeamDamage" || %typeName $= "VoteGreedMode" || %typeName $= "VoteHoardMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $TeamDamage ];
|
||||
// JTL
|
||||
else if( %typeName $= "VotePurebuild" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Purebuild ];
|
||||
else if( %typeName $= "VoteLivingWorldMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::LivingWorldMode ];
|
||||
else if( %typeName $= "VoteCascadeMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Cascade ];
|
||||
else if( %typeName $= "VoteExpertMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::ExpertMode ];
|
||||
else if( %typeName $= "VoteVehicles" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Vehicles ];
|
||||
else if( %typeName $= "VoteSatchelCharge" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::SatchelChargeEnabled ];
|
||||
else if( %typeName $= "VoteOnlyOwnerDeconstruct" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerDeconstruct ];
|
||||
else if( %typeName $= "VoteOnlyOwnerCascade" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerCascade ];
|
||||
else if( %typeName $= "VoteOnlyOwnerRotate" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerRotate ];
|
||||
else if( %typeName $= "VoteOnlyOwnerCubicReplace" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerCubicReplace ];
|
||||
else if( %typeName $= "VoteInvincibleArmors" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::InvincibleArmors ];
|
||||
else if( %typeName $= "VoteInvincibleDeployables" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::InvincibleDeployables ];
|
||||
else if( %typeName $= "VoteUndergroundMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::AllowUnderground ];
|
||||
else if( %typeName $= "VoteHazardMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Hazard::Enabled ];
|
||||
else if( %typeName $= "VotePrison" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::Enabled ];
|
||||
else if( %typeName $= "VotePrisonKilling" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::Kill ];
|
||||
else if( %typeName $= "VotePrisonTeamKilling" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::TeamKill ];
|
||||
else if( %typeName $= "VotePrisonDeploySpam" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::DeploySpam ];
|
||||
// End JTL
|
||||
else
|
||||
%actionMsg = $VoteMessage[ %typeName ];
|
||||
|
||||
// keep these under the server's control. I win.
|
||||
if( !%playerVote )
|
||||
%actionMsg = $VoteMessage[ %typeName ];
|
||||
else if( %typeName $= "VoteTeamDamage" || %typeName $= "VoteGreedMode" || %typeName $= "VoteHoardMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $TeamDamage ];
|
||||
// JTL
|
||||
else if( %typeName $= "VotePurebuild" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Purebuild ];
|
||||
else if( %typeName $= "VoteCascadeMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Cascade ];
|
||||
else if( %typeName $= "VoteExpertMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::ExpertMode ];
|
||||
else if( %typeName $= "VoteVehicles" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Vehicles ];
|
||||
else if( %typeName $= "VoteSatchelCharge" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::SatchelChargeEnabled ];
|
||||
else if( %typeName $= "VoteOnlyOwnerDeconstruct" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerDeconstruct ];
|
||||
else if( %typeName $= "VoteOnlyOwnerCascade" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerCascade ];
|
||||
else if( %typeName $= "VoteOnlyOwnerRotate" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerRotate ];
|
||||
else if( %typeName $= "VoteOnlyOwnerCubicReplace" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerCubicReplace ];
|
||||
else if( %typeName $= "VoteInvincibleArmors" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::InvincibleArmors ];
|
||||
else if( %typeName $= "VoteInvincibleDeployables" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::InvincibleDeployables ];
|
||||
else if( %typeName $= "VoteUndergroundMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::AllowUnderground ];
|
||||
else if( %typeName $= "VoteHazardMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Hazard::Enabled ];
|
||||
else if( %typeName $= "VotePrison" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::Enabled ];
|
||||
else if( %typeName $= "VotePrisonKilling" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::Kill ];
|
||||
else if( %typeName $= "VotePrisonTeamKilling" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::TeamKill ];
|
||||
else if( %typeName $= "VotePrisonDeploySpam" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::DeploySpam ];
|
||||
// End JTL
|
||||
else
|
||||
%actionMsg = $VoteMessage[ %typeName ];
|
||||
if( !%client.canVote && !%isAdmin )
|
||||
return;
|
||||
|
||||
if( !%client.canVote && !%isAdmin )
|
||||
return;
|
||||
if ( ( !%isAdmin || ( %arg1.isAdmin && ( %client != %arg1 ) ) ) && // z0dd - ToS 4/2/02: Allow SuperAdmins to kick Admins
|
||||
!( ( %typeName $= "VoteKickPlayer" ) && %client.isSuperAdmin ) ) { // z0dd - ToS 4/2/02: Allow SuperAdmins to kick Admins
|
||||
%teamSpecific = false;
|
||||
%gender = (%client.sex $= "Male" ? 'he' : 'she');
|
||||
if ( Game.scheduleVote $= "" ) {
|
||||
%clientsVoting = 0;
|
||||
//send a message to everyone about the vote...
|
||||
if ( %playerVote ) {
|
||||
%teamSpecific = ( %typeName $= "VoteKickPlayer" ) && ( Game.numTeams > 1 );
|
||||
%kickerIsObs = %client.team == 0;
|
||||
%kickeeIsObs = %arg1.team == 0;
|
||||
%sameTeam = %client.team == %arg1.team;
|
||||
|
||||
if ( ( !%isAdmin || ( %arg1.isAdmin && ( %client != %arg1 ) ) ) && // z0dd - ToS 4/2/02: Allow SuperAdmins to kick Admins
|
||||
!( ( %typeName $= "VoteKickPlayer" ) && %client.isSuperAdmin ) ) // z0dd - ToS 4/2/02: Allow SuperAdmins to kick Admins
|
||||
{
|
||||
%teamSpecific = false;
|
||||
%gender = (%client.sex $= "Male" ? 'he' : 'she');
|
||||
if ( Game.scheduleVote $= "" )
|
||||
{
|
||||
%clientsVoting = 0;
|
||||
if( %kickeeIsObs ) {
|
||||
%teamSpecific = false;
|
||||
%sameTeam = false;
|
||||
}
|
||||
|
||||
//send a message to everyone about the vote...
|
||||
if ( %playerVote )
|
||||
{
|
||||
%teamSpecific = ( %typeName $= "VoteKickPlayer" ) && ( Game.numTeams > 1 );
|
||||
%kickerIsObs = %client.team == 0;
|
||||
%kickeeIsObs = %arg1.team == 0;
|
||||
%sameTeam = %client.team == %arg1.team;
|
||||
if(( !%sameTeam && %teamSpecific) && %typeName !$= "VoteAdminPlayer") {
|
||||
messageClient(%client, '', "\c2Player votes must be team based.");
|
||||
return;
|
||||
}
|
||||
|
||||
if( %kickeeIsObs )
|
||||
{
|
||||
%teamSpecific = false;
|
||||
%sameTeam = false;
|
||||
}
|
||||
// kicking is team specific
|
||||
if( %typeName $= "VoteKickPlayer" ) {
|
||||
if(%arg1.isSuperAdmin) {
|
||||
messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(( !%sameTeam && %teamSpecific) && %typeName !$= "VoteAdminPlayer")
|
||||
{
|
||||
messageClient(%client, '', "\c2Player votes must be team based.");
|
||||
return;
|
||||
}
|
||||
Game.kickClient = %arg1;
|
||||
Game.kickClientName = %arg1.name;
|
||||
Game.kickGuid = %arg1.guid;
|
||||
Game.kickTeam = %arg1.team;
|
||||
|
||||
// kicking is team specific
|
||||
if( %typeName $= "VoteKickPlayer" )
|
||||
{
|
||||
if(%arg1.isSuperAdmin)
|
||||
{
|
||||
messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender);
|
||||
return;
|
||||
}
|
||||
if(%teamSpecific) {
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) {
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
|
||||
Game.kickClient = %arg1;
|
||||
Game.kickClientName = %arg1.name;
|
||||
Game.kickGuid = %arg1.guid;
|
||||
Game.kickTeam = %arg1.team;
|
||||
if (%cl.team == %client.team && !%cl.isAIControlled()) {
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) {
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() ) {
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) {
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() ) {
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( %typeName $= "VoteChangeMission" ) {
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) {
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() ) {
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3 (%4).', %client.name, %actionMsg, %arg1, %arg2 );
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (%arg1 !$= 0) {
|
||||
if (%arg2 !$= 0) {
|
||||
if(%typeName $= "VoteTournamentMode") {
|
||||
%admin = getAdmin();
|
||||
if(%admin > 0) {
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) {
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() ) {
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 Tournament Mode (%3).', %client.name, %actionMsg, %arg1);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
messageClient( %client, 'clientMsg', 'There must be a server admin to play in Tournament Mode.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) {
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() ) {
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3 %4.', %client.name, %actionMsg, %arg1, %arg2);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) {
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() ) {
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) {
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() ) {
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2.', %client.name, %actionMsg);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// open the vote hud for all clients that will participate in this vote
|
||||
if(%teamSpecific) {
|
||||
for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) {
|
||||
%cl = ClientGroup.getObject( %clientIndex );
|
||||
|
||||
if(%teamSpecific)
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if(%cl.team == %client.team && !%cl.isAIControlled())
|
||||
messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) {
|
||||
%cl = ClientGroup.getObject( %clientIndex );
|
||||
if ( !%cl.isAIControlled() )
|
||||
messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100));
|
||||
}
|
||||
}
|
||||
|
||||
if (%cl.team == %client.team && !%cl.isAIControlled())
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( %typeName $= "VoteChangeMission" )
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3 (%4).', %client.name, %actionMsg, %arg1, %arg2 );
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (%arg1 !$= 0)
|
||||
{
|
||||
if (%arg2 !$= 0)
|
||||
{
|
||||
if(%typeName $= "VoteTournamentMode")
|
||||
{
|
||||
%admin = getAdmin();
|
||||
if(%admin > 0)
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 Tournament Mode (%3).', %client.name, %actionMsg, %arg1);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
messageClient( %client, 'clientMsg', 'There must be a server admin to play in Tournament Mode.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3 %4.', %client.name, %actionMsg, %arg1, %arg2);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2.', %client.name, %actionMsg);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
clearVotes();
|
||||
//SIG
|
||||
Game.voteType = %typeName;
|
||||
Game.VClient = %client;
|
||||
Game.Varg1 = %arg1;
|
||||
Game.Varg2 = %arg2;
|
||||
Game.Varg3 = %arg3;
|
||||
Game.Varg4 = %arg4;
|
||||
//kthx
|
||||
Game.scheduleVote = schedule( ($Host::VoteTime * 1000), 0, "calcVotes", %typeName, %arg1, %arg2, %arg3, %arg4 );
|
||||
%client.vote = true;
|
||||
messageAll('addYesVote', "");
|
||||
|
||||
// open the vote hud for all clients that will participate in this vote
|
||||
if(%teamSpecific)
|
||||
{
|
||||
for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %clientIndex );
|
||||
if(!%client.team == 0)
|
||||
clearBottomPrint(%client);
|
||||
}
|
||||
else
|
||||
messageClient( %client, 'voteAlreadyRunning', '\c2A vote is already in progress.' );
|
||||
}
|
||||
else {
|
||||
if ( Game.scheduleVote !$= "" && Game.voteType $= %typeName ) {
|
||||
messageAll('closeVoteHud', "");
|
||||
cancel(Game.scheduleVote);
|
||||
Game.scheduleVote = "";
|
||||
}
|
||||
|
||||
if(%cl.team == %client.team && !%cl.isAIControlled())
|
||||
messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %clientIndex );
|
||||
if ( !%cl.isAIControlled() )
|
||||
messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100));
|
||||
}
|
||||
}
|
||||
// if this is a superAdmin, don't kick or ban
|
||||
if(%arg1 != %client) {
|
||||
if(!%arg1.isSuperAdmin) {
|
||||
// Set up kick/ban values:
|
||||
if ( %typeName $= "VoteBanPlayer" || %typeName $= "VoteKickPlayer" ) {
|
||||
Game.kickClient = %arg1;
|
||||
Game.kickClientName = %arg1.name;
|
||||
Game.kickGuid = %arg1.guid;
|
||||
Game.kickTeam = %arg1.team;
|
||||
}
|
||||
|
||||
clearVotes();
|
||||
//SIG
|
||||
Game.voteType = %typeName;
|
||||
Game.VClient = %client;
|
||||
Game.Varg1 = %arg1;
|
||||
Game.Varg2 = %arg2;
|
||||
Game.Varg3 = %arg3;
|
||||
Game.Varg4 = %arg4;
|
||||
//kthx
|
||||
Game.scheduleVote = schedule( ($Host::VoteTime * 1000), 0, "calcVotes", %typeName, %arg1, %arg2, %arg3, %arg4 );
|
||||
%client.vote = true;
|
||||
messageAll('addYesVote', "");
|
||||
|
||||
if(!%client.team == 0)
|
||||
clearBottomPrint(%client);
|
||||
}
|
||||
else
|
||||
messageClient( %client, 'voteAlreadyRunning', '\c2A vote is already in progress.' );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Game.scheduleVote !$= "" && Game.voteType $= %typeName )
|
||||
{
|
||||
messageAll('closeVoteHud', "");
|
||||
cancel(Game.scheduleVote);
|
||||
Game.scheduleVote = "";
|
||||
}
|
||||
|
||||
// if this is a superAdmin, don't kick or ban
|
||||
if(%arg1 != %client)
|
||||
{
|
||||
if(!%arg1.isSuperAdmin)
|
||||
{
|
||||
// Set up kick/ban values:
|
||||
if ( %typeName $= "VoteBanPlayer" || %typeName $= "VoteKickPlayer" )
|
||||
{
|
||||
Game.kickClient = %arg1;
|
||||
Game.kickClientName = %arg1.name;
|
||||
Game.kickGuid = %arg1.guid;
|
||||
Game.kickTeam = %arg1.team;
|
||||
}
|
||||
|
||||
//Tinman - PURE servers can't call "eval"
|
||||
//Mark - True, but neither SHOULD a normal server
|
||||
// - thanks Ian Hardingham
|
||||
Game.evalVote(%typeName, %client, %arg1, %arg2, %arg3, %arg4);
|
||||
}
|
||||
else
|
||||
messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender);
|
||||
}
|
||||
}
|
||||
|
||||
%client.canVote = false;
|
||||
%client.rescheduleVote = schedule( ($Host::voteSpread * 1000) + ($Host::voteTime * 1000) , 0, "resetVotePrivs", %client );
|
||||
//Tinman - PURE servers can't call "eval"
|
||||
//Mark - True, but neither SHOULD a normal server
|
||||
// - thanks Ian Hardingham
|
||||
Game.evalVote(%typeName, %client, %arg1, %arg2, %arg3, %arg4);
|
||||
}
|
||||
else
|
||||
messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender);
|
||||
}
|
||||
}
|
||||
%client.canVote = false;
|
||||
%client.rescheduleVote = schedule( ($Host::voteSpread * 1000) + ($Host::voteTime * 1000) , 0, "resetVotePrivs", %client );
|
||||
}
|
||||
|
||||
function resetVotePrivs( %client )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue