Merged battle-royale into master

This commit is contained in:
Lorenc Pekaj 2019-02-18 00:32:49 +11:00
commit 8237e7047f
13 changed files with 1461 additions and 22 deletions

View File

@ -232,7 +232,7 @@ stock AC_SetPlayerHealth( playerid, Float:amount )
} }
AC_SetPlayerSpawned( playerid, false ); AC_SetPlayerSpawned( playerid, false );
CallRemoteFunction( "OnPlayerDeathEx", "ddfd", playerid, p_LastDamageIssuer[ playerid ], p_LastWeaponIssuer[ playerid ], 3.3, 3 ); SetTimerEx( "OnPlayerDeathEx", 10, false, "ddfd", playerid, p_LastDamageIssuer[ playerid ], p_LastWeaponIssuer[ playerid ], 3.3, 3 );
} }
return SetPlayerHealth( playerid, amount ); return SetPlayerHealth( playerid, amount );
} }

View File

@ -73,7 +73,7 @@ hook OnScriptInit( )
CreateEntrance( "[GAS STATION]", -1676.1494, 432.2187, 7.1797, -27.2923, -58.0535, 1003.5469, 6, 29, false, false, 55 ); CreateEntrance( "[GAS STATION]", -1676.1494, 432.2187, 7.1797, -27.2923, -58.0535, 1003.5469, 6, 29, false, false, 55 );
CreateEntrance( "[REVELATION CHURCH]", -2482.0703, 2406.6750, 17.1094, 2013.3900, 1589.8300, 977.0594, 1, 1, false, false, -1 ); CreateEntrance( "[REVELATION CHURCH]", -2482.0703, 2406.6750, 17.1094, 2013.3900, 1589.8300, 977.0594, 1, 1, false, false, -1 );
CreateEntrance( "[VEHICLE DEALERSHIP]", -2521.1895, -624.9482, 132.7838, -1868.0262, -617.5386, 1002.1284, 9, 32, true , false, 55 ); CreateEntrance( "[VEHICLE DEALERSHIP]", -2521.1895, -624.9482, 132.7838, -1868.0262, -617.5386, 1002.1284, 9, 32, true , false, 55 );
CreateEntrance( "[SOCCER STADIUM]", -2109.6680, -444.1471, 38.7344, -1807.8997, 435.8948, 1039.4382, 9, 32, true , false, 33 ); CreateEntrance( "[SOCCER STADIUM]", -2080.1951, -407.7742, 38.7344, -1807.8997, 435.8948, 1039.4382, 9, 32, true , false, 33 );
CreateEntrance( "[BOXING STADIUM]", -2051.5239, -407.7723, 38.7344, -281.8263, 10.5794, 2217.3096, 9, 32, true , false, 33 ); CreateEntrance( "[BOXING STADIUM]", -2051.5239, -407.7723, 38.7344, -281.8263, 10.5794, 2217.3096, 9, 32, true , false, 33 );
CreateEntrance( "[FILM STUDIO]", -2591.4668, 170.4937, 4.7348, 2330.5608, 897.3838, 1054.8489, 1, 21, true , false, 38 ); CreateEntrance( "[FILM STUDIO]", -2591.4668, 170.4937, 4.7348, 2330.5608, 897.3838, 1054.8489, 1, 21, true , false, 38 );
CreateEntrance( "[FREEFALL]", -1749.2736, 871.2025, 25.0859, -1753.7821, 883.8984, 295.6010, 0, 0, false, false, -1 ); CreateEntrance( "[FREEFALL]", -1749.2736, 871.2025, 25.0859, -1753.7821, 883.8984, 295.6010, 0, 0, false, false, -1 );

View File

@ -20,6 +20,7 @@
#include "irresistible\cnr\features\robbery\_robbery.pwn" #include "irresistible\cnr\features\robbery\_robbery.pwn"
#include "irresistible\cnr\features\player_items\_player_items.pwn" #include "irresistible\cnr\features\player_items\_player_items.pwn"
#include "irresistible\cnr\features\visage\_visage.pwn" #include "irresistible\cnr\features\visage\_visage.pwn"
#include "irresistible\cnr\features\battleroyale\_battleroyale.pwn"
// special (xmas/easter/nye) // special (xmas/easter/nye)
// #include "irresistible\cnr\features\christmas.pwn" // #include "irresistible\cnr\features\christmas.pwn"

