Permalink
Browse files

Nuke the whole killtimefeature including all references to it due to …

…it is now build into the javascript-part.
  • Loading branch information...
xhoogland committed Feb 17, 2017
1 parent 395404e commit 6392a010a2fe46ad46070440f15eb21ade7c9b79
@@ -156,78 +156,6 @@ lvp_fetch(playerId, params[]) {
return 1;
}
#if Feature::DisableKilltime == 0
lvp_killtime(playerId, params[]) {
if (!sKillTime) {
if (Command->parameterCount(params) == 0) {
SendClientMessage(playerId, Color::Success, "This command starts the KillTime minigame and goes on for the chosen time.");
SendClientMessage(playerId, Color::Information, "Usage: /killtime [minutes] [weaponId]. If KillTime is already running, /killtime to end it.");
SendClientMessage(playerId, Color::Information, "If no weaponId is given, no special weapon will be given out.");
return 1;
}
param_shift_int(duration);
if (duration < 2) {
SendClientMessage(playerId, Color::Error, "KillTime can't be shorter than 2 minutes.");
return 1;
} else if (duration > 60) {
SendClientMessage(playerId, Color::Error, "KillTime can't last longer than 60 minutes.");
return 1;
}
param_shift_int(weaponId);
if (weaponId != 0 && WeaponUtilities->isWeaponValid(weaponId) == true) {
killTimeWeaponId = weaponId;
for (new subjectId = 0; subjectId <= PlayerManager->highestPlayerId(); subjectId++) {
if (Player(subjectId)->isConnected() == false || Player(subjectId)->isNonPlayerCharacter() == true)
continue;
if (IsPlayerInMinigame(subjectId))
continue;
GiveWeapon(subjectId, weaponId, 5000);
}
}
if (KTTimer != -1)
KillTimer(KTTimer);
GameTextForAllEx("~r~It's KillTime!~n~~w~Go on a killing spree!" ,5000, 1, World::MainWorld);
sKillTime = true;
KillTimeStart(duration);
format(g_message, sizeof(g_message), "%s (Id:%d) has started a #%d minute KillTime in the mainworld (WorldId:%d).",
Player(playerId)->nicknameString(), playerId, duration, World::MainWorld);
Admin(playerId, g_message);
} else if (sKillTime) {
sKillTime = false;
KillTimer(KTTimer);
KTTimer = -1;
GameTextForAllEx("~r~KillTime is over!", 5000, 1, World::MainWorld);
for (new player = 0; player <= PlayerManager->highestPlayerId(); player++) {
if (Player(player)->isConnected() == false)
continue;
new weaponId, ammo;
GetPlayerWeaponData(player, 7, weaponId, ammo);
if (weaponId == killTimeWeaponId)
RemovePlayerWeapon(player, weaponId);
}
killTimeWeaponId = 0;
format(g_message, sizeof(g_message), "%s (Id:%d) has stopped KillTime.", Player(playerId)->nicknameString(), playerId);
Admin(playerId, g_message);
}
return 1;
}
#endif
lvp_forward(playerId, params[]) {
new distance = Command->integerParameter(params, 0);
if (Command->parameterCount(params) == 0) {
@@ -24,11 +24,6 @@ WeaponCheat(i) {
new notice[128], weaponId, ammo;
GetPlayerWeaponData(i, 7, weaponId, ammo);
#if Feature::DisableKilltime == 0
if (weaponId == killTimeWeaponId && sKillTime)
return 0;
#endif
// RPG
if (weaponId == 35 && !g_PlayerWeapon[i][weaponId])
iWeaponCheatCount[i]++;
@@ -27,20 +27,12 @@ LegacyOnPlayerPickUpPickup(playerid, pickupid)
// Other pickup ID's, added the SendClientMessage for debugging purposes.
if (pickupid == g_iShipIcon && g_VirtualWorld[ playerid ] == 0)
{
#if Feature::DisableKilltime == 0
if(!sKillTime) {
#endif
SendClientMessage( playerid, COLOR_ORANGE, "The Pirate Ship on Las Venturas Playground is a safe-zone," );
SendClientMessage( playerid, COLOR_ORANGE, "you are NOT allowed to fight, kill, hit, slap or have sexual" );
SendClientMessage( playerid, COLOR_ORANGE, "intercourse with anyone on the pirate ship!" );
if(Player(playerid)->isRegular() == false)
GameTextForPlayer(playerid,"The ship is a peace zone!",1000,6);
#if Feature::DisableKilltime == 0
} else if(sKillTime)
SendClientMessage(playerid,Color::Green,"It's Killtime! Access to the ship is temporarily pohibited.");
#endif
SendClientMessage( playerid, COLOR_ORANGE, "The Pirate Ship on Las Venturas Playground is a safe-zone," );
SendClientMessage( playerid, COLOR_ORANGE, "you are NOT allowed to fight, kill, hit, slap or have sexual" );
SendClientMessage( playerid, COLOR_ORANGE, "intercourse with anyone on the pirate ship!" );
if(Player(playerid)->isRegular() == false)
GameTextForPlayer(playerid,"The ship is a peace zone!",1000,6);
return 1;
}
@@ -148,18 +148,8 @@ class ShipManager {
this->respawnPlayerVehicle(playerId);
if (DamageManager(playerId)->isPlayerFighting() == true) {
//|| LegacyIsKillTimeActivated()) {
#if Feature::DisableKilltime == 0
if (LegacyIsKillTimeActivated()) {
this->throwPlayerOffTheShip(playerId);
ShowBoxForPlayer(playerId, "Killtime is running, so you can not access the shipzone since that would be unfair!");
} else {
#endif
this->throwPlayerOffTheShip(playerId);
ShowBoxForPlayer(playerId, "You have recently been in a gunfight, therefore cannot enter the ship at this moment");
#if Feature::DisableKilltime == 0
}
#endif
this->throwPlayerOffTheShip(playerId);
ShowBoxForPlayer(playerId, "You have recently been in a gunfight, therefore cannot enter the ship at this moment");
return 1;
}
@@ -342,12 +332,6 @@ class ShipManager {
this->respawnPlayerVehicle(playerId);
}
#if Feature::DisableKilltime == 0
if (LegacyIsKillTimeActivated()) {
this->throwPlayerOffTheShip(playerId);
ShowBoxForPlayer(playerId, "Killtime is running, so you can not access the shipzone since that would be unfair!");
}
#endif
}
return 1;
@@ -39,9 +39,6 @@ enum EconomyValueType {
GiftHuntMediumPrize,
GiftHuntSmallPrize,
GrandTheftAutoRandomVehicleValue,
#if Feature::DisableKilltime == 0
KilltimeVictory,
#endif
MapZoneReward,
MapZoneSpeedBonus,
MinigameParticipation,
@@ -110,9 +107,6 @@ GetEconomyValue(EconomyValueType: type, inputValue = 0) {
case GiftHuntMediumPrize: return 25000;
case GiftHuntSmallPrize: return 10000;
case GrandTheftAutoRandomVehicleValue: return random(30000 /* max */ - 17500 /* min */) + 17500 /* min */;
#if Feature::DisableKilltime == 0
case KilltimeVictory: return 5000;
#endif
case MapZoneReward: return 2000 - 10 * inputValue /* time taken (seconds) */;
case MapZoneSpeedBonus: return 2 * inputValue /* high-speed streak count */;
case MinigameParticipation: return 250;
@@ -242,9 +242,6 @@ ResetPlayerStats(playerId) {
IsPlayerInBombShop[playerId] = false;
DetonateVehicle[playerId] = -1;
bombDetonation[playerId] = 10;
#if Feature::DisableKilltime == 0
KTKills[playerId] = false;
#endif
iLoan[playerId] = 0;
iLoanPercent[playerId] = 0;
PlayerInfo[playerId][playerTJailSes] = 0;
View
@@ -9,14 +9,6 @@
*
*/
#if Feature::DisableKilltime == 0
new sKillTime;
new killTimeWeaponId = 0;
new KTKills[MAX_PLAYERS];
new KTDeaths[MAX_PLAYERS];
new KTTimer;
#endif
new iServerChampion = Player::InvalidId;
new iRecordName[MAX_PLAYER_NAME+1] = "LVP";
new playerLastQuitInterior[MAX_PLAYERS];
@@ -570,9 +570,6 @@ public OnPlayerCommandText(playerid, cmdtext[]) {
lvp_command(reactiontest, 12, AdministratorLevel);
lvp_command(chase, 5, AdministratorLevel);
lvp_command(fetch, 5, AdministratorLevel);
#if Feature::DisableKilltime == 0
lvp_command(killtime, 8, AdministratorLevel);
#endif
lvp_command(forward, 7, AdministratorLevel);
lvp_command(stopchase, 9, AdministratorLevel);
lvp_command(set, 3, AdministratorLevel);
@@ -192,20 +192,9 @@ public OnPlayerDeath(playerid, killerid, reason) {
// ---- MINIGAME & LAME-KILL CHECKS ------------------------------------------------------------
// Killtime
if (killerid == Player::InvalidId || Player(killerid)->isConnected() == false) {
#if Feature::DisableKilltime == 0
if (KTTimer > -1 && (GetPlayerVirtualWorld(killerid) == World::MainWorld && GetPlayerVirtualWorld(playerid) == World::MainWorld))
KTDeaths[playerid]++;
#endif
MyDeaths[playerid]++;
} else {
#if Feature::DisableKilltime == 0
if (KTTimer > -1 && (GetPlayerVirtualWorld(killerid) == World::MainWorld && GetPlayerVirtualWorld(playerid) == World::MainWorld)) {
KTKills[killerid]++;
KTDeaths[playerid]++;
}
#endif
MyKills[killerid]++;
MyDeaths[playerid]++;
}
@@ -272,11 +261,7 @@ public OnPlayerDeath(playerid, killerid, reason) {
if (isLameKill) {
new Float:distanceBetweenPlayers = GetDistanceBetweenPlayers(playerid, killerid);
#if Feature::DisableKilltime == 0
if (PlayerInfo[killerid][PlayerStatus] != STATUS_CHASE && !sKillTime && distanceBetweenPlayers < 100.0)
#else
if (PlayerInfo[killerid][PlayerStatus] != STATUS_CHASE && distanceBetweenPlayers < 100.0)
#endif
return OnPlayerLameKill(playerid, killerid);
}
@@ -64,11 +64,7 @@ public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
// Anti-ship fighting
if (ShipManager->isPlayerWalkingOnShip(playerid)) {
#if Feature::DisableKilltime == 0
if (!sKillTime && (GetPlayerVirtualWorld(playerid) == 0)
#else
if ((GetPlayerVirtualWorld(playerid) == 0)
#endif
&& !IsPlayerInMinigame(playerid) && Player(playerid)->isAdministrator() == false
&& !iPlayerAnimation[playerid] &&
((GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_NONE) || (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)))
@@ -91,11 +87,7 @@ public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
// Other fighting style (punch + kick combo)
if (PRESSED(KEY_SHIP_FIGHT) && ShipManager->isPlayerWalkingOnShip(playerid)) {
#if Feature::DisableKilltime == 0
if (!sKillTime && (GetPlayerVirtualWorld(playerid) == 0)
#else
if ((GetPlayerVirtualWorld(playerid) == 0)
#endif
&& !IsPlayerInMinigame(playerid) && Player(playerid)->isAdministrator() == false
&& !iPlayerAnimation[playerid] && GetPlayerSpecialAction(playerid) == 0) {
iPlayerAnimation[playerid] = 0;
@@ -187,10 +187,6 @@ public OnGameModeInit() {
// Set some required variables:
#if Feature::DisableKilltime == 0
KTTimer = -1; // Disables the killtime timer.
#endif
CTaxi__Initialize();
CDrink__BuildMenus();
@@ -1,102 +0,0 @@
// Copyright 2006-2015 Las Venturas Playground. All rights reserved.
// Use of this source code is governed by the GPLv2 license, a copy of which can
// be found in the LICENSE file.
new KTTime;
KillTimeStart(minutes = 5) {
new string[256];
for (new player = 0; player < MAX_PLAYERS; player++) {
KTKills[player] = 0;
KTDeaths[player] = 0;
}
SendClientMessageToAll(COLOR_YELLOW, "KillTime modus started!");
SendClientMessageToAll(Color::White, "The goal of KillTime: Kill more people than your opponents!");
format(string, sizeof(string), "You have %d minutes before the KillTime is over. Kill them all!", minutes);
SendClientMessageToAll(Color::White, string);
format(string, sizeof(string), "The winner gets $%s! Success!", formatPrice(GetEconomyValue(KilltimeVictory)));
SendClientMessageToAll(Color::White, string);
KTTime = minutes;
sKillTime = true;
KTTimer = SetTimer("KillTimeRun", 60000, 1);
}
forward KillTimeRun();
public KillTimeRun() {
new lead = -1, leadKills = 0, string[256];
KTTime--;
for (new player = 0; player <= PlayerManager->highestPlayerId(); player++) {
if (Player(player)->isConnected() == false)
continue;
if (KTKills[player] > leadKills) {
lead = player;
leadKills = KTKills[player];
}
}
if (KTTime > 1) {
if (lead > -1)
format(string, sizeof(string), "KillTime: %d minutes to go! %s is leading with %d kills!",
KTTime, Player(lead)->nicknameString(), leadKills);
else
format(string, sizeof(string), "KillTime: %d minutes to go! Nobody's leading yet!", KTTime);
SendClientMessageToAll(COLOR_YELLOW, string);
}
else if (KTTime == 1) {
format(string, sizeof(string), "KillTime: Last minute, who will win?!");
SendClientMessageToAll(COLOR_YELLOW, string);
}
else {
KillTimer(KTTimer);
KTTimer = -1;
sKillTime = false;
if (Player(lead)->isConnected() == false) {
format(string, sizeof(string), "None won the killtime. The $%s has been donated to LVP's monkey sanctuary.",
formatPrice(GetEconomyValue(KilltimeVictory)));
SendClientMessageToAll(COLOR_YELLOW, string);
format(string, sizeof(string), "[killtime] None -");
AddEcho(string);
} else {
format(string, sizeof(string), "%s has won the KillTime with %d kills!", Player(lead)->nicknameString(), leadKills);
SendClientMessageToAll(COLOR_YELLOW, string);
new const price = GetEconomyValue(KilltimeVictory);
format(string, sizeof(string), "Congratulations! You have won $%s!", formatPrice(price));
SendClientMessage(lead, Color::Green, string);
format(string, sizeof(string), "[killtime] %s %d", Player(lead)->nicknameString(), leadKills);
AddEcho(string);
GiveRegulatedMoney(lead, KilltimeVictory);
WonMinigame[lead]++;
}
for (new player = 0; player <= PlayerManager->highestPlayerId(); player++) {
if (Player(player)->isConnected() == false || Player(player)->isAdministrator() == true)
continue;
new weaponId, ammo;
GetPlayerWeaponData(player, 7, weaponId, ammo);
RemovePlayerWeapon(player, weaponId);
}
}
}
LegacyIsKillTimeActivated() {
if (sKillTime)
return true;
return false;
}
View
@@ -87,9 +87,6 @@ class Feature {
// Disables the Pawn of everything related to DM fights.
public const DisableFights = 0;
// Be able to switch it off in preperation of the rewrite of it in javascript
public const DisableKilltime = 0;
/** **************************************************************************************** **/
/// Christmas
View
@@ -292,7 +292,6 @@
<DiskObject>\Resources\Games\Export.pwn</DiskObject>
<DiskObject>\Resources\Games\FightClub.pwn</DiskObject>
<DiskObject>\Resources\Games\Grand_Theft_Auto.pwn</DiskObject>
<DiskObject>\Resources\Games\Killtime.pwn</DiskObject>
<DiskObject>\Resources\Games\Reaction.pwn</DiskObject>
<DiskObject>\Resources\IRC\</DiskObject>
<DiskObject>\Resources\IRC\irccommand.pwn</DiskObject>
Oops, something went wrong.

0 comments on commit 6392a01

Please sign in to comment.