From f8e6a45cfe7cde5711ade6b293adf15bf27ed88d Mon Sep 17 00:00:00 2001 From: Steven Howard Date: Sun, 2 Dec 2018 21:16:09 +0000 Subject: [PATCH] cannon doesn't reset health and weapons now. fixes http://forum.sfcnr.com/showthread.php?59234-Orbital-canon --- .../cnr/features/gangs/cannon.pwn | 19 +++++++++- gamemodes/sf-cnr.pwn | 36 ------------------- 2 files changed, 18 insertions(+), 37 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/gangs/cannon.pwn b/gamemodes/irresistible/cnr/features/gangs/cannon.pwn index 01f9cbd..709d98f 100644 --- a/gamemodes/irresistible/cnr/features/gangs/cannon.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/cannon.pwn @@ -26,7 +26,12 @@ new g_orbitalCannonData [ MAX_FACILITIES ] [ E_ORBITAL_CANNON_DATA ], p_usingOrbitalCannon [ MAX_PLAYERS ] = { -1, ... }, Text: g_orbitalAimTD = Text: INVALID_TEXT_DRAW, - Text3D: g_orbitalPlayerLabels [ MAX_FACILITIES ] [ MAX_PLAYERS ] + Text3D: g_orbitalPlayerLabels [ MAX_FACILITIES ] [ MAX_PLAYERS ], + + p_Weapons [ MAX_PLAYERS ][ 13 ], + p_Ammo [ MAX_PLAYERS ][ 13 ], + Float: p_Health [ MAX_PLAYERS ], + Float: p_Armour [ MAX_PLAYERS ] ; /* ** Hooks ** */ @@ -65,6 +70,12 @@ hook SetPlayerRandomSpawn( playerid ) SetPlayerPos( playerid, g_gangFacilityInterior[ int_type ] [ E_CANNON_POS ] [ 0 ], g_gangFacilityInterior[ int_type ] [ E_CANNON_POS ] [ 1 ], g_gangFacilityInterior[ int_type ] [ E_CANNON_POS ] [ 2 ] ); SetPlayerVirtualWorld( playerid, g_gangFacilities[ facilityid ] [ E_WORLD ] ); SetPlayerInterior( playerid, 0 ); + SetPlayerHealth( playerid, p_Health[ playerid ] ); + SetPlayerArmour( playerid, p_Armour[ playerid ] ); + + for ( new iWeapon; iWeapon < 13; iWeapon ++ ) { + GivePlayerWeapon( playerid, p_Weapons[ playerid ][ iWeapon ], p_Ammo[ playerid ][ iWeapon ] ); + } // set camera DeletePVar( playerid, "left_cannon" ); @@ -268,6 +279,12 @@ stock StartPlayerOrbitalCannon( playerid, facilityid ) return 0; // player + for ( new iWeapon; iWeapon < 13; iWeapon ++ ) + GetPlayerWeaponData( playerid, iWeapon, p_Weapons[ playerid ][ iWeapon ], p_Ammo[ playerid ][ iWeapon ] ); + + GetPlayerHealth( playerid, p_Health[ playerid ] ); + GetPlayerArmour( playerid, p_Armour[ playerid ] ); + SetPlayerInterior( playerid, 0 ); SetPlayerVirtualWorld( playerid, 0 ); TogglePlayerSpectating( playerid, 1 ); diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index ab49101..ed3ddc4 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -198,33 +198,6 @@ new p_C4Amount [ MAX_PLAYERS ] ; -/* ** Admin Ban Codes ** */ -enum E_BAN_CODE -{ - E_CODE[ 4 ], E_DATA[ 21 ] -}; - -new - g_banCodes[ ] [ E_BAN_CODE ] = - { - { "AH", "Armor Hacking" }, - { "HH", "Health Hacking" }, - { "VHH", "Vehicle Health Hacks" }, - { "NR", "No Reload" }, - { "IA", "Infinite Ammo" }, - { "FH", "Fly Hacks" }, - { "BE", "Ban Evasion" }, - { "AB", "Air Brake" }, - { "TP", "Teleport Hacks" }, - { "WH", "Weapon Hack" }, - { "SH", "Speed Hacks" }, - { "UA", "Unlimited Ammo" }, - { "RF", "Rapid Fire" }, - { "AIM", "Aimbot" }, - { "ADV", "Advertising" } - } -; - /* ** Jail System ** */ #define JAIL_SECONDS_MULTIPLIER ( 3 ) #define ALCATRAZ_REQUIRED_TIME ( 150 ) @@ -11330,15 +11303,6 @@ stock KillEveryoneInShamal( vehicleid ) } } -stock adhereBanCodes( string[ ], maxlength = sizeof( string ) ) { - for( new i; i < sizeof( g_banCodes ); i++ ) { - if ( strfind( string, g_banCodes[ i ] [ E_CODE ], false ) != -1 ) { - strreplace( string, g_banCodes[ i ] [ E_CODE ], g_banCodes[ i ] [ E_DATA ], false, 0, -1, maxlength ); - } - } - return 1; -} - stock CreateExplosionEx( Float: X, Float: Y, Float: Z, type, Float: radius, world, interior, issuerid = INVALID_PLAYER_ID ) { foreach(new i : Player) {