View File

@ -0,0 +1,9 @@
/*
* Irresistible Gaming (c) 2018
* Developed by Lorenc
* Module: battleroyale/battleroyale.pwn
* Purpose: encloses all battleroyale related modules (warning: order of includes is very important)
*/
/* ** Includes ** */
#include "irresistible\cnr\features\battleroyale\battleroyale.pwn"

File diff suppressed because it is too large Load Diff

View File

@ -37,11 +37,7 @@ hook OnPlayerDisconnect( playerid, reason )
return 1; return 1;
} }
#if defined AC_INCLUDED hook OnPlayerSpawn( playerid )
hook OnPlayerDeathEx( playerid, killerid, reason, Float: damage, bodypart )
#else
hook OnPlayerDeath( playerid, killerid, reason )
#endif
{ {
StopPlayerFireTracker( playerid ); StopPlayerFireTracker( playerid );
return 1; return 1;

View File

@ -81,11 +81,12 @@ enum E_TURF_ZONE_DATA {
new new
g_gangTurfData [ MAX_TURFS ] [ E_TURF_ZONE_DATA ], g_gangTurfData [ MAX_TURFS ] [ E_TURF_ZONE_DATA ],
Iterator: turfs < MAX_TURFS >, Iterator: turfs < MAX_TURFS >,
Iterator: gangzoneturfs < MAX_TURFS >,
Float: g_weekAveragePlayers = 0.0, Float: g_weekAveragePlayers = 0.0,
Float: g_weekSecondsElapsed = 0.0, Float: g_weekSecondsElapsed = 0.0,
g_gangHardpointRotation = -1, // it will begin at 0 this way g_gangHardpointRotation = -1,
g_gangHardpointTurf = INVALID_GANG_TURF, g_gangHardpointTurf = INVALID_GANG_TURF,
g_gangHardpointPreviousTurf = INVALID_GANG_TURF, g_gangHardpointPreviousTurf = INVALID_GANG_TURF,
g_gangHardpointAttacker = INVALID_GANG_ID, g_gangHardpointAttacker = INVALID_GANG_ID,
@ -109,10 +110,14 @@ stock Float: Turf_GetHardpointPrizePool( Float: max_payout = 500000.0 )
/* ** Hooks ** */ /* ** Hooks ** */
hook OnGameModeInit( ) hook OnGameModeInit( )
{ {
/* ** Gangzone Allocation ** */ // Gangzone Allocation
for ( new i = 0; i < sizeof( g_gangzoneData ); i ++ ) { for ( new i = 0; i < sizeof( g_gangzoneData ); i ++ ) {
Turf_Create( g_gangzoneData[ i ] [ E_MIN_X ], g_gangzoneData[ i ] [ E_MIN_Y ], g_gangzoneData[ i ] [ E_MAX_X ], g_gangzoneData[ i ] [ E_MAX_Y ], INVALID_GANG_ID, COLOR_GANGZONE, .bordersize = GANGZONE_DEFAULT_BORDER_SIZE, .numbersize = GANGZONE_DEFAULT_NUMBER_SIZE ); new turfid = Turf_Create( g_gangzoneData[ i ] [ E_MIN_X ], g_gangzoneData[ i ] [ E_MIN_Y ], g_gangzoneData[ i ] [ E_MAX_X ], g_gangzoneData[ i ] [ E_MAX_Y ], INVALID_GANG_ID, COLOR_GANGZONE, .bordersize = GANGZONE_DEFAULT_BORDER_SIZE, .numbersize = GANGZONE_DEFAULT_NUMBER_SIZE );
Iter_Add( gangzoneturfs, turfid );
} }
// Reset Iterator
g_gangHardpointRotation = Iter_Last( gangzoneturfs );
return 1; return 1;
} }
@ -227,8 +232,15 @@ stock Turf_CreateHardpoint( )
} }
// fixed zone rotation // fixed zone rotation
if ( ! ( 0 <= g_gangHardpointRotation ++ < sizeof( g_gangzoneData ) - 1 ) ) { new current_rotation = g_gangHardpointRotation;
g_gangHardpointRotation = 0;
// reset rotation
if ( current_rotation >= Iter_Last( gangzoneturfs ) ) {
g_gangHardpointRotation = Iter_First( gangzoneturfs );
}
// get next in rotation
else {
g_gangHardpointRotation = Iter_Next( gangzoneturfs, current_rotation );
} }
// allocate new hardpoint // allocate new hardpoint
@ -253,7 +265,7 @@ stock Turf_CreateHardpoint( )
Turf_GetMiddlePos( g_gangHardpointTurf, middle_x, middle_y ); Turf_GetMiddlePos( g_gangHardpointTurf, middle_x, middle_y );
g_gangHardpointMapIcon = CreateDynamicMapIcon( middle_x, middle_y, 0.0, 19, -1, -1, -1, 0, 3000.0, MAPICON_GLOBAL ); g_gangHardpointMapIcon = CreateDynamicMapIcon( middle_x, middle_y, 0.0, 19, -1, .worldid = 0, .interiorid = 0, .playerid = 0, .streamdistance = 3000.0, .style = MAPICON_GLOBAL );
Streamer_RemoveArrayData( STREAMER_TYPE_MAP_ICON, g_gangHardpointMapIcon, E_STREAMER_PLAYER_ID, 0 ); Streamer_RemoveArrayData( STREAMER_TYPE_MAP_ICON, g_gangHardpointMapIcon, E_STREAMER_PLAYER_ID, 0 );
// redraw gangzones // redraw gangzones
@ -309,8 +321,15 @@ hook OnServerGameDayEnd( )
} }
} }
// get previous turf
new previous_turf = Iter_Prev( gangzoneturfs, g_gangHardpointTurf );
if ( previous_turf >= Iter_Last( gangzoneturfs ) ) {
previous_turf = INVALID_GANG_TURF;
}
// reset hardpoint // reset hardpoint
g_gangHardpointPreviousTurf = g_gangHardpointTurf; g_gangHardpointPreviousTurf = previous_turf;
g_gangHardpointTurf = INVALID_GANG_TURF; g_gangHardpointTurf = INVALID_GANG_TURF;
g_weekAveragePlayers = 0.0; g_weekAveragePlayers = 0.0;
g_weekSecondsElapsed = 0.0; g_weekSecondsElapsed = 0.0;
@ -529,6 +548,15 @@ stock Turf_IsAbleToTakeover( i ) {
return p_Class[ i ] == CLASS_CIVILIAN && ! IsPlayerSpawnProtected( i ) && ! IsPlayerPassive( i ) && ! IsPlayerAdminOnDuty( i ) && GetPlayerState( i ) != PLAYER_STATE_SPECTATING && ! IsPlayerAFK( i ) && Z <= 250.0; return p_Class[ i ] == CLASS_CIVILIAN && ! IsPlayerSpawnProtected( i ) && ! IsPlayerPassive( i ) && ! IsPlayerAdminOnDuty( i ) && GetPlayerState( i ) != PLAYER_STATE_SPECTATING && ! IsPlayerAFK( i ) && Z <= 250.0;
} }
stock Turf_HideAllGangZones( playerid )
{
foreach ( new x : turfs )
{
GangZoneHideForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ] );
}
return 1;
}
stock Turf_RedrawPlayerGangZones( playerid ) stock Turf_RedrawPlayerGangZones( playerid )
{ {
foreach ( new x : turfs ) foreach ( new x : turfs )

View File

@ -9,7 +9,7 @@
#include < YSI\y_hooks > #include < YSI\y_hooks >
/* ** Definitions ** */ /* ** Definitions ** */
#define MAX_GPS_WAYPOINTS ( 80 ) #define MAX_GPS_WAYPOINTS ( 81 )
/* ** Variables ** */ /* ** Variables ** */
enum E_GPS_DATA enum E_GPS_DATA
@ -62,6 +62,7 @@ hook OnScriptInit( playerid )
CreateNavigation( "Train Station", -1979.9883, 138.0498, 27.6875, CITY_SF, "Traindriver Minijob" ); CreateNavigation( "Train Station", -1979.9883, 138.0498, 27.6875, CITY_SF, "Traindriver Minijob" );
CreateNavigation( "Mining Field", -2232.9792, 251.5285, 34.8770, CITY_SF, "Mining Minijob" ); CreateNavigation( "Mining Field", -2232.9792, 251.5285, 34.8770, CITY_SF, "Mining Minijob" );
CreateNavigation( "Duel Arena", -2232.9792, 251.5285, 34.8770, CITY_SF, "Waged Duels" ); CreateNavigation( "Duel Arena", -2232.9792, 251.5285, 34.8770, CITY_SF, "Waged Duels" );
CreateNavigation( "Battle Royale Arena", -2109.6680, -444.147, 38.7344, CITY_SF, "Battle royale minigame" );
#if ENABLE_CITY_LV == true #if ENABLE_CITY_LV == true
// Las Venturas // Las Venturas

View File

@ -105,7 +105,7 @@ stock GivePassivePassengersWanted( playerid, vehicleid )
{ {
SetPlayerWantedLevel( pID, 6 ); SetPlayerWantedLevel( pID, 6 );
ShowPlayerHelpDialog( pID, 3000, "You are now considered wanted for associating yourself with a wanted player." ); ShowPlayerHelpDialog( pID, 3000, "You are now considered wanted for associating yourself with a wanted player." );
} }
} }
return true; return true;
} }
@ -123,11 +123,11 @@ stock IsPassivePlayerInVehicle( vehicleid )
return false; return false;
} }
stock DisablePlayerSpawnProtection( playerid ) stock DisablePlayerSpawnProtection( playerid, Float: default_health = 100.0 )
{ {
if ( p_AntiSpawnKillEnabled{ playerid } ) if ( p_AntiSpawnKillEnabled{ playerid } )
{ {
SetPlayerHealth( playerid, p_AdminOnDuty{ playerid } ? float( INVALID_PLAYER_ID ) : 100.0 ); SetPlayerHealth( playerid, p_AdminOnDuty{ playerid } ? float( INVALID_PLAYER_ID ) : default_health );
DisableRemoteVehicleCollisions( playerid, p_AdminOnDuty{ playerid } ); DisableRemoteVehicleCollisions( playerid, p_AdminOnDuty{ playerid } );
Delete3DTextLabel( p_SpawnKillLabel[ playerid ] ); Delete3DTextLabel( p_SpawnKillLabel[ playerid ] );
p_SpawnKillLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; p_SpawnKillLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID;

View File

@ -63,7 +63,8 @@ enum
E_STOCK_PAWN_STORE, E_STOCK_PAWN_STORE,
E_STOCK_CASINO, E_STOCK_CASINO,
E_STOCK_GOVERNMENT, E_STOCK_GOVERNMENT,
E_STOCK_AVIATION E_STOCK_AVIATION,
E_STOCK_BATTLE_ROYAL_CENTER
}; };
static stock static stock
@ -93,6 +94,7 @@ hook OnScriptInit( )
CreateStockMarket( E_STOCK_CASINO, "Casino", "CAS", 100000.0, 990.0, 7500.0, 100000.0, 150.0, "Money lost by players gambling" ); CreateStockMarket( E_STOCK_CASINO, "Casino", "CAS", 100000.0, 990.0, 7500.0, 100000.0, 150.0, "Money lost by players gambling" );
CreateStockMarket( E_STOCK_GOVERNMENT, "Government", "GOV", 100000.0, 750.0, 7500.0, 100000.0, 150.0, "Fireman and LEO activities" ); CreateStockMarket( E_STOCK_GOVERNMENT, "Government", "GOV", 100000.0, 750.0, 7500.0, 100000.0, 150.0, "Fireman and LEO activities" );
CreateStockMarket( E_STOCK_AVIATION, "Elitas Travel", "ET", 100000.0, 50.0, 500.0, 100000.0, 20.0, "Completed pilot missions and intercity travel" ); CreateStockMarket( E_STOCK_AVIATION, "Elitas Travel", "ET", 100000.0, 50.0, 500.0, 100000.0, 20.0, "Completed pilot missions and intercity travel" );
CreateStockMarket( E_STOCK_BATTLE_ROYAL_CENTER, "Battle Royale Center", "BRC", 100000.0, 50.0, 500.0, 100000.0, 20.0, "Battle Royale minigame fees" );
// force inactive share holders to sell their shares on startup // force inactive share holders to sell their shares on startup
mysql_tquery( dbHandle, sprintf( "SELECT so.* FROM `STOCK_OWNERS` so JOIN `USERS` u ON so.`USER_ID`=u.`ID` WHERE UNIX_TIMESTAMP()-u.`LASTLOGGED` > 604800 AND so.`USER_ID` != %d", STOCK_MM_USER_ID ), "StockMarket_ForceShareSale", "" ); mysql_tquery( dbHandle, sprintf( "SELECT so.* FROM `STOCK_OWNERS` so JOIN `USERS` u ON so.`USER_ID`=u.`ID` WHERE UNIX_TIMESTAMP()-u.`LASTLOGGED` > 604800 AND so.`USER_ID` != %d", STOCK_MM_USER_ID ), "StockMarket_ForceShareSale", "" );

View File

@ -29,6 +29,7 @@
#define SetPlayerPosEx(%0,%1,%2,%3,%4) SetPlayerPos(%0,%1,%2,%3),SetPlayerInterior(%0,%4) #define SetPlayerPosEx(%0,%1,%2,%3,%4) SetPlayerPos(%0,%1,%2,%3),SetPlayerInterior(%0,%4)
#define mysql_single_query(%0) mysql_tquery(dbHandle,(%0),"","") #define mysql_single_query(%0) mysql_tquery(dbHandle,(%0),"","")
#define points_format(%0) (number_format(%0, .prefix = '\0', .decimals = 2)) #define points_format(%0) (number_format(%0, .prefix = '\0', .decimals = 2))
#define bool_to_string(%0) (%0 == true ? (COL_GREEN # "YES" # COL_WHITE) : (COL_RED # "NO" # COL_WHITE))
// Defines // Defines
#define KEY_AIM (128) #define KEY_AIM (128)

View File

@ -157,7 +157,7 @@ hook OnPlayerFloodControl( playerid, iCount, iTimeSpan ) {
} }
return 1; return 1;
} }
#else
// aims to clear the banned from the server bug // aims to clear the banned from the server bug
hook OnIncomingConnection( playerid, ip_address[ ], port ) { hook OnIncomingConnection( playerid, ip_address[ ], port ) {
SendRconCommand( "reloadbans" ); SendRconCommand( "reloadbans" );

View File

@ -1065,7 +1065,7 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b
return 0; return 0;
// Anti RDM and gang member damage // Anti RDM and gang member damage
if ( ! IsPlayerInEvent( playerid ) && ! IsPlayerInPaintBall( playerid ) && ! IsPlayerBoxing( playerid ) && ! IsPlayerDueling( playerid ) ) if ( ! IsPlayerInEvent( playerid ) && ! IsPlayerInPaintBall( playerid ) && ! IsPlayerBoxing( playerid ) && ! IsPlayerDueling( playerid ) && ! IsPlayerInBattleRoyale( playerid ) )
{ {
if ( IsPlayerInPlayerGang( issuerid, playerid ) ) { if ( IsPlayerInPlayerGang( issuerid, playerid ) ) {
return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage your homies!" ), 0; return ShowPlayerHelpDialog( issuerid, 2000, "You cannot damage your homies!" ), 0;
@ -7115,7 +7115,7 @@ stock CanPlayerExitEntrance( playerid ) return g_iTime > p_EntranceTimestamp[ pl
stock IsBuyableVehicle( vehicleid ) return g_buyableVehicle{ vehicleid }; stock IsBuyableVehicle( vehicleid ) return g_buyableVehicle{ vehicleid };
stock IsPlayerInMinigame( playerid ) { stock IsPlayerInMinigame( playerid ) {
return IsPlayerInPaintBall( playerid ) || IsPlayerDueling( playerid ) || IsPlayerPlayingPool( playerid ) || IsPlayerPlayingPoker( playerid ); return IsPlayerInPaintBall( playerid ) || IsPlayerDueling( playerid ) || IsPlayerPlayingPool( playerid ) || IsPlayerPlayingPoker( playerid ) || IsPlayerInBattleRoyale( playerid );
} }
stock SendClientMessageToCops( colour, const format[ ], va_args<> ) stock SendClientMessageToCops( colour, const format[ ], va_args<> )