commit
306f1b01d5
@ -24,6 +24,7 @@ CMD:destroyallav( playerid, params[ ] )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined __cloudy_event_system
|
||||||
CMD:event( playerid, params[ ] )
|
CMD:event( playerid, params[ ] )
|
||||||
{
|
{
|
||||||
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
if ( p_AdminLevel[ playerid ] < 4 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
||||||
@ -31,6 +32,7 @@ CMD:event( playerid, params[ ] )
|
|||||||
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have your world to 69." );
|
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have your world to 69." );
|
||||||
return SetPlayerVirtualWorld( playerid, 69 );
|
return SetPlayerVirtualWorld( playerid, 69 );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CMD:setworld( playerid, params[ ] )
|
CMD:setworld( playerid, params[ ] )
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
|||||||
return cmd_help( playerid, "" );
|
return cmd_help( playerid, "" );
|
||||||
|
|
||||||
if ( listitem >= 64 )
|
if ( listitem >= 64 )
|
||||||
return SendError( playerid, "Unable to process request, contact Damen in regards to this." );
|
return SendError( playerid, "Unable to process request, contact " SERVER_OPERATOR " in regards to this." );
|
||||||
|
|
||||||
new
|
new
|
||||||
digits[ 64 ];
|
digits[ 64 ];
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#include "irresistible\cnr\features\visage\_visage.pwn"
|
#include "irresistible\cnr\features\visage\_visage.pwn"
|
||||||
#include "irresistible\cnr\features\battleroyale\_battleroyale.pwn"
|
#include "irresistible\cnr\features\battleroyale\_battleroyale.pwn"
|
||||||
|
|
||||||
|
// developer exclusive modules
|
||||||
|
#include "irresistible\cnr\features\cloudy\_cloudy.pwn"
|
||||||
|
|
||||||
// special (xmas/easter/nye)
|
// special (xmas/easter/nye)
|
||||||
// #include "irresistible\cnr\features\christmas.pwn"
|
// #include "irresistible\cnr\features\christmas.pwn"
|
||||||
#include "irresistible\cnr\features\eastereggs.pwn"
|
#include "irresistible\cnr\features\eastereggs.pwn"
|
||||||
|
@ -354,7 +354,6 @@ stock CreateLoopingAnimation( playerid, animlib[ ], animname[ ], Float:Speed, lo
|
|||||||
else if ( IsPlayerInWater( playerid ) ) return SendError( playerid, "You cannot use this command since you're in water." );
|
else if ( IsPlayerInWater( playerid ) ) return SendError( playerid, "You cannot use this command since you're in water." );
|
||||||
else if ( IsPlayerMining( playerid ) ) return SendError( playerid, "You cannot use this command since you're mining." );
|
else if ( IsPlayerMining( playerid ) ) return SendError( playerid, "You cannot use this command since you're mining." );
|
||||||
else if ( IsPlayerBoxing( playerid ) ) return SendError( playerid, "You cannot use this command since you're boxing." );
|
else if ( IsPlayerBoxing( playerid ) ) return SendError( playerid, "You cannot use this command since you're boxing." );
|
||||||
else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." );
|
|
||||||
else if ( GetPlayerAnimationIndex( playerid ) == 1660 ) return SendError( playerid, "You cannot use this command since you're using a vending machine." );
|
else if ( GetPlayerAnimationIndex( playerid ) == 1660 ) return SendError( playerid, "You cannot use this command since you're using a vending machine." );
|
||||||
else if ( IsPlayerAttachedObjectSlotUsed( playerid, 0 ) ) return SendError( playerid, "You cannot use this command since you're robbing." );
|
else if ( IsPlayerAttachedObjectSlotUsed( playerid, 0 ) ) return SendError( playerid, "You cannot use this command since you're robbing." );
|
||||||
else if ( IsPlayingAnimation( playerid, "ROB_BANK", "CAT_Safe_Rob" ) ) return SendError( playerid, "You cannot use this command since you're robbing." );
|
else if ( IsPlayingAnimation( playerid, "ROB_BANK", "CAT_Safe_Rob" ) ) return SendError( playerid, "You cannot use this command since you're robbing." );
|
||||||
@ -365,6 +364,16 @@ stock CreateLoopingAnimation( playerid, animlib[ ], animname[ ], Float:Speed, lo
|
|||||||
else if ( GetPlayerWeapon( playerid ) == 46 ) return SendError( playerid, "You cannot use this command while wearing a parachute." );
|
else if ( GetPlayerWeapon( playerid ) == 46 ) return SendError( playerid, "You cannot use this command while wearing a parachute." );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// event check
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_KIDNAP ) )
|
||||||
|
#else
|
||||||
|
if ( IsPlayerInEvent( playerid ) )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
|
||||||
SetPlayerSpecialAction( playerid, 0 );
|
SetPlayerSpecialAction( playerid, 0 );
|
||||||
if ( specialaction == 0 ) {
|
if ( specialaction == 0 ) {
|
||||||
ApplyAnimation( playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0 );
|
ApplyAnimation( playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0 );
|
||||||
|
@ -154,7 +154,11 @@ hook OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) {
|
|||||||
/* ** Commands ** */
|
/* ** Commands ** */
|
||||||
CMD:c4( playerid, params[ ] )
|
CMD:c4( playerid, params[ ] )
|
||||||
{
|
{
|
||||||
if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." );
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_C4 ) ) {
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( !strcmp( params, "plant", true, 5 ) )
|
if ( !strcmp( params, "plant", true, 5 ) )
|
||||||
{
|
{
|
||||||
|
3
gamemodes/irresistible/cnr/features/cloudy/.gitignore
vendored
Normal file
3
gamemodes/irresistible/cnr/features/cloudy/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.pwn
|
||||||
|
*.amx
|
||||||
|
!_cloudy.pwn
|
9
gamemodes/irresistible/cnr/features/cloudy/_cloudy.pwn
Normal file
9
gamemodes/irresistible/cnr/features/cloudy/_cloudy.pwn
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Irresistible Gaming (c) 2019
|
||||||
|
* Developed by Cloudy
|
||||||
|
* Module: cnr\features\cloudy\_cloudy.pwn
|
||||||
|
* Purpose: encloses all of cloudy's module related work
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ** Includes ** */
|
||||||
|
#tryinclude "irresistible\cnr\features\cloudy\event_system.pwn"
|
@ -115,9 +115,19 @@ CMD:taze( playerid, params[ ] )
|
|||||||
if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command while in jail." );
|
if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command while in jail." );
|
||||||
if ( IsPlayerTied( victimid ) ) return SendError( playerid, "Tazing a tied player is pretty useless, though you can use /untie for a harder job!" );
|
if ( IsPlayerTied( victimid ) ) return SendError( playerid, "Tazing a tied player is pretty useless, though you can use /untie for a harder job!" );
|
||||||
if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." );
|
if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." );
|
||||||
if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." );
|
|
||||||
if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." );
|
if ( GetPlayerState( playerid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot use this command since you are dead." );
|
||||||
if ( p_TazingImmunity[ victimid ] > g_iTime ) return SendError( playerid, "You must wait %d seconds before tazing this player.", p_TazingImmunity[ victimid ] - g_iTime );
|
if ( p_TazingImmunity[ victimid ] > g_iTime ) return SendError( playerid, "You must wait %d seconds before tazing this player.", p_TazingImmunity[ victimid ] - g_iTime );
|
||||||
|
|
||||||
|
// event check
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_KIDNAP ) )
|
||||||
|
#else
|
||||||
|
if ( IsPlayerInEvent( playerid ) )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
|
||||||
if ( random( 101 ) < 90 )
|
if ( random( 101 ) < 90 )
|
||||||
{
|
{
|
||||||
GameTextForPlayer( victimid, "~n~~r~TAZED!", 2000, 4 );
|
GameTextForPlayer( victimid, "~n~~r~TAZED!", 2000, 4 );
|
||||||
|
@ -635,7 +635,7 @@ thread OnPlayerGangLoaded( playerid )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
p_GangID[ playerid ] = -1;
|
p_GangID[ playerid ] = -1;
|
||||||
SendServerMessage( playerid, "Had an issue loading your gang. Contact Damen (0x92F)." );
|
SendServerMessage( playerid, "Had an issue loading your gang. Contact " SERVER_OPERATOR " (0x92F)." );
|
||||||
printf("[GANG] [ERROR] Had an issue loading a gang row id %d", gang_sql_id );
|
printf("[GANG] [ERROR] Had an issue loading a gang row id %d", gang_sql_id );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Irresistible Gaming (c) 2018
|
* Irresistible Gaming (c) 2018
|
||||||
* Developed by Lorenc
|
* Developed by Lorenc
|
||||||
* Module:
|
* Module: cnr\features\gangs\turfs.pwn
|
||||||
* Purpose:
|
* Purpose: turfing module for gangs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* ** Includes ** */
|
/* ** Includes ** */
|
||||||
@ -15,11 +15,12 @@
|
|||||||
#define MAX_TURFS ( sizeof( g_gangzoneData ) )
|
#define MAX_TURFS ( sizeof( g_gangzoneData ) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define INVALID_GANG_TURF ( -1 )
|
|
||||||
#define TAKEOVER_NEEDED_PEOPLE ( 1 )
|
|
||||||
|
|
||||||
#define COLOR_GANGZONE 0x00000080
|
#define COLOR_GANGZONE 0x00000080
|
||||||
|
|
||||||
|
#define INVALID_GANG_TURF ( -1 )
|
||||||
|
|
||||||
|
#define TAKEOVER_NEEDED_PEOPLE ( 1 )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Mean (μ): 61551.012315113
|
Mean (μ): 61551.012315113
|
||||||
Median: 38190.51
|
Median: 38190.51
|
||||||
@ -97,7 +98,7 @@ new
|
|||||||
forward OnPlayerUpdateGangZone( playerid, zoneid );
|
forward OnPlayerUpdateGangZone( playerid, zoneid );
|
||||||
|
|
||||||
/* ** Hooks ** */
|
/* ** Hooks ** */
|
||||||
hook OnScriptInit( )
|
hook OnGameModeInit( )
|
||||||
{
|
{
|
||||||
/* ** Gangzone Allocation ** */
|
/* ** Gangzone Allocation ** */
|
||||||
for ( new i = 0; i < sizeof( g_gangzoneData ); i++ ) {
|
for ( new i = 0; i < sizeof( g_gangzoneData ); i++ ) {
|
||||||
@ -106,170 +107,12 @@ hook OnScriptInit( )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
hook OnGangUnload( gangid, bool: deleted )
|
hook OnServerUpdate( )
|
||||||
{
|
|
||||||
// Empty out the turfs
|
|
||||||
foreach ( new z : turfs )
|
|
||||||
{
|
|
||||||
if ( g_gangTurfData[ z ] [ E_OWNER ] == gangid )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
facility_gang = g_gangTurfData[ z ] [ E_FACILITY_GANG ];
|
|
||||||
|
|
||||||
if ( g_gangTurfData[ z ] [ E_FACILITY_GANG ] != INVALID_GANG_ID && Iter_Contains( gangs, g_gangTurfData[ z ] [ E_FACILITY_GANG ] ) )
|
|
||||||
{
|
|
||||||
g_gangTurfData[ z ] [ E_COLOR ] = setAlpha( g_gangData[ facility_gang ] [ E_COLOR ], 0x80 );
|
|
||||||
g_gangTurfData[ z ] [ E_OWNER ] = facility_gang;
|
|
||||||
GangZoneShowForAll( g_gangTurfData[ z ] [ E_ID ], g_gangTurfData[ z ] [ E_COLOR ] );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_gangTurfData[ z ] [ E_COLOR ] = COLOR_GANGZONE;
|
|
||||||
g_gangTurfData[ z ] [ E_OWNER ] = INVALID_GANG_ID;
|
|
||||||
GangZoneShowForAll( g_gangTurfData[ z ] [ E_ID ], COLOR_GANGZONE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerGangChangeColor( playerid, gangid )
|
|
||||||
{
|
|
||||||
foreach ( new x : turfs )
|
|
||||||
{
|
|
||||||
// set the new color to the turfs
|
|
||||||
if ( g_gangTurfData[ x ] [ E_OWNER ] == gangid ) {
|
|
||||||
g_gangTurfData[ x ] [ E_COLOR ] = setAlpha( g_gangData[ gangid ] [ E_COLOR ], 0x80 );
|
|
||||||
}
|
|
||||||
|
|
||||||
// resume flashing if gang war
|
|
||||||
if ( g_gangzoneAttacker[ x ] == gangid ) {
|
|
||||||
GangZoneStopFlashForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ] );
|
|
||||||
GangZoneFlashForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ], setAlpha( g_gangData[ gangid ] [ E_COLOR ], 0x80 ) );
|
|
||||||
} else {
|
|
||||||
GangZoneHideForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ] );
|
|
||||||
GangZoneShowForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ], g_gangTurfData[ x ] [ E_COLOR ] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerSpawn( playerid )
|
|
||||||
{
|
|
||||||
foreach( new zoneid : turfs )
|
|
||||||
{
|
|
||||||
// resume flashing if gang war
|
|
||||||
if ( g_gangzoneAttacker[ zoneid ] != INVALID_GANG_ID && Iter_Contains( gangs, g_gangzoneAttacker[ zoneid ] ) ) {
|
|
||||||
GangZoneFlashForPlayer( playerid, g_gangTurfData[ zoneid ] [ E_ID ], setAlpha( g_gangData[ g_gangzoneAttacker[ zoneid ] ] [ E_COLOR ], 0x80 ) );
|
|
||||||
} else {
|
|
||||||
GangZoneShowForPlayer( playerid, g_gangTurfData[ zoneid ] [ E_ID ], g_gangTurfData[ zoneid ] [ E_COLOR ] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerEnterDynArea( playerid, areaid )
|
|
||||||
{
|
|
||||||
if ( ! IsPlayerNPC( playerid ) )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
first_turf = Turf_GetFirstTurf( playerid );
|
|
||||||
|
|
||||||
CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, first_turf );
|
|
||||||
}
|
|
||||||
return Y_HOOKS_CONTINUE_RETURN_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerLeaveDynArea( playerid, areaid )
|
|
||||||
{
|
|
||||||
if ( ! IsPlayerNPC( playerid ) )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
total_areas = GetPlayerNumberDynamicAreas( playerid );
|
|
||||||
|
|
||||||
// reduced to another area
|
|
||||||
if ( total_areas )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
first_turf = Turf_GetFirstTurf( playerid );
|
|
||||||
|
|
||||||
CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, first_turf );
|
|
||||||
}
|
|
||||||
|
|
||||||
// if the player is in no areas, then they left
|
|
||||||
else CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, INVALID_GANG_TURF );
|
|
||||||
}
|
|
||||||
return Y_HOOKS_CONTINUE_RETURN_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OnPlayerUpdateGangZone( playerid, zoneid )
|
|
||||||
{
|
|
||||||
if ( ! IsPlayerMovieMode( playerid ) )
|
|
||||||
{
|
|
||||||
if ( zoneid == INVALID_GANG_TURF )
|
|
||||||
return PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "_" );
|
|
||||||
|
|
||||||
// if ( p_GangID[ playerid ] != INVALID_GANG_ID && g_gangTurfData[ zoneid ] [ E_OWNER ] == INVALID_GANG_ID )
|
|
||||||
// ShowPlayerHelpDialog( playerid, 10000, "You can take over this turf by typing ~g~/takeover" );
|
|
||||||
|
|
||||||
PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~r~~h~(%s)~n~~w~~h~%s", g_gangTurfData[ zoneid ] [ E_FACILITY_GANG ] != INVALID_GANG_ID ? ( "FACILITY" ) : ( "TERRITORY" ), g_gangTurfData[ zoneid ] [ E_OWNER ] == -1 ? ( "Uncaptured" ) : ( ReturnGangName( g_gangTurfData[ zoneid ] [ E_OWNER ] ) ) ) );
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnServerGameDayEnd( )
|
|
||||||
{
|
|
||||||
foreach(new g : gangs)
|
|
||||||
{
|
|
||||||
|
|
||||||
new online_members = GetOnlineGangMembers( g );
|
|
||||||
|
|
||||||
if ( online_members >= TAKEOVER_NEEDED_PEOPLE )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
profit = 0;
|
|
||||||
|
|
||||||
foreach( new zoneid : turfs ) if ( g_gangTurfData[ zoneid ] [ E_OWNER ] != INVALID_GANG_ID && g_gangTurfData[ zoneid ] [ E_OWNER ] == g )
|
|
||||||
{
|
|
||||||
// facilities will not pay out respect
|
|
||||||
if ( g_gangTurfData[ zoneid ] [ E_FACILITY_GANG ] == INVALID_GANG_ID ) {
|
|
||||||
g_gangData[ g ] [ E_RESPECT ] ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// accumulate profit
|
|
||||||
profit += Turf_GetProfitability( zoneid, online_members );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( profit > 0 ) {
|
|
||||||
GiveGangCash( g, profit );
|
|
||||||
SaveGangData( g );
|
|
||||||
SendClientMessageToGang( g, g_gangData[ g ] [ E_COLOR ], "[GANG] "COL_GOLD"%s"COL_WHITE" has been earned from territories and deposited in the gang bank account.", cash_format( profit ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach( new p : Player )
|
|
||||||
{
|
|
||||||
if ( IsPlayerAdmin( p ) )
|
|
||||||
{
|
|
||||||
format( szNormalString, sizeof( szNormalString ), "Gang ID: %i - Online Active Members: %i - Profit: %i", g, online_members, profit );
|
|
||||||
SendClientMessage( p, -1, szNormalString );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnServerTickSecond( )
|
|
||||||
{
|
{
|
||||||
new
|
new
|
||||||
oCount = 0;
|
oCount = 0;
|
||||||
|
|
||||||
foreach( new z : turfs )
|
foreach ( new z : turfs )
|
||||||
{
|
{
|
||||||
if ( g_gangzoneAttacker[ z ] != INVALID_GANG_ID )
|
if ( g_gangzoneAttacker[ z ] != INVALID_GANG_ID )
|
||||||
{
|
{
|
||||||
@ -303,7 +146,7 @@ hook OnServerTickSecond( )
|
|||||||
static szLocation[ MAX_ZONE_NAME ], szCity[ MAX_ZONE_NAME ];
|
static szLocation[ MAX_ZONE_NAME ], szCity[ MAX_ZONE_NAME ];
|
||||||
|
|
||||||
new earned_money = 0;
|
new earned_money = 0;
|
||||||
//new owner_gang = g_gangTurfData[ z ] [ E_OWNER ];
|
new owner_gang = g_gangTurfData[ z ] [ E_OWNER ];
|
||||||
new attacker_gang = g_gangzoneAttacker[ z ];
|
new attacker_gang = g_gangzoneAttacker[ z ];
|
||||||
|
|
||||||
new Float: min_x, Float: min_y;
|
new Float: min_x, Float: min_y;
|
||||||
@ -324,13 +167,20 @@ hook OnServerTickSecond( )
|
|||||||
g_gangzoneAttackTimeout [ z ] = 0;
|
g_gangzoneAttackTimeout [ z ] = 0;
|
||||||
|
|
||||||
// Money Grub
|
// Money Grub
|
||||||
if ( Iter_Contains( gangs, attacker_gang ) )
|
if ( Iter_Contains( gangs, owner_gang ) )
|
||||||
{
|
{
|
||||||
new online_opmembers = GetOnlineGangMembers( attacker_gang );
|
new afk_opmembers, online_opmembers = GetOnlineGangMembers( owner_gang, .afk_members = afk_opmembers );
|
||||||
new zone_money = Turf_GetProfitability( z, online_opmembers );
|
new zone_money = Turf_GetProfitability( z, online_opmembers - afk_opmembers );
|
||||||
|
|
||||||
earned_money = floatround( float( zone_money ) * 0.5 );
|
if ( g_gangData[ owner_gang ] [ E_BANK ] > zone_money )
|
||||||
GiveGangCash( attacker_gang, earned_money );
|
{
|
||||||
|
// deduct from gang bank and give to op, take 10% as fee
|
||||||
|
g_gangData[ owner_gang ] [ E_BANK ] -= zone_money;
|
||||||
|
SaveGangData( owner_gang );
|
||||||
|
|
||||||
|
earned_money = floatround( float( zone_money ) * 0.9 );
|
||||||
|
g_gangData[ attacker_gang ] [ E_BANK ] += earned_money;
|
||||||
|
}
|
||||||
|
|
||||||
// credit respect
|
// credit respect
|
||||||
g_gangData[ attacker_gang ] [ E_RESPECT ] ++;
|
g_gangData[ attacker_gang ] [ E_RESPECT ] ++;
|
||||||
@ -390,126 +240,111 @@ hook OnServerTickSecond( )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ** Functions ** */
|
hook OnServerGameDayEnd( )
|
||||||
stock Turf_Create( Float: min_x, Float: min_y, Float: max_x, Float: max_y, owner_id = INVALID_GANG_ID, color = COLOR_GANGZONE, facility_gang_id = INVALID_GANG_ID )
|
|
||||||
{
|
{
|
||||||
new
|
// payday for gangs holding turfs
|
||||||
id = Iter_Free( turfs );
|
foreach ( new g : gangs )
|
||||||
|
|
||||||
if ( id != ITER_NONE )
|
|
||||||
{
|
{
|
||||||
// set turf owners
|
new
|
||||||
g_gangTurfData[ id ] [ E_OWNER ] = owner_id;
|
afk_members, online_members = GetOnlineGangMembers( g, .afk_members = afk_members );
|
||||||
g_gangTurfData[ id ] [ E_COLOR ] = color;
|
|
||||||
g_gangTurfData[ id ] [ E_FACILITY_GANG ] = facility_gang_id;
|
|
||||||
|
|
||||||
// create area
|
printf("Online %d/%d",online_members,afk_members);
|
||||||
g_gangTurfData[ id ] [ E_ID ] = GangZoneCreate( min_x, min_y, max_x, max_y );
|
if ( online_members >= TAKEOVER_NEEDED_PEOPLE )
|
||||||
g_gangTurfData[ id ] [ E_AREA ] = CreateDynamicRectangle( min_x, min_y, max_x, max_y, 0, 0 );
|
|
||||||
|
|
||||||
// add to iterator
|
|
||||||
Iter_Add( turfs, id );
|
|
||||||
}
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetCentrePos( zoneid, &Float: X, &Float: Y ) // should return the centre but will do for now
|
|
||||||
{
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MIN_X, X );
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MIN_Y, Y );
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetOwner( id ) {
|
|
||||||
return g_gangTurfData[ id ] [ E_OWNER ];
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetFacility( id ) {
|
|
||||||
return g_gangTurfData[ id ] [ E_FACILITY_GANG ];
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetFirstTurf( playerid )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
current_areas[ 4 ];
|
|
||||||
|
|
||||||
GetPlayerDynamicAreas( playerid, current_areas );
|
|
||||||
|
|
||||||
foreach( new i : Reverse(turfs) )
|
|
||||||
{
|
|
||||||
if ( current_areas[ 0 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 1 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 2 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 3 ] == g_gangTurfData[ i ] [ E_AREA ] )
|
|
||||||
{
|
{
|
||||||
return i;
|
new
|
||||||
|
profit = 0;
|
||||||
|
|
||||||
|
foreach( new zoneid : turfs ) if ( g_gangTurfData[ zoneid ] [ E_OWNER ] != INVALID_GANG_ID && g_gangTurfData[ zoneid ] [ E_OWNER ] == g )
|
||||||
|
{
|
||||||
|
// facilities will not pay out respect
|
||||||
|
if ( g_gangTurfData[ zoneid ] [ E_FACILITY_GANG ] == INVALID_GANG_ID ) {
|
||||||
|
g_gangData[ g ] [ E_RESPECT ] ++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// accumulate profit
|
||||||
|
profit += Turf_GetProfitability( zoneid, online_members - afk_members );
|
||||||
|
}
|
||||||
|
|
||||||
|
GiveGangCash( g, profit );
|
||||||
|
|
||||||
|
if ( profit > 0 ) {
|
||||||
|
SaveGangData( g );
|
||||||
|
SendClientMessageToGang( g, g_gangData[ g ] [ E_COLOR ], "[GANG] "COL_GOLD"%s"COL_WHITE" has been earned from territories and deposited in the gang bank account.", cash_format( profit ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
stock Turf_GetProfitability( zoneid, gang_members, Float: default_pay = 750.0 )
|
hook OnPlayerEnterDynArea( playerid, areaid )
|
||||||
{
|
{
|
||||||
// size adjustments
|
if ( ! IsPlayerNPC( playerid ) )
|
||||||
if ( g_gangzoneData[ zoneid ] [ E_SIZE ] < TURF_SIZE_SMALL ) // lower than 1st quartile, decrease pay
|
|
||||||
default_pay *= 0.75;
|
|
||||||
|
|
||||||
if ( g_gangzoneData[ zoneid ] [ E_SIZE ] > TURF_SIZE_LARGE ) // higher than 1st quartile, increase pay
|
|
||||||
default_pay *= 1.25;
|
|
||||||
|
|
||||||
// city adjustments
|
|
||||||
if ( g_gangzoneData[ zoneid ] [ E_CITY ] == CITY_SF )
|
|
||||||
default_pay *= 1.25;
|
|
||||||
|
|
||||||
if ( g_gangzoneData[ zoneid ] [ E_CITY ] == CITY_COUNTRY || g_gangzoneData[ zoneid ] [ E_CITY ] == CITY_DESERTS )
|
|
||||||
default_pay *= 1.1;
|
|
||||||
|
|
||||||
// handle online active players boost
|
|
||||||
new Float: player_boost = 0.06 * float( gang_members ) + 0.75;
|
|
||||||
default_pay *= player_boost > 1.35 ? 1.35 : player_boost;
|
|
||||||
|
|
||||||
// return rounded number
|
|
||||||
return floatround( default_pay );
|
|
||||||
}
|
|
||||||
|
|
||||||
stock GetGangCapturedTurfs( gangid )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
z,
|
|
||||||
c;
|
|
||||||
|
|
||||||
foreach ( z : turfs ) if ( g_gangTurfData[ z ] [ E_OWNER ] != INVALID_GANG_ID && g_gangTurfData[ z ] [ E_OWNER ] == gangid ) {
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock GetPlayersInGangZone( z, g, &is_afk = 0, &in_air = 0 )
|
|
||||||
{
|
|
||||||
if ( g == INVALID_GANG_ID )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
new count = 0;
|
|
||||||
new Float: Z;
|
|
||||||
|
|
||||||
foreach ( new i : Player ) if ( p_Class[ i ] == CLASS_CIVILIAN && p_GangID[ i ] == g && IsPlayerInDynamicArea( i, g_gangTurfData[ z ] [ E_AREA ] ) )
|
|
||||||
{
|
{
|
||||||
if ( GetPlayerState( i ) != PLAYER_STATE_SPECTATING )
|
new
|
||||||
|
first_turf = Turf_GetFirstTurf( playerid );
|
||||||
|
|
||||||
|
if ( ! IsPlayerMovieMode( playerid ) )
|
||||||
{
|
{
|
||||||
if ( IsPlayerAFK( i ) )
|
if ( first_turf == INVALID_GANG_TURF )
|
||||||
{
|
return PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "_" );
|
||||||
is_afk++;
|
|
||||||
continue;
|
// if ( p_GangID[ playerid ] != INVALID_GANG_ID && g_gangTurfData[ first_turf ] [ E_OWNER ] == INVALID_GANG_ID ) ShowPlayerHelpDialog( playerid, 2000, "You can take over this turf by typing ~g~/takeover" );
|
||||||
}
|
PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~r~~h~(%s)~n~~w~~h~%s", g_gangTurfData[ first_turf ] [ E_FACILITY_GANG ] != INVALID_GANG_ID ? ( "FACILITY" ) : ( "TERRITORY" ), ReturnGangName( g_gangTurfData[ first_turf ] [ E_OWNER ] ) ) );
|
||||||
if ( GetPlayerPos( i, Z, Z, Z ) && Z >= 300.0 )
|
|
||||||
{
|
|
||||||
in_air++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count;
|
return Y_HOOKS_CONTINUE_RETURN_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
hook OnPlayerSpawn( playerid )
|
||||||
|
{
|
||||||
|
// Gang Zones
|
||||||
|
foreach( new zoneid : turfs )
|
||||||
|
{
|
||||||
|
// resume flashing if gang war
|
||||||
|
if ( g_gangzoneAttacker[ zoneid ] != INVALID_GANG_ID && Iter_Contains( gangs, g_gangzoneAttacker[ zoneid ] ) ) {
|
||||||
|
GangZoneFlashForPlayer( playerid, g_gangTurfData[ zoneid ] [ E_ID ], setAlpha( g_gangData[ g_gangzoneAttacker[ zoneid ] ] [ E_COLOR ], 0x80 ) );
|
||||||
|
} else {
|
||||||
|
GangZoneShowForPlayer( playerid, g_gangTurfData[ zoneid ] [ E_ID ], g_gangTurfData[ zoneid ] [ E_COLOR ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
hook OnPlayerUnloadTextdraws( playerid )
|
||||||
|
{
|
||||||
|
PlayerTextDrawHide( playerid, g_ZoneOwnerTD[ playerid ] );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
hook OnPlayerLoadTextdraws( playerid )
|
||||||
|
{
|
||||||
|
PlayerTextDrawShow( playerid, g_ZoneOwnerTD[ playerid ] );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
hook OnPlayerLeaveDynArea( playerid, areaid )
|
||||||
|
{
|
||||||
|
if ( ! IsPlayerNPC( playerid ) )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
total_areas = GetPlayerNumberDynamicAreas( playerid );
|
||||||
|
|
||||||
|
// reduced to another area
|
||||||
|
if ( total_areas )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
first_turf = Turf_GetFirstTurf( playerid );
|
||||||
|
|
||||||
|
CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, first_turf );
|
||||||
|
}
|
||||||
|
|
||||||
|
// if the player is in no areas, then they left
|
||||||
|
else CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, INVALID_GANG_TURF );
|
||||||
|
}
|
||||||
|
return Y_HOOKS_CONTINUE_RETURN_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ** Commands ** */
|
/* ** Commands ** */
|
||||||
@ -524,9 +359,6 @@ CMD:takeover( playerid, params[ ] )
|
|||||||
if ( GetPlayerInterior( playerid ) != 0 && GetPlayerVirtualWorld( playerid ) != 0 )
|
if ( GetPlayerInterior( playerid ) != 0 && GetPlayerVirtualWorld( playerid ) != 0 )
|
||||||
return SendError( playerid, "You cannot do this inside interiors." );
|
return SendError( playerid, "You cannot do this inside interiors." );
|
||||||
|
|
||||||
if ( IsPlayerAdminOnDuty( playerid ) )
|
|
||||||
return SendError( playerid, "You can't capture while on duty!" );
|
|
||||||
|
|
||||||
if ( IsPlayerJailed( playerid ) || IsPlayerUsingOrbitalCannon( playerid ) )
|
if ( IsPlayerJailed( playerid ) || IsPlayerUsingOrbitalCannon( playerid ) )
|
||||||
return SendError( playerid, "You cannot do this at the moment." );
|
return SendError( playerid, "You cannot do this at the moment." );
|
||||||
|
|
||||||
@ -545,6 +377,7 @@ CMD:takeover( playerid, params[ ] )
|
|||||||
if ( g_gangzoneAttacker[ z ] != INVALID_GANG_ID ) return SendError( playerid, "This turf is currently being attacked." );
|
if ( g_gangzoneAttacker[ z ] != INVALID_GANG_ID ) return SendError( playerid, "This turf is currently being attacked." );
|
||||||
|
|
||||||
new opposing_count = GetPlayersInGangZone( z, g_gangTurfData[ z ] [ E_OWNER ] ); // Opposing check
|
new opposing_count = GetPlayersInGangZone( z, g_gangTurfData[ z ] [ E_OWNER ] ); // Opposing check
|
||||||
|
|
||||||
// existing gang members
|
// existing gang members
|
||||||
if ( g_gangTurfData[ z ] [ E_OWNER ] != INVALID_GANG_ID && opposing_count ) {
|
if ( g_gangTurfData[ z ] [ E_OWNER ] != INVALID_GANG_ID && opposing_count ) {
|
||||||
return SendError( playerid, "There are gang members within this turf, kill them!" );
|
return SendError( playerid, "There are gang members within this turf, kill them!" );
|
||||||
@ -581,8 +414,18 @@ CMD:takeover( playerid, params[ ] )
|
|||||||
g_gangzoneAttackCount[ z ] = 0;
|
g_gangzoneAttackCount[ z ] = 0;
|
||||||
GangZoneFlashForAll( g_gangTurfData[ z ] [ E_ID ], setAlpha( g_gangData[ gangid ] [ E_COLOR ], 0x80 ) );
|
GangZoneFlashForAll( g_gangTurfData[ z ] [ E_ID ], setAlpha( g_gangData[ gangid ] [ E_COLOR ], 0x80 ) );
|
||||||
SendClientMessage( playerid, g_gangData[ gangid ] [ E_COLOR ], "[TURF]{FFFFFF} You are now beginning to take over the turf. Stay inside the area with your gang for 60 seconds. Don't die." );
|
SendClientMessage( playerid, g_gangData[ gangid ] [ E_COLOR ], "[TURF]{FFFFFF} You are now beginning to take over the turf. Stay inside the area with your gang for 60 seconds. Don't die." );
|
||||||
if ( g_gangTurfData[ z ] [ E_OWNER ] != INVALID_GANG_ID ) {
|
|
||||||
SendClientMessageToGang( g_gangTurfData[ z ] [ E_OWNER ], g_gangData[ g_gangTurfData[ z ] [ E_OWNER ] ] [ E_COLOR ], "[GANG]{FFFFFF} Our territory is being attacked by "COL_GREY"%s"COL_WHITE", defend it!", g_gangData[ g_gangzoneAttacker[ z ] ] [ E_NAME ] );
|
if ( g_gangTurfData[ z ] [ E_OWNER ] != INVALID_GANG_ID )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
szLocation[ MAX_ZONE_NAME ], Float: min_x, Float: min_y;
|
||||||
|
|
||||||
|
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ z ] [ E_AREA ], E_STREAMER_MIN_X, min_x );
|
||||||
|
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ z ] [ E_AREA ], E_STREAMER_MIN_Y, min_y );
|
||||||
|
|
||||||
|
GetZoneFromCoordinates( szLocation, min_x, min_y );
|
||||||
|
|
||||||
|
SendClientMessageToGang( g_gangTurfData[ z ] [ E_OWNER ], g_gangData[ g_gangTurfData[ z ] [ E_OWNER ] ] [ E_COLOR ], "[GANG]"COL_WHITE" Our territory is being attacked by "COL_GREY"%s"COL_WHITE" in %s, defend it!", g_gangData[ g_gangzoneAttacker[ z ] ] [ E_NAME ], szLocation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -594,3 +437,207 @@ CMD:takeover( playerid, params[ ] )
|
|||||||
}
|
}
|
||||||
return SendError( playerid, "You are not in any gangzone." );
|
return SendError( playerid, "You are not in any gangzone." );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ** Functions ** */
|
||||||
|
stock Turf_Create( Float: min_x, Float: min_y, Float: max_x, Float: max_y, owner_id = INVALID_GANG_ID, color = COLOR_GANGZONE, facility_gang_id = INVALID_GANG_ID )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
id = Iter_Free( turfs );
|
||||||
|
|
||||||
|
if ( id != ITER_NONE )
|
||||||
|
{
|
||||||
|
// set turf owners
|
||||||
|
g_gangTurfData[ id ] [ E_OWNER ] = owner_id;
|
||||||
|
g_gangTurfData[ id ] [ E_COLOR ] = color;
|
||||||
|
g_gangTurfData[ id ] [ E_FACILITY_GANG ] = facility_gang_id;
|
||||||
|
|
||||||
|
// create area
|
||||||
|
g_gangTurfData[ id ] [ E_ID ] = GangZoneCreate( min_x, min_y, max_x, max_y );
|
||||||
|
g_gangTurfData[ id ] [ E_AREA ] = CreateDynamicRectangle( min_x, min_y, max_x, max_y, 0, 0 );
|
||||||
|
|
||||||
|
// add to iterator
|
||||||
|
Iter_Add( turfs, id );
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
stock Turf_GetOwner( id ) {
|
||||||
|
return g_gangTurfData[ id ] [ E_OWNER ];
|
||||||
|
}
|
||||||
|
|
||||||
|
stock Turf_GetFacility( id ) {
|
||||||
|
return g_gangTurfData[ id ] [ E_FACILITY_GANG ];
|
||||||
|
}
|
||||||
|
|
||||||
|
stock Turf_GetFirstTurf( playerid )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
current_areas[ 4 ];
|
||||||
|
|
||||||
|
GetPlayerDynamicAreas( playerid, current_areas );
|
||||||
|
|
||||||
|
foreach( new i : Reverse(turfs) )
|
||||||
|
{
|
||||||
|
if ( current_areas[ 0 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 1 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 2 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 3 ] == g_gangTurfData[ i ] [ E_AREA ] )
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
stock Turf_GetProfitability( zoneid, gang_members, Float: default_pay = 4000.0 )
|
||||||
|
{
|
||||||
|
// size adjustments
|
||||||
|
//if ( g_gangzoneData[ zoneid ] [ E_SIZE ] < TURF_SIZE_SMALL ) // lower than 1st quartile, decrease pay
|
||||||
|
// default_pay *= 0.75;
|
||||||
|
|
||||||
|
// Normal Gang Zones
|
||||||
|
if ( zoneid < sizeof( g_gangzoneData ) )
|
||||||
|
{
|
||||||
|
if ( g_gangzoneData[ zoneid ] [ E_SIZE ] > TURF_SIZE_LARGE ) // higher than 1st quartile, increase pay
|
||||||
|
default_pay *= 1.25;
|
||||||
|
|
||||||
|
// city adjustments
|
||||||
|
if ( g_gangzoneData[ zoneid ] [ E_CITY ] == CITY_SF )
|
||||||
|
default_pay *= 1.25;
|
||||||
|
|
||||||
|
if ( g_gangzoneData[ zoneid ] [ E_CITY ] == CITY_COUNTRY || g_gangzoneData[ zoneid ] [ E_CITY ] == CITY_DESERTS )
|
||||||
|
default_pay *= 1.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// facility 2x
|
||||||
|
if ( g_gangTurfData[ zoneid ] [ E_FACILITY_GANG ] != INVALID_GANG_ID )
|
||||||
|
default_pay *= 2;
|
||||||
|
|
||||||
|
// get online players
|
||||||
|
new Float: player_boost = 0.0;
|
||||||
|
|
||||||
|
if ( gang_members >= 10 ) player_boost = 1.5;
|
||||||
|
else if ( gang_members > 1 ) player_boost = 1.0 + float( gang_members - 1 ) * 0.05;
|
||||||
|
|
||||||
|
// max boost
|
||||||
|
default_pay *= player_boost > 1.5 ? 1.5 : player_boost;
|
||||||
|
|
||||||
|
// return rounded number
|
||||||
|
return floatround( default_pay );
|
||||||
|
}
|
||||||
|
|
||||||
|
stock Turf_ResetGangTurfs( gangid )
|
||||||
|
{
|
||||||
|
foreach ( new z : turfs )
|
||||||
|
{
|
||||||
|
if ( g_gangTurfData[ z ] [ E_OWNER ] == gangid )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
facility_gang = g_gangTurfData[ z ] [ E_FACILITY_GANG ];
|
||||||
|
|
||||||
|
if ( g_gangTurfData[ z ] [ E_FACILITY_GANG ] != INVALID_GANG_ID && Iter_Contains( gangs, g_gangTurfData[ z ] [ E_FACILITY_GANG ] ) )
|
||||||
|
{
|
||||||
|
g_gangTurfData[ z ] [ E_COLOR ] = setAlpha( g_gangData[ facility_gang ] [ E_COLOR ], 0x80 );
|
||||||
|
g_gangTurfData[ z ] [ E_OWNER ] = facility_gang;
|
||||||
|
GangZoneShowForAll( g_gangTurfData[ z ] [ E_ID ], g_gangTurfData[ z ] [ E_COLOR ] );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_gangTurfData[ z ] [ E_COLOR ] = COLOR_GANGZONE;
|
||||||
|
g_gangTurfData[ z ] [ E_OWNER ] = INVALID_GANG_ID;
|
||||||
|
GangZoneShowForAll( g_gangTurfData[ z ] [ E_ID ], COLOR_GANGZONE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stock Turf_ShowGangOwners( playerid )
|
||||||
|
{
|
||||||
|
if ( ! Iter_Count( turfs ) )
|
||||||
|
return SendError( playerid, "There is currently no trufs on the server." );
|
||||||
|
|
||||||
|
szHugeString[ 0 ] = '\0';
|
||||||
|
|
||||||
|
foreach( new turfid : turfs )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
szLocation[ MAX_ZONE_NAME ], Float: min_x, Float: min_y;
|
||||||
|
|
||||||
|
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ turfid ] [ E_AREA ], E_STREAMER_MIN_X, min_x );
|
||||||
|
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ turfid ] [ E_AREA ], E_STREAMER_MIN_Y, min_y );
|
||||||
|
|
||||||
|
GetZoneFromCoordinates( szLocation, min_x, min_y );
|
||||||
|
|
||||||
|
if ( g_gangTurfData[ turfid ][ E_OWNER ] == INVALID_GANG_ID ) {
|
||||||
|
format( szHugeString, sizeof( szHugeString ), "%s%s\t"COL_GREY"Unoccupied\n", szHugeString, szLocation );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
format( szHugeString, sizeof( szHugeString ), "%s%s\t{%06x}%s\n", szHugeString, szLocation, g_gangTurfData[ turfid ][ E_COLOR ] >>> 8 , ReturnGangName( g_gangTurfData[ turfid ][ E_OWNER ] ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Gang Turfs", szHugeString, "Close", "" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stock Turf_RedrawPlayerGangZones( playerid, gangid )
|
||||||
|
{
|
||||||
|
foreach ( new x : turfs )
|
||||||
|
{
|
||||||
|
// set the new color to the turfs
|
||||||
|
if ( g_gangTurfData[ x ] [ E_OWNER ] == gangid ) {
|
||||||
|
g_gangTurfData[ x ] [ E_COLOR ] = setAlpha( g_gangData[ gangid ] [ E_COLOR ], 0x80 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// resume flashing if gang war
|
||||||
|
if ( g_gangzoneAttacker[ x ] == gangid ) {
|
||||||
|
GangZoneStopFlashForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ] );
|
||||||
|
GangZoneFlashForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ], setAlpha( g_gangData[ gangid ] [ E_COLOR ], 0x80 ) );
|
||||||
|
} else {
|
||||||
|
GangZoneHideForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ] );
|
||||||
|
GangZoneShowForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ], g_gangTurfData[ x ] [ E_COLOR ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
stock Turf_GetCentrePos( zoneid, &Float: X, &Float: Y ) // should return the centre but will do for now
|
||||||
|
{
|
||||||
|
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MIN_X, X );
|
||||||
|
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MIN_Y, Y );
|
||||||
|
}
|
||||||
|
|
||||||
|
stock GetGangCapturedTurfs( gangid )
|
||||||
|
{
|
||||||
|
new
|
||||||
|
z,
|
||||||
|
c;
|
||||||
|
|
||||||
|
foreach ( z : turfs ) if ( g_gangTurfData[ z ] [ E_OWNER ] != INVALID_GANG_ID && g_gangTurfData[ z ] [ E_OWNER ] == gangid ) {
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
stock GetPlayersInGangZone( z, g, &is_afk = 0, &in_air = 0 )
|
||||||
|
{
|
||||||
|
if ( g == INVALID_GANG_ID )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
new count = 0;
|
||||||
|
new Float: Z;
|
||||||
|
|
||||||
|
foreach ( new i : Player ) if ( p_Class[ i ] == CLASS_CIVILIAN && p_GangID[ i ] == g && IsPlayerInDynamicArea( i, g_gangTurfData[ z ] [ E_AREA ] ) )
|
||||||
|
{
|
||||||
|
if ( ! IsPlayerSpawnProtected( i ) && GetPlayerState( i ) != PLAYER_STATE_SPECTATING )
|
||||||
|
{
|
||||||
|
if ( IsPlayerAFK( i ) )
|
||||||
|
{
|
||||||
|
is_afk++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( GetPlayerPos( i, Z, Z, Z ) && Z >= 300.0 )
|
||||||
|
{
|
||||||
|
in_air++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
@ -1,648 +0,0 @@
|
|||||||
/*
|
|
||||||
* Irresistible Gaming (c) 2018
|
|
||||||
* Developed by Lorenc
|
|
||||||
* Module: cnr\features\gangs\turfs.pwn
|
|
||||||
* Purpose: turfing module for gangs
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* ** Includes ** */
|
|
||||||
#include < YSI\y_hooks >
|
|
||||||
|
|
||||||
/* ** Gang Zone Numbers ** */
|
|
||||||
#define GANGZONE_DEFAULT_BORDER_SIZE 2.0 // default thickness of borders
|
|
||||||
#define GANGZONE_DEFAULT_NUMBER_SIZE 0.6 // default thickness of numbers
|
|
||||||
#include < gangzones >
|
|
||||||
|
|
||||||
/* ** Definitions ** */
|
|
||||||
#if defined MAX_FACILITIES
|
|
||||||
#define MAX_TURFS ( sizeof( g_gangzoneData ) + MAX_FACILITIES )
|
|
||||||
#else
|
|
||||||
#define MAX_TURFS ( sizeof( g_gangzoneData ) )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define INVALID_GANG_TURF ( -1 )
|
|
||||||
|
|
||||||
#define TAKEOVER_NEEDED_PEOPLE ( 1 )
|
|
||||||
|
|
||||||
#define COLOR_GANGZONE 0x00000080
|
|
||||||
#define COLOR_HARDPOINT 0xFF000080
|
|
||||||
|
|
||||||
/* ** Macros ** */
|
|
||||||
#define ShowHardpointIconForPlayer(%0) \
|
|
||||||
Streamer_AppendArrayData( STREAMER_TYPE_MAP_ICON, g_gangHardpointMapIcon, E_STREAMER_PLAYER_ID, %0 )
|
|
||||||
|
|
||||||
#define HideHardpointIconForPlayer(%0) \
|
|
||||||
Streamer_RemoveArrayData( STREAMER_TYPE_MAP_ICON, g_gangHardpointMapIcon, E_STREAMER_PLAYER_ID, %0 )
|
|
||||||
|
|
||||||
/* ** Variables ** */
|
|
||||||
enum e_GANG_ZONE_DATA
|
|
||||||
{
|
|
||||||
Float: E_MIN_X,
|
|
||||||
Float: E_MIN_Y,
|
|
||||||
Float: E_MAX_X,
|
|
||||||
Float: E_MAX_Y,
|
|
||||||
E_CITY
|
|
||||||
};
|
|
||||||
|
|
||||||
static const
|
|
||||||
g_gangzoneData[ ] [ e_GANG_ZONE_DATA ] =
|
|
||||||
{
|
|
||||||
{ -2076.0, 1036.5, -1873.0, 1088.5, CITY_SF },
|
|
||||||
{ -2014.0, 937.5, -1873.0, 1036.5, CITY_SF },
|
|
||||||
{ -2014.0, 829.5, -1886.0, 937.5, CITY_SF },
|
|
||||||
{ -1873.0, 937.5, -1787.0, 1112.5, CITY_SF },
|
|
||||||
{ -2014.0, 719.5, -1886.0, 829.5, CITY_SF },
|
|
||||||
{ -1886.0, 829.5, -1788.0, 937.5, CITY_SF },
|
|
||||||
{ -1886.0, 719.5, -1788.0, 829.5, CITY_SF },
|
|
||||||
{ -1788.0, 829.5, -1723.0, 937.5, CITY_SF },
|
|
||||||
{ -1723.0, 829.5, -1642.0, 937.5, CITY_SF },
|
|
||||||
{ -1642.0, 829.5, -1564.0, 937.5, CITY_SF },
|
|
||||||
{ -1564.0, 828.5, -1421.0, 1015.5, CITY_SF },
|
|
||||||
{ -1667.0, 720.5, -1563.0, 829.5, CITY_SF },
|
|
||||||
{ -1788.0, 719.5, -1667.0, 829.5, CITY_SF },
|
|
||||||
{ -1787.0, 935.5, -1704.0, 1037.5, CITY_SF },
|
|
||||||
{ -1787.0, 1037.5, -1704.0, 1112.5, CITY_SF },
|
|
||||||
{ -2130.0, 816.5, -2014.0, 1036.5, CITY_SF }
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
/* ** Variables ** */
|
|
||||||
enum E_TURF_ZONE_DATA {
|
|
||||||
E_ID,
|
|
||||||
|
|
||||||
E_OWNER,
|
|
||||||
E_COLOR,
|
|
||||||
|
|
||||||
E_AREA,
|
|
||||||
E_FACILITY_GANG
|
|
||||||
};
|
|
||||||
|
|
||||||
new
|
|
||||||
g_gangTurfData [ MAX_TURFS ] [ E_TURF_ZONE_DATA ],
|
|
||||||
Iterator: turfs < MAX_TURFS >,
|
|
||||||
Iterator: gangzoneturfs < MAX_TURFS >,
|
|
||||||
|
|
||||||
Float: g_weekAveragePlayers = 0.0,
|
|
||||||
Float: g_weekSecondsElapsed = 0.0,
|
|
||||||
|
|
||||||
g_gangHardpointRotation = -1,
|
|
||||||
g_gangHardpointTurf = INVALID_GANG_TURF,
|
|
||||||
g_gangHardpointPreviousTurf = INVALID_GANG_TURF,
|
|
||||||
g_gangHardpointAttacker = INVALID_GANG_ID,
|
|
||||||
g_gangHardpointMapIcon = -1,
|
|
||||||
|
|
||||||
g_gangHardpointCaptureTime [ MAX_GANGS ]
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
/* ** Forwards ** */
|
|
||||||
forward OnPlayerUpdateGangZone( playerid, zoneid );
|
|
||||||
|
|
||||||
stock Float: Turf_GetHardpointPrizePool( Float: max_payout = 500000.0 )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
Float: total_payout = ( g_weekAveragePlayers / g_weekSecondsElapsed ) * 7500.0;
|
|
||||||
|
|
||||||
return total_payout < max_payout ? total_payout : max_payout;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ** Hooks ** */
|
|
||||||
hook OnGameModeInit( )
|
|
||||||
{
|
|
||||||
// Gangzone Allocation
|
|
||||||
for ( new i = 0; i < sizeof( g_gangzoneData ); i ++ ) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnServerTickSecond( )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
hardpoint_turf = g_gangHardpointTurf;
|
|
||||||
|
|
||||||
if ( hardpoint_turf == INVALID_GANG_TURF ) {
|
|
||||||
return Turf_CreateHardpoint( );
|
|
||||||
}
|
|
||||||
|
|
||||||
// accumulate average player count
|
|
||||||
g_weekAveragePlayers += float( Iter_Count( Player ) );
|
|
||||||
g_weekSecondsElapsed ++;
|
|
||||||
|
|
||||||
// begin auto turf takeover etc
|
|
||||||
if ( g_gangHardpointAttacker != INVALID_GANG_ID )
|
|
||||||
{
|
|
||||||
new total_in_turf = Turf_GetPlayersInTurf( hardpoint_turf );
|
|
||||||
new attacking_members = GetPlayersInGangZone( hardpoint_turf, g_gangHardpointAttacker );
|
|
||||||
|
|
||||||
// no attacking members inside the turf
|
|
||||||
if ( ! attacking_members )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
new_attacker = INVALID_GANG_ID;
|
|
||||||
|
|
||||||
foreach ( new playerid : Player ) if ( GetPlayerGang( playerid ) != INVALID_GANG_ID && IsPlayerInDynamicArea( playerid, g_gangTurfData[ hardpoint_turf ] [ E_AREA ] ) && Turf_IsAbleToTakeover( playerid ) ) {
|
|
||||||
new_attacker = GetPlayerGang( playerid );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( new_attacker != INVALID_GANG_ID ) {
|
|
||||||
SendClientMessageToGang( g_gangHardpointAttacker, g_gangData[ g_gangHardpointAttacker ] [ E_COLOR ], "[TURF] "COL_WHITE"The territory hardpoint is now being contested by %s!", ReturnGangName( new_attacker ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
Turf_SetHardpointAttacker( new_attacker );
|
|
||||||
}
|
|
||||||
|
|
||||||
new
|
|
||||||
current_attacker = g_gangHardpointAttacker;
|
|
||||||
|
|
||||||
// the attacker could be changed from above, so double checking
|
|
||||||
if ( current_attacker != INVALID_GANG_ID )
|
|
||||||
{
|
|
||||||
// add seconds
|
|
||||||
g_gangHardpointCaptureTime[ current_attacker ] ++;
|
|
||||||
|
|
||||||
// get capture time
|
|
||||||
new total_capture_seconds = Turf_GetTotalCaptureSeconds( );
|
|
||||||
|
|
||||||
// alert gang members
|
|
||||||
foreach ( new playerid : Player ) if ( GetPlayerGang( playerid ) != INVALID_GANG_ID && IsPlayerInDynamicArea( playerid, g_gangTurfData[ hardpoint_turf ] [ E_AREA ] ) && Turf_IsAbleToTakeover( playerid ) )
|
|
||||||
{
|
|
||||||
new player_gang = GetPlayerGang( playerid );
|
|
||||||
|
|
||||||
// calculate player earnings
|
|
||||||
new potential_earnings = total_capture_seconds > 0 ? floatround( float( g_gangHardpointCaptureTime[ player_gang ] ) / float( total_capture_seconds ) * Turf_GetHardpointPrizePool( ) ) : 0;
|
|
||||||
|
|
||||||
// message the attacker that they gotta attack
|
|
||||||
if ( player_gang == current_attacker )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
rivals_members = total_in_turf - attacking_members;
|
|
||||||
|
|
||||||
if ( rivals_members ) {
|
|
||||||
ShowPlayerHelpDialog( playerid, 2500, "~b~Defend~w~ from %d enemy gang member%s!~n~~n~Earning potential is ~g~%s", rivals_members, rivals_members == 1 ? ( "" ) : ( "s" ), cash_format( potential_earnings ) );
|
|
||||||
} else {
|
|
||||||
ShowPlayerHelpDialog( playerid, 2500, "~g~%s~w~ is in control for %s!~n~~n~Earning potential is ~g~%s", ReturnGangName( current_attacker ), TimeConvert( g_gangHardpointCaptureTime[ current_attacker ] ), cash_format( potential_earnings ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// message the defender
|
|
||||||
else if ( player_gang != current_attacker ) {
|
|
||||||
ShowPlayerHelpDialog( playerid, 2500, "~r~Kill~w~ %d %s member%s!~n~~n~Earning potential is ~r~%s", attacking_members, ReturnGangName( current_attacker ), attacking_members == 1 ? ( "" ) : ( "s" ), cash_format( potential_earnings ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
new
|
|
||||||
new_attacker = INVALID_GANG_ID;
|
|
||||||
|
|
||||||
foreach ( new playerid : Player ) if ( GetPlayerGang( playerid ) != INVALID_GANG_ID && IsPlayerInDynamicArea( playerid, g_gangTurfData[ hardpoint_turf ] [ E_AREA ] ) && Turf_IsAbleToTakeover( playerid ) ) {
|
|
||||||
new_attacker = GetPlayerGang( playerid );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Turf_SetHardpointAttacker( new_attacker );
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetPlayersInTurf( turfid )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
players_accum = 0;
|
|
||||||
|
|
||||||
foreach ( new g : gangs ) {
|
|
||||||
players_accum += GetPlayersInGangZone( turfid, g );
|
|
||||||
}
|
|
||||||
return players_accum;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_CreateHardpoint( )
|
|
||||||
{
|
|
||||||
// reset gang accumulated time
|
|
||||||
for ( new i = 0; i < sizeof ( g_gangHardpointCaptureTime ); i ++ ) {
|
|
||||||
g_gangHardpointCaptureTime[ i ] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// fixed zone rotation
|
|
||||||
new current_rotation = g_gangHardpointRotation;
|
|
||||||
|
|
||||||
// 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
|
|
||||||
g_gangHardpointTurf = g_gangHardpointRotation;
|
|
||||||
g_gangHardpointAttacker = INVALID_GANG_ID;
|
|
||||||
DestroyDynamicMapIcon( g_gangHardpointMapIcon );
|
|
||||||
|
|
||||||
// update hardpoint textdraw
|
|
||||||
foreach ( new playerid : Player )
|
|
||||||
{
|
|
||||||
if ( g_gangHardpointPreviousTurf != INVALID_GANG_TURF && IsPlayerInDynamicArea( playerid, g_gangTurfData[ g_gangHardpointPreviousTurf ] [ E_AREA ] ) ) {
|
|
||||||
CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, g_gangHardpointPreviousTurf );
|
|
||||||
}
|
|
||||||
else if ( g_gangHardpointTurf != INVALID_GANG_TURF && IsPlayerInDynamicArea( playerid, g_gangTurfData[ g_gangHardpointTurf ] [ E_AREA ] ) ) {
|
|
||||||
CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, g_gangHardpointTurf );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// create map icon
|
|
||||||
new
|
|
||||||
Float: middle_x, Float: middle_y;
|
|
||||||
|
|
||||||
Turf_GetMiddlePos( g_gangHardpointTurf, middle_x, middle_y );
|
|
||||||
|
|
||||||
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 );
|
|
||||||
|
|
||||||
// redraw gangzones
|
|
||||||
Turf_RedrawGangZonesForAll( );
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnGangUnload( gangid, bool: deleted )
|
|
||||||
{
|
|
||||||
g_gangHardpointCaptureTime[ gangid ] = 0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerLeaveGang( playerid, gangid, reason )
|
|
||||||
{
|
|
||||||
HideHardpointIconForPlayer( playerid );
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerJoinGang( playerid, gangid )
|
|
||||||
{
|
|
||||||
ShowHardpointIconForPlayer( playerid );
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnServerGameDayEnd( )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
total_capture_seconds = Turf_GetTotalCaptureSeconds( );
|
|
||||||
|
|
||||||
// payout gangs if there is any capable
|
|
||||||
if ( total_capture_seconds )
|
|
||||||
{
|
|
||||||
// payout gangs
|
|
||||||
foreach ( new g : gangs )
|
|
||||||
{
|
|
||||||
new Float: capture_ratio = float( g_gangHardpointCaptureTime[ g ] ) / float( total_capture_seconds );
|
|
||||||
new earnings = floatround( capture_ratio * Turf_GetHardpointPrizePool( ) );
|
|
||||||
|
|
||||||
if ( earnings > 0 )
|
|
||||||
{
|
|
||||||
g_gangData[ g ] [ E_RESPECT ] += floatround( capture_ratio * 100.0 ); // give the gang a % of respect out of how much they captured
|
|
||||||
|
|
||||||
GiveGangCash( g, earnings );
|
|
||||||
SaveGangData( g );
|
|
||||||
|
|
||||||
foreach ( new p : Player ) if ( GetPlayerGang( p ) == g ) {
|
|
||||||
PlayerPlaySound( p, 36205, 0.0, 0.0, 0.0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
SendClientMessageToGang( g, g_gangData[ g ] [ E_COLOR ], "[GANG] "COL_GOLD"%s"COL_WHITE" has been earned from territories and deposited in the gang bank account.", cash_format( earnings ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// get previous turf
|
|
||||||
new previous_turf = Iter_Prev( gangzoneturfs, g_gangHardpointTurf );
|
|
||||||
|
|
||||||
if ( previous_turf >= Iter_Last( gangzoneturfs ) ) {
|
|
||||||
previous_turf = INVALID_GANG_TURF;
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset hardpoint
|
|
||||||
g_gangHardpointPreviousTurf = previous_turf;
|
|
||||||
g_gangHardpointTurf = INVALID_GANG_TURF;
|
|
||||||
g_weekAveragePlayers = 0.0;
|
|
||||||
g_weekSecondsElapsed = 0.0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerSpawn( playerid )
|
|
||||||
{
|
|
||||||
Turf_RedrawPlayerGangZones( playerid );
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerEnterDynArea( playerid, areaid )
|
|
||||||
{
|
|
||||||
if ( ! IsPlayerNPC( playerid ) )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
first_turf = Turf_GetFirstTurf( playerid );
|
|
||||||
|
|
||||||
// update textdraws
|
|
||||||
CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, first_turf );
|
|
||||||
}
|
|
||||||
return Y_HOOKS_CONTINUE_RETURN_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_SetHardpointAttacker( gangid )
|
|
||||||
{
|
|
||||||
if ( g_gangHardpointAttacker == INVALID_GANG_ID && gangid == INVALID_GANG_ID )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// set current attacker
|
|
||||||
g_gangHardpointAttacker = gangid;
|
|
||||||
|
|
||||||
// alert gang
|
|
||||||
if ( gangid != INVALID_GANG_ID ) {
|
|
||||||
SendClientMessageToGang( gangid, g_gangData[ gangid ] [ E_COLOR ], "[TURF] "COL_WHITE"The gang is now contesting the territory hardpoint!" );
|
|
||||||
}
|
|
||||||
|
|
||||||
// update label
|
|
||||||
foreach ( new playerid : Player ) if ( g_gangHardpointTurf != INVALID_GANG_TURF && IsPlayerInDynamicArea( playerid, g_gangTurfData[ g_gangHardpointTurf ] [ E_AREA ] ) ) {
|
|
||||||
CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, g_gangHardpointTurf );
|
|
||||||
}
|
|
||||||
|
|
||||||
// redraw
|
|
||||||
Turf_RedrawGangZonesForAll( );
|
|
||||||
}
|
|
||||||
|
|
||||||
hook OnPlayerLeaveDynArea( playerid, areaid )
|
|
||||||
{
|
|
||||||
if ( ! IsPlayerNPC( playerid ) )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
total_areas = GetPlayerNumberDynamicAreas( playerid );
|
|
||||||
|
|
||||||
// reduced to another area
|
|
||||||
if ( total_areas )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
first_turf = Turf_GetFirstTurf( playerid );
|
|
||||||
|
|
||||||
CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, first_turf );
|
|
||||||
}
|
|
||||||
|
|
||||||
// if the player is in no areas, then they left
|
|
||||||
else CallLocalFunction( "OnPlayerUpdateGangZone", "dd", playerid, INVALID_GANG_TURF );
|
|
||||||
}
|
|
||||||
return Y_HOOKS_CONTINUE_RETURN_1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OnPlayerUpdateGangZone( playerid, zoneid )
|
|
||||||
{
|
|
||||||
if ( ! IsPlayerMovieMode( playerid ) )
|
|
||||||
{
|
|
||||||
if ( zoneid == INVALID_GANG_TURF )
|
|
||||||
return PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "_" );
|
|
||||||
|
|
||||||
if ( g_gangTurfData[ zoneid ] [ E_FACILITY_GANG ] != INVALID_GANG_ID ) {
|
|
||||||
PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~p~(FACILITY)~n~~w~~h~%s", ReturnGangName( g_gangTurfData[ zoneid ] [ E_OWNER ] ) ) );
|
|
||||||
} else {
|
|
||||||
if ( g_gangTurfData[ g_gangHardpointTurf ] [ E_ID ] != g_gangTurfData[ zoneid ] [ E_ID ] ) {
|
|
||||||
PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "~b~~h~(INACTIVE HARDPOINT)~n~~w~~h~Unchallenged" );
|
|
||||||
} else {
|
|
||||||
DisablePlayerSpawnProtection( playerid );
|
|
||||||
PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~r~~h~(ACTIVE HARDPOINT)~n~~w~~h~%s", g_gangHardpointAttacker != INVALID_GANG_ID ? ( ReturnGangName( g_gangHardpointAttacker ) ) : ( "Unchallenged" ) ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ** Functions ** */
|
|
||||||
stock Turf_Create( Float: min_x, Float: min_y, Float: max_x, Float: max_y, owner_id = INVALID_GANG_ID, color = COLOR_GANGZONE, facility_gang_id = INVALID_GANG_ID, Float: bordersize = GANGZONE_DEFAULT_BORDER_SIZE, Float: numbersize = 0.0 )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
id = Iter_Free( turfs );
|
|
||||||
|
|
||||||
if ( id != ITER_NONE )
|
|
||||||
{
|
|
||||||
// set turf owners
|
|
||||||
g_gangTurfData[ id ] [ E_OWNER ] = owner_id;
|
|
||||||
g_gangTurfData[ id ] [ E_COLOR ] = color;
|
|
||||||
g_gangTurfData[ id ] [ E_FACILITY_GANG ] = facility_gang_id;
|
|
||||||
|
|
||||||
// create area
|
|
||||||
g_gangTurfData[ id ] [ E_ID ] = GangZoneCreate( min_x, min_y, max_x, max_y, .bordersize = bordersize, .numbersize = numbersize );
|
|
||||||
g_gangTurfData[ id ] [ E_AREA ] = CreateDynamicRectangle( min_x, min_y, max_x, max_y, 0, 0 );
|
|
||||||
|
|
||||||
// add to iterator
|
|
||||||
Iter_Add( turfs, id );
|
|
||||||
}
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetOwner( id ) {
|
|
||||||
return g_gangTurfData[ id ] [ E_OWNER ];
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetFacility( id ) {
|
|
||||||
return g_gangTurfData[ id ] [ E_FACILITY_GANG ];
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetFirstTurf( playerid )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
current_areas[ 4 ];
|
|
||||||
|
|
||||||
GetPlayerDynamicAreas( playerid, current_areas );
|
|
||||||
|
|
||||||
foreach( new i : Reverse(turfs) )
|
|
||||||
{
|
|
||||||
if ( current_areas[ 0 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 1 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 2 ] == g_gangTurfData[ i ] [ E_AREA ] || current_areas[ 3 ] == g_gangTurfData[ i ] [ E_AREA ] )
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_ResetGangTurfs( gangid )
|
|
||||||
{
|
|
||||||
foreach ( new z : turfs )
|
|
||||||
{
|
|
||||||
if ( g_gangTurfData[ z ] [ E_OWNER ] == gangid )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
facility_gang = g_gangTurfData[ z ] [ E_FACILITY_GANG ];
|
|
||||||
|
|
||||||
if ( g_gangTurfData[ z ] [ E_FACILITY_GANG ] != INVALID_GANG_ID && Iter_Contains( gangs, g_gangTurfData[ z ] [ E_FACILITY_GANG ] ) )
|
|
||||||
{
|
|
||||||
g_gangTurfData[ z ] [ E_COLOR ] = setAlpha( g_gangData[ facility_gang ] [ E_COLOR ], 0x80 );
|
|
||||||
g_gangTurfData[ z ] [ E_OWNER ] = facility_gang;
|
|
||||||
GangZoneShowForAll( g_gangTurfData[ z ] [ E_ID ], g_gangTurfData[ z ] [ E_COLOR ] );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_gangTurfData[ z ] [ E_COLOR ] = COLOR_GANGZONE;
|
|
||||||
g_gangTurfData[ z ] [ E_OWNER ] = INVALID_GANG_ID;
|
|
||||||
GangZoneShowForAll( g_gangTurfData[ z ] [ E_ID ], COLOR_GANGZONE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_ShowGangOwners( playerid )
|
|
||||||
{
|
|
||||||
if ( ! Iter_Count( turfs ) )
|
|
||||||
return SendError( playerid, "There is currently no trufs on the server." );
|
|
||||||
|
|
||||||
szHugeString[ 0 ] = '\0';
|
|
||||||
|
|
||||||
foreach( new turfid : turfs )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
szLocation[ MAX_ZONE_NAME ], Float: min_x, Float: min_y;
|
|
||||||
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ turfid ] [ E_AREA ], E_STREAMER_MIN_X, min_x );
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ turfid ] [ E_AREA ], E_STREAMER_MIN_Y, min_y );
|
|
||||||
|
|
||||||
GetZoneFromCoordinates( szLocation, min_x, min_y );
|
|
||||||
|
|
||||||
if ( g_gangTurfData[ turfid ][ E_OWNER ] == INVALID_GANG_ID ) {
|
|
||||||
format( szHugeString, sizeof( szHugeString ), "%s%s\t"COL_GREY"Unoccupied\n", szHugeString, szLocation );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
format( szHugeString, sizeof( szHugeString ), "%s%s\t{%06x}%s\n", szHugeString, szLocation, g_gangTurfData[ turfid ][ E_COLOR ] >>> 8 , ReturnGangName( g_gangTurfData[ turfid ][ E_OWNER ] ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_WHITE"Gang Turfs", szHugeString, "Close", "" );
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetCentrePos( zoneid, &Float: X, &Float: Y ) // should return the centre but will do for now
|
|
||||||
{
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MIN_X, X );
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MIN_Y, Y );
|
|
||||||
}
|
|
||||||
|
|
||||||
stock GetPlayersInGangZone( z, g )
|
|
||||||
{
|
|
||||||
if ( g == INVALID_GANG_ID )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
new
|
|
||||||
count = 0;
|
|
||||||
|
|
||||||
foreach ( new i : Player ) if ( p_GangID[ i ] == g && IsPlayerInDynamicArea( i, g_gangTurfData[ z ] [ E_AREA ] ) && Turf_IsAbleToTakeover( i ) ) {
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_IsAbleToTakeover( i ) {
|
|
||||||
new
|
|
||||||
Float: Z;
|
|
||||||
|
|
||||||
GetPlayerPos( i, Z, Z, Z );
|
|
||||||
return p_Class[ i ] == CLASS_CIVILIAN && ! IsPlayerSpawnProtected( 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 )
|
|
||||||
{
|
|
||||||
foreach ( new x : turfs )
|
|
||||||
{
|
|
||||||
if ( g_gangHardpointTurf == g_gangTurfData[ x ] [ E_ID ] ) {
|
|
||||||
if ( g_gangHardpointAttacker != INVALID_GANG_ID ) {
|
|
||||||
GangZoneStopFlashForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ] );
|
|
||||||
GangZoneFlashForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ], setAlpha( g_gangData[ g_gangHardpointAttacker ] [ E_COLOR ], 0x80 ) );
|
|
||||||
} else {
|
|
||||||
GangZoneHideForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ] );
|
|
||||||
GangZoneShowForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ], g_gangHardpointTurf == g_gangTurfData[ x ] [ E_ID ] ? COLOR_HARDPOINT : g_gangTurfData[ x ] [ E_COLOR ] );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
GangZoneHideForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ] );
|
|
||||||
GangZoneShowForPlayer( playerid, g_gangTurfData[ x ] [ E_ID ], g_gangTurfData[ x ] [ E_COLOR ] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( GetPlayerClass( playerid ) == CLASS_CIVILIAN && GetPlayerGang( playerid ) != INVALID_GANG_ID ) {
|
|
||||||
ShowHardpointIconForPlayer( playerid );
|
|
||||||
} else {
|
|
||||||
HideHardpointIconForPlayer( playerid );
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_RedrawGangZonesForAll( )
|
|
||||||
{
|
|
||||||
foreach ( new x : turfs )
|
|
||||||
{
|
|
||||||
if ( g_gangHardpointTurf == g_gangTurfData[ x ] [ E_ID ] ) {
|
|
||||||
if ( g_gangHardpointAttacker != INVALID_GANG_ID ) {
|
|
||||||
GangZoneStopFlashForAll( g_gangTurfData[ x ] [ E_ID ] );
|
|
||||||
GangZoneFlashForAll( g_gangTurfData[ x ] [ E_ID ], setAlpha( g_gangData[ g_gangHardpointAttacker ] [ E_COLOR ], 0x80 ) );
|
|
||||||
} else {
|
|
||||||
GangZoneHideForAll( g_gangTurfData[ x ] [ E_ID ] );
|
|
||||||
GangZoneShowForAll( g_gangTurfData[ x ] [ E_ID ], g_gangHardpointTurf == g_gangTurfData[ x ] [ E_ID ] ? COLOR_HARDPOINT : g_gangTurfData[ x ] [ E_COLOR ] );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
GangZoneHideForAll( g_gangTurfData[ x ] [ E_ID ] );
|
|
||||||
GangZoneShowForAll( g_gangTurfData[ x ] [ E_ID ], g_gangTurfData[ x ] [ E_COLOR ] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ( new playerid : Player ) {
|
|
||||||
if ( GetPlayerClass( playerid ) == CLASS_CIVILIAN && GetPlayerGang( playerid ) != INVALID_GANG_ID ) {
|
|
||||||
ShowHardpointIconForPlayer( playerid );
|
|
||||||
} else {
|
|
||||||
HideHardpointIconForPlayer( playerid );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetTotalCaptureSeconds( ) {
|
|
||||||
|
|
||||||
new
|
|
||||||
accum_seconds = 0;
|
|
||||||
|
|
||||||
for ( new i = 0; i < sizeof ( g_gangHardpointCaptureTime ); i ++ ) {
|
|
||||||
accum_seconds += g_gangHardpointCaptureTime[ i ];
|
|
||||||
}
|
|
||||||
return accum_seconds;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock Turf_GetMiddlePos( zoneid, &Float: middle_x, &Float: middle_y )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
Float: min_x, Float: min_y, Float: max_x, Float: max_y;
|
|
||||||
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MIN_X, min_x );
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MIN_Y, min_y );
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MAX_X, max_x );
|
|
||||||
Streamer_GetFloatData( STREAMER_TYPE_AREA, g_gangTurfData[ zoneid ] [ E_AREA ], E_STREAMER_MAX_Y, max_y );
|
|
||||||
|
|
||||||
middle_x = ( min_x + max_x ) / 2.0;
|
|
||||||
middle_y = ( min_y + max_y ) / 2.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
stock GetGangCapturedTurfs( gangid )
|
|
||||||
{
|
|
||||||
new
|
|
||||||
z,
|
|
||||||
c;
|
|
||||||
|
|
||||||
foreach ( z : turfs ) if ( g_gangTurfData[ z ] [ E_OWNER ] != INVALID_GANG_ID && g_gangTurfData[ z ] [ E_OWNER ] == gangid ) {
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
return c;
|
|
||||||
}
|
|
@ -630,10 +630,10 @@ thread OnHouseLoad( )
|
|||||||
}
|
}
|
||||||
printf( "[HOUSES]: %d houses have been loaded. (Tick: %dms)", rows, GetTickCount( ) - loadingTick );
|
printf( "[HOUSES]: %d houses have been loaded. (Tick: %dms)", rows, GetTickCount( ) - loadingTick );
|
||||||
|
|
||||||
// Make Damen the owner of unowned VIP houses
|
// Make server operator the owner of unowned VIP houses
|
||||||
foreach ( new houseid : houses ) if ( g_houseData[ houseid ] [ E_COST ] < 10000 ) {
|
foreach ( new houseid : houses ) if ( g_houseData[ houseid ] [ E_COST ] < 10000 ) {
|
||||||
if ( strmatch( g_houseData[ houseid ] [ E_OWNER ], "No-one" ) ) {
|
if ( strmatch( g_houseData[ houseid ] [ E_OWNER ], "No-one" ) ) {
|
||||||
SetHouseOwner( houseid, 1, "Damen" );
|
SetHouseOwner( houseid, SERVER_OPERATOR_ACC_ID, SERVER_OPERATOR );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -63,6 +63,12 @@ hook OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: f
|
|||||||
|
|
||||||
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
||||||
{
|
{
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_PERKS ) ) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( dialogid == DIALOG_PERKS && response )
|
if ( dialogid == DIALOG_PERKS && response )
|
||||||
{
|
{
|
||||||
switch( listitem )
|
switch( listitem )
|
||||||
@ -194,8 +200,15 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
|||||||
/* ** Commands ** */
|
/* ** Commands ** */
|
||||||
CMD:perks( playerid, params[ ] )
|
CMD:perks( playerid, params[ ] )
|
||||||
{
|
{
|
||||||
if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) )
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_PERKS ) ) {
|
||||||
return SendError( playerid, "You cannot use this command since you're in an event." );
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if ( IsPlayerInEvent( playerid ) || IsPlayerInBattleRoyale( playerid ) ) {
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( IsPlayerInArmyVehicle( playerid ) )
|
if ( IsPlayerInArmyVehicle( playerid ) )
|
||||||
return SendError( playerid, "You cannot use this command while in an army vehicle." );
|
return SendError( playerid, "You cannot use this command while in an army vehicle." );
|
||||||
|
@ -353,7 +353,7 @@ thread OnAccountGuardDelete( playerid )
|
|||||||
;
|
;
|
||||||
|
|
||||||
if ( id != p_accountSecurityData[ playerid ] [ E_ID ] )
|
if ( id != p_accountSecurityData[ playerid ] [ E_ID ] )
|
||||||
return SendError( playerid, "Something is wrong with your email. Talk to Damen." ), 1;
|
return SendError( playerid, "Something is wrong with your email. Talk to " SERVER_OPERATOR "." ), 1;
|
||||||
|
|
||||||
if ( g_iTime - last_changed < 300 ) {
|
if ( g_iTime - last_changed < 300 ) {
|
||||||
return SendError( playerid, "You can use this feature in %s.", secondstotime( 300 - ( g_iTime - last_changed ) ) );
|
return SendError( playerid, "You can use this feature in %s.", secondstotime( 300 - ( g_iTime - last_changed ) ) );
|
||||||
|
@ -557,7 +557,7 @@ function OnPlayerHoldupStore( playerid, clerkid, step )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !( 0 <= amount < 10000 ) )
|
if ( !( 0 <= amount < 10000 ) )
|
||||||
return SendError( playerid, "A money exploit occurred. Contact Damen ASAP." );
|
return SendError( playerid, "A money exploit occurred. Contact " SERVER_OPERATOR " ASAP." );
|
||||||
|
|
||||||
GivePlayerCash( playerid, amount );
|
GivePlayerCash( playerid, amount );
|
||||||
GivePlayerExperience( playerid, E_ROBBERY, 0.2 ); // give 10% of what it normally does, since it does this for like 4-5 times
|
GivePlayerExperience( playerid, E_ROBBERY, 0.2 ); // give 10% of what it normally does, since it does this for like 4-5 times
|
||||||
|
@ -210,11 +210,11 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
|||||||
// Redirect player
|
// Redirect player
|
||||||
if ( selected_vip == VIP_DIAMOND )
|
if ( selected_vip == VIP_DIAMOND )
|
||||||
{
|
{
|
||||||
ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
||||||
}
|
}
|
||||||
else if ( selected_vip == VIP_PLATINUM )
|
else if ( selected_vip == VIP_PLATINUM )
|
||||||
{
|
{
|
||||||
ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -416,12 +416,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
|||||||
if ( sscanf( inputtext, "u", pID ) )
|
if ( sscanf( inputtext, "u", pID ) )
|
||||||
{
|
{
|
||||||
SendError( playerid, "Please enter a player's ID or name." );
|
SendError( playerid, "Please enter a player's ID or name." );
|
||||||
ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
||||||
}
|
}
|
||||||
else if ( !IsPlayerConnected( pID ) )
|
else if ( !IsPlayerConnected( pID ) )
|
||||||
{
|
{
|
||||||
SendError( playerid, "This player is not connected." );
|
SendError( playerid, "This player is not connected." );
|
||||||
ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
ShowPlayerDialog( playerid, DIALOG_DONATED_PLATBRONZE, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Platinum V.I.P, you have the option of gifting Bronze VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -447,12 +447,12 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
|||||||
if ( sscanf( inputtext, "u", pID ) )
|
if ( sscanf( inputtext, "u", pID ) )
|
||||||
{
|
{
|
||||||
SendError( playerid, "Please enter a player's ID or name." );
|
SendError( playerid, "Please enter a player's ID or name." );
|
||||||
ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
||||||
}
|
}
|
||||||
else if ( !IsPlayerConnected( pID ) )
|
else if ( !IsPlayerConnected( pID ) )
|
||||||
{
|
{
|
||||||
SendError( playerid, "This player is not connected." );
|
SendError( playerid, "This player is not connected." );
|
||||||
ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM Damen on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
ShowPlayerDialog( playerid, DIALOG_DONATED_DIAGOLD, DIALOG_STYLE_INPUT, ""COL_GOLD"SF-CNR Donation", ""COL_WHITE"As you've redeemed Diamond V.I.P, you have the option of gifting Gold VIP to someone.\n\nIf you would like to gift it to yourself, type your name/id or the person you're gifting it to.\n\n"COL_ORANGE"If you just don't know yet, cancel and PM " SERVER_OPERATOR " on the forum when you make a decision!", "Gift it!", "I'll Think!" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -801,7 +801,7 @@ static stock ShowPlayerVipRedeemedDialog( playerid )
|
|||||||
""COL_GREY" * What are the commands?"COL_WHITE" Use /vipcmds to view a detailed list of VIP commands.\n"\
|
""COL_GREY" * What are the commands?"COL_WHITE" Use /vipcmds to view a detailed list of VIP commands.\n"\
|
||||||
""COL_GREY" * What did I receive?"COL_WHITE" Check through your V.I.P package contents via our site (forum -> announcements board).\n" );
|
""COL_GREY" * What did I receive?"COL_WHITE" Check through your V.I.P package contents via our site (forum -> announcements board).\n" );
|
||||||
strcat( szLargeString, ""COL_GREY" * How to redeem my houses/vehicles?"COL_WHITE" You will be announced to the admins and noted down for assistance, so please wait!\n"\
|
strcat( szLargeString, ""COL_GREY" * How to redeem my houses/vehicles?"COL_WHITE" You will be announced to the admins and noted down for assistance, so please wait!\n"\
|
||||||
""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Damen via the forums!\n\nThanks for choosing to spend your Irresistible Coins, enjoy what you've got! :P" );
|
""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire " SERVER_OPERATOR " via the forums!\n\nThanks for choosing to spend your Irresistible Coins, enjoy what you've got! :P" );
|
||||||
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" );
|
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ thread deleteplayernote( playerid, noteid )
|
|||||||
if ( rows ) {
|
if ( rows ) {
|
||||||
SaveToAdminLog( playerid, noteid, "removed note" );
|
SaveToAdminLog( playerid, noteid, "removed note" );
|
||||||
mysql_single_query( sprintf( "UPDATE `NOTES` SET `DELETED`=%d WHERE `ID`=%d", p_AccountID[ playerid ], noteid ) );
|
mysql_single_query( sprintf( "UPDATE `NOTES` SET `DELETED`=%d WHERE `ID`=%d", p_AccountID[ playerid ], noteid ) );
|
||||||
SendServerMessage( playerid, "You have removed note id %d. If there are any problems, contact Damen/Council.", noteid );
|
SendServerMessage( playerid, "You have removed note id %d. If there are any problems, contact " SERVER_OPERATOR "/Council.", noteid );
|
||||||
AddAdminLogLineFormatted( "%s(%d) has deleted note id %d", ReturnPlayerName( playerid ), playerid, noteid );
|
AddAdminLogLineFormatted( "%s(%d) has deleted note id %d", ReturnPlayerName( playerid ), playerid, noteid );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ hook OnScriptInit( )
|
|||||||
SetDynamicObjectMaterialText( ( g_TopDonorWall = CreateDynamicObject( 3074, -1574.3559, 885.1296, 14.0153, 0.0000, 0.0000, -0.0156 ) ), 0, "Nobody donated :(", 130, "Arial", 48, 0, -65536, 0, 1 );
|
SetDynamicObjectMaterialText( ( g_TopDonorWall = CreateDynamicObject( 3074, -1574.3559, 885.1296, 14.0153, 0.0000, 0.0000, -0.0156 ) ), 0, "Nobody donated :(", 130, "Arial", 48, 0, -65536, 0, 1 );
|
||||||
|
|
||||||
// Latest Donor TD
|
// Latest Donor TD
|
||||||
g_TopDonorTD = TextDrawCreate(320.000000, 2.000000, "Top Donor Damen - $0.00, ~w~~h~~h~Latest Donor Damen - $0.00");
|
g_TopDonorTD = TextDrawCreate(320.000000, 2.000000, "Top Donor " SERVER_OPERATOR " - $0.00, ~w~~h~~h~Latest Donor " SERVER_OPERATOR " - $0.00");
|
||||||
TextDrawAlignment(g_TopDonorTD, 2);
|
TextDrawAlignment(g_TopDonorTD, 2);
|
||||||
TextDrawBackgroundColor(g_TopDonorTD, 0);
|
TextDrawBackgroundColor(g_TopDonorTD, 0);
|
||||||
TextDrawFont(g_TopDonorTD, 1);
|
TextDrawFont(g_TopDonorTD, 1);
|
||||||
@ -87,7 +87,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
|||||||
strcat( szLargeString, ""COL_WHITE"Thank you a lot for donating! :D In return for your dignity, you have received Irresistible Coins.\n\n"\
|
strcat( szLargeString, ""COL_WHITE"Thank you a lot for donating! :D In return for your dignity, you have received Irresistible Coins.\n\n"\
|
||||||
""COL_GREY" * What do I do with Irresistible Coins?"COL_WHITE" You can claim the V.I.P of your choice via "COL_GREY"/irresistiblecoins market"COL_WHITE".\n" );
|
""COL_GREY" * What do I do with Irresistible Coins?"COL_WHITE" You can claim the V.I.P of your choice via "COL_GREY"/irresistiblecoins market"COL_WHITE".\n" );
|
||||||
strcat( szLargeString, ""COL_GREY" * How many do I have?"COL_WHITE" You can see how many Irresistible Coins you have via "COL_GREY"/irresistiblecoins"COL_WHITE".\n" \
|
strcat( szLargeString, ""COL_GREY" * How many do I have?"COL_WHITE" You can see how many Irresistible Coins you have via "COL_GREY"/irresistiblecoins"COL_WHITE".\n" \
|
||||||
""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire Damen via the forums!\n\nThank you once again for your contribution to our community! :P" );
|
""COL_GREY" * I'm unsure, help?"COL_WHITE" If you have any questions, please /ask otherwise enquire " SERVER_OPERATOR " via the forums!\n\nThank you once again for your contribution to our community! :P" );
|
||||||
return ShowPlayerDialog( playerid, DIALOG_FINISHED_DONATING, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" );
|
return ShowPlayerDialog( playerid, DIALOG_FINISHED_DONATING, DIALOG_STYLE_MSGBOX, ""COL_GOLD"SF-CNR Donation", szLargeString, "Got it!", "" );
|
||||||
}
|
}
|
||||||
else if ( dialogid == DIALOG_FINISHED_DONATING )
|
else if ( dialogid == DIALOG_FINISHED_DONATING )
|
||||||
@ -97,7 +97,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
|||||||
else if ( dialogid == DIALOG_LATEST_DONOR )
|
else if ( dialogid == DIALOG_LATEST_DONOR )
|
||||||
{
|
{
|
||||||
if ( GetPVarType( playerid, "just_donated" ) != PLAYER_VARTYPE_FLOAT )
|
if ( GetPVarType( playerid, "just_donated" ) != PLAYER_VARTYPE_FLOAT )
|
||||||
return SendError( playerid, "Seems to be an issue where we couldn't find how much you donated. Report to Damen." );
|
return SendError( playerid, "Seems to be an issue where we couldn't find how much you donated. Report to " SERVER_OPERATOR "." );
|
||||||
|
|
||||||
new
|
new
|
||||||
Float: fAmount = GetPVarFloat( playerid, "just_donated" );
|
Float: fAmount = GetPVarFloat( playerid, "just_donated" );
|
||||||
|
@ -710,7 +710,7 @@ stock SendClientMessageToBlackjack( tableid, colour, format[ ], va_args<> )
|
|||||||
|
|
||||||
stock InitializeBlackjackTextdraws( id )
|
stock InitializeBlackjackTextdraws( id )
|
||||||
{
|
{
|
||||||
g_blackjackTurnTD[ id ] = TextDrawCreate(330.000000, 204.000000, "Damen has 5 seconds");
|
g_blackjackTurnTD[ id ] = TextDrawCreate(330.000000, 204.000000, "" SERVER_OPERATOR " has 5 seconds");
|
||||||
TextDrawAlignment(g_blackjackTurnTD[ id ], 2);
|
TextDrawAlignment(g_blackjackTurnTD[ id ], 2);
|
||||||
TextDrawBackgroundColor(g_blackjackTurnTD[ id ], 255);
|
TextDrawBackgroundColor(g_blackjackTurnTD[ id ], 255);
|
||||||
TextDrawFont(g_blackjackTurnTD[ id ], 1);
|
TextDrawFont(g_blackjackTurnTD[ id ], 1);
|
||||||
|
@ -120,6 +120,12 @@ CMD:weed( playerid, params[ ] )
|
|||||||
if ( IsPlayerTied( playerid ) || IsPlayerTazed( playerid ) || IsPlayerCuffed( playerid ) || IsPlayerJailed( playerid ) || IsPlayerInMinigame( playerid ) )
|
if ( IsPlayerTied( playerid ) || IsPlayerTazed( playerid ) || IsPlayerCuffed( playerid ) || IsPlayerJailed( playerid ) || IsPlayerInMinigame( playerid ) )
|
||||||
return SendError( playerid, "You cannot use this command at the moment." );
|
return SendError( playerid, "You cannot use this command at the moment." );
|
||||||
|
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_WEED ) ) {
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( strmatch( params, "plant" ) )
|
if ( strmatch( params, "plant" ) )
|
||||||
{
|
{
|
||||||
if ( ! IsPlayerJob( playerid, JOB_DRUG_DEALER ) ) return SendError( playerid, "You are not a drug dealer." );
|
if ( ! IsPlayerJob( playerid, JOB_DRUG_DEALER ) ) return SendError( playerid, "You are not a drug dealer." );
|
||||||
@ -230,7 +236,6 @@ CMD:weed( playerid, params[ ] )
|
|||||||
if ( IsPlayerLoadingObjects( playerid ) ) return SendError( playerid, "You're in a object-loading state, please wait." );
|
if ( IsPlayerLoadingObjects( playerid ) ) return SendError( playerid, "You're in a object-loading state, please wait." );
|
||||||
if ( IsPlayerAttachedObjectSlotUsed( playerid, 0 ) ) return SendError( playerid, "You cannot use this command since you're robbing." );
|
if ( IsPlayerAttachedObjectSlotUsed( playerid, 0 ) ) return SendError( playerid, "You cannot use this command since you're robbing." );
|
||||||
// if ( IsPlayerJob( playerid, JOB_DRUG_DEALER ) ) return SendError( playerid, "You cannot use your own products, they are for resale only!" );
|
// if ( IsPlayerJob( playerid, JOB_DRUG_DEALER ) ) return SendError( playerid, "You cannot use your own products, they are for resale only!" );
|
||||||
if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." );
|
|
||||||
//if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot use this command in a vehicle." );
|
//if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot use this command in a vehicle." );
|
||||||
//if ( GetPlayerState( playerid ) == PLAYER_STATE_ENTER_VEHICLE_DRIVER || GetPlayerState( playerid ) == PLAYER_STATE_ENTER_VEHICLE_PASSENGER ) return SendError( playerid, "You cannot use this command if you're entering a vehicle." );
|
//if ( GetPlayerState( playerid ) == PLAYER_STATE_ENTER_VEHICLE_DRIVER || GetPlayerState( playerid ) == PLAYER_STATE_ENTER_VEHICLE_PASSENGER ) return SendError( playerid, "You cannot use this command if you're entering a vehicle." );
|
||||||
//if ( GetPlayerState( playerid ) == PLAYER_STATE_EXIT_VEHICLE ) return SendError( playerid, "You cannot use this command if you're exiting a vehicle." );
|
//if ( GetPlayerState( playerid ) == PLAYER_STATE_EXIT_VEHICLE ) return SendError( playerid, "You cannot use this command if you're exiting a vehicle." );
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
#define SERVER_IP "54.36.127.43:7777"
|
#define SERVER_IP "54.36.127.43:7777"
|
||||||
#define SERVER_TWITTER "IrresistibleDev"
|
#define SERVER_TWITTER "IrresistibleDev"
|
||||||
|
|
||||||
|
/* ** Server Operator ** */
|
||||||
|
#define SERVER_OPERATOR "Lorenc"
|
||||||
|
#define SERVER_OPERATOR_ACC_ID 1
|
||||||
|
|
||||||
/* ** Comment line to disable feature ** */
|
/* ** Comment line to disable feature ** */
|
||||||
//#define SERVER_RULES_URL "files.sfcnr.com/en_rules.txt" // used for /rules (cnr\features\server_rules.pwn)
|
//#define SERVER_RULES_URL "files.sfcnr.com/en_rules.txt" // used for /rules (cnr\features\server_rules.pwn)
|
||||||
#define SERVER_TWITTER_FEED_URL "files.sfcnr.com/cnr_twitter.php" // used for /twitter (cnr\commands\cmd_twitter.pwn)
|
#define SERVER_TWITTER_FEED_URL "files.sfcnr.com/cnr_twitter.php" // used for /twitter (cnr\commands\cmd_twitter.pwn)
|
||||||
@ -55,7 +59,7 @@ hook OnScriptInit( )
|
|||||||
/* ** Functions ** */
|
/* ** Functions ** */
|
||||||
stock IsPlayerLeadMaintainer( playerid ) // Limits money, coin, xp spawning to this user id
|
stock IsPlayerLeadMaintainer( playerid ) // Limits money, coin, xp spawning to this user id
|
||||||
{
|
{
|
||||||
return GetPlayerAccountID( playerid ) == 1 || GetPlayerAccountID( playerid ) == 674688;
|
return GetPlayerAccountID( playerid ) == SERVER_OPERATOR_ACC_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
stock IsPlayerServerMaintainer( playerid ) // Same as lead maintainer, just cant spawn money/xp/coins
|
stock IsPlayerServerMaintainer( playerid ) // Same as lead maintainer, just cant spawn money/xp/coins
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#pragma option -d3
|
#pragma option -d3
|
||||||
#pragma dynamic 7200000
|
#pragma dynamic 7200000
|
||||||
|
|
||||||
//#define DEBUG_MODE
|
#define DEBUG_MODE
|
||||||
|
|
||||||
#if defined DEBUG_MODE
|
#if defined DEBUG_MODE
|
||||||
#pragma option -d3
|
#pragma option -d3
|
||||||
@ -1091,8 +1091,14 @@ public OnPlayerTakePlayerDamage( playerid, issuerid, &Float: amount, weaponid, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Headshots
|
// Headshots
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( ( weaponid == WEAPON_SNIPER || weaponid == WEAPON_RIFLE ) && bodypart == 9 && ( ! IsPlayerInEvent( playerid ) || ( IsPlayerInEvent( playerid ) && EventSettingAllow( EVENT_SETTING_HEADSHOT ) ) ) )
|
||||||
|
#else
|
||||||
if ( ( weaponid == WEAPON_SNIPER || weaponid == WEAPON_RIFLE ) && bodypart == 9 )
|
if ( ( weaponid == WEAPON_SNIPER || weaponid == WEAPON_RIFLE ) && bodypart == 9 )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
amount *= 1.5;
|
amount *= 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
// Paintball Headshot
|
// Paintball Headshot
|
||||||
if ( issuerid != INVALID_PLAYER_ID && p_inPaintBall{ playerid } == true )
|
if ( issuerid != INVALID_PLAYER_ID && p_inPaintBall{ playerid } == true )
|
||||||
@ -3425,12 +3431,14 @@ CMD:stoprob( playerid, params[ ] )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined __cloudy_event_system
|
||||||
CMD:exit( playerid, params[ ] ) return cmd_enter( playerid, params );
|
CMD:exit( playerid, params[ ] ) return cmd_enter( playerid, params );
|
||||||
CMD:enter( playerid, params[ ] )
|
CMD:enter( playerid, params[ ] )
|
||||||
{
|
{
|
||||||
GameTextForPlayer(playerid, "~n~~n~~r~~k~~VEHICLE_ENTER_EXIT~~n~~w~press this key in a enterable checkpoint.", 5000, 3);
|
GameTextForPlayer(playerid, "~n~~n~~r~~k~~VEHICLE_ENTER_EXIT~~n~~w~press this key in a enterable checkpoint.", 5000, 3);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CMD:kill( playerid, params[ ] )
|
CMD:kill( playerid, params[ ] )
|
||||||
{
|
{
|
||||||
@ -3519,6 +3527,17 @@ CMD:kidnap( playerid, params[ ] )
|
|||||||
else if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." );
|
else if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." );
|
||||||
else if ( p_KidnapImmunity[ victimid ] > g_iTime ) return SendError( playerid, "This player cannot be kidnapped for another %s.", secondstotime( p_KidnapImmunity[ victimid ] - g_iTime ) );
|
else if ( p_KidnapImmunity[ victimid ] > g_iTime ) return SendError( playerid, "This player cannot be kidnapped for another %s.", secondstotime( p_KidnapImmunity[ victimid ] - g_iTime ) );
|
||||||
else if ( PutPlayerInEmptyVehicleSeat( p_LastVehicle[ playerid ], victimid ) == -1 ) return SendError( playerid, "Failed to place the player inside a full of player vehicle." );
|
else if ( PutPlayerInEmptyVehicleSeat( p_LastVehicle[ playerid ], victimid ) == -1 ) return SendError( playerid, "Failed to place the player inside a full of player vehicle." );
|
||||||
|
|
||||||
|
// event check
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_KIDNAP ) )
|
||||||
|
#else
|
||||||
|
if ( IsPlayerInEvent( playerid ) )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
|
||||||
SendClientMessageFormatted( victimid, -1, ""COL_RED"[KIDNAPPED]{FFFFFF} You have been kidnapped by %s(%d)!", ReturnPlayerName( playerid ), playerid );
|
SendClientMessageFormatted( victimid, -1, ""COL_RED"[KIDNAPPED]{FFFFFF} You have been kidnapped by %s(%d)!", ReturnPlayerName( playerid ), playerid );
|
||||||
SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[KIDNAPPED]{FFFFFF} You have kidnapped %s(%d), he has been thrown in your previous entered vehicle!", ReturnPlayerName( victimid ), victimid );
|
SendClientMessageFormatted( playerid, -1, ""COL_GREEN"[KIDNAPPED]{FFFFFF} You have kidnapped %s(%d), he has been thrown in your previous entered vehicle!", ReturnPlayerName( victimid ), victimid );
|
||||||
TogglePlayerControllable( victimid, 0 );
|
TogglePlayerControllable( victimid, 0 );
|
||||||
@ -3585,11 +3604,20 @@ CMD:tie( playerid, params[ ] )
|
|||||||
else if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." );
|
else if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." );
|
||||||
else if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." );
|
else if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." );
|
||||||
else if ( GetPlayerState( victimid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot tie wasted players." );
|
else if ( GetPlayerState( victimid ) == PLAYER_STATE_WASTED ) return SendError( playerid, "You cannot tie wasted players." );
|
||||||
else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." );
|
|
||||||
else if ( IsPlayerInPlayerGang( playerid, victimid ) ) return SendError( playerid, "You cannot use this command on your homies!" );
|
else if ( IsPlayerInPlayerGang( playerid, victimid ) ) return SendError( playerid, "You cannot use this command on your homies!" );
|
||||||
else if ( IsPlayerSpawnProtected( victimid ) ) return SendError( playerid, "You cannot use this command on spawn protected players." );
|
else if ( IsPlayerSpawnProtected( victimid ) ) return SendError( playerid, "You cannot use this command on spawn protected players." );
|
||||||
else if ( IsPlayerInCasino( victimid ) && ! p_WantedLevel[ victimid ] ) return SendError( playerid, "The innocent person you're trying to tie is in a casino." );
|
else if ( IsPlayerInCasino( victimid ) && ! p_WantedLevel[ victimid ] ) return SendError( playerid, "The innocent person you're trying to tie is in a casino." );
|
||||||
|
|
||||||
|
// event check
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_TIE ) )
|
||||||
|
#else
|
||||||
|
if ( IsPlayerInEvent( playerid ) )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
|
||||||
// remove rope after attempt
|
// remove rope after attempt
|
||||||
if ( p_Ropes[ playerid ] -- > 0 ) {
|
if ( p_Ropes[ playerid ] -- > 0 ) {
|
||||||
ShowPlayerHelpDialog( playerid, 4500, "You only have %d ropes left!", p_Ropes[ playerid ] );
|
ShowPlayerHelpDialog( playerid, 4500, "You only have %d ropes left!", p_Ropes[ playerid ] );
|
||||||
@ -3769,9 +3797,18 @@ CMD:rob( playerid, params[ ] )
|
|||||||
else if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." );
|
else if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." );
|
||||||
else if ( IsPlayerInCasino( victimid ) && ! p_WantedLevel[ victimid ] ) return SendError( playerid, "The innocent person you're trying to rob is in a casino." );
|
else if ( IsPlayerInCasino( victimid ) && ! p_WantedLevel[ victimid ] ) return SendError( playerid, "The innocent person you're trying to rob is in a casino." );
|
||||||
else if ( p_ClassSelection{ victimid } ) return SendError( playerid, "This player is currently in class selection." );
|
else if ( p_ClassSelection{ victimid } ) return SendError( playerid, "This player is currently in class selection." );
|
||||||
else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." );
|
|
||||||
else if ( IsPlayerInPlayerGang( playerid, victimid ) ) return SendError( playerid, "You cannot use this command on your homies!" );
|
else if ( IsPlayerInPlayerGang( playerid, victimid ) ) return SendError( playerid, "You cannot use this command on your homies!" );
|
||||||
|
|
||||||
|
// event check
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_ROB ) )
|
||||||
|
#else
|
||||||
|
if ( IsPlayerInEvent( playerid ) )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
|
||||||
new
|
new
|
||||||
iRandom = random( 101 );
|
iRandom = random( 101 );
|
||||||
|
|
||||||
@ -3854,10 +3891,19 @@ CMD:rape( playerid, params[ ] )
|
|||||||
else if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." );
|
else if ( IsPlayerLoadingObjects( victimid ) ) return SendError( playerid, "This player is in a object-loading state." );
|
||||||
else if ( IsPlayerSpawnProtected( victimid ) ) return SendError( playerid, "This player is in a anti-spawn-kill state." );
|
else if ( IsPlayerSpawnProtected( victimid ) ) return SendError( playerid, "This player is in a anti-spawn-kill state." );
|
||||||
else if ( p_ClassSelection{ victimid } ) return SendError( playerid, "This player is currently in class selection." );
|
else if ( p_ClassSelection{ victimid } ) return SendError( playerid, "This player is currently in class selection." );
|
||||||
else if ( IsPlayerInEvent( playerid ) ) return SendError( playerid, "You cannot use this command since you're in an event." );
|
|
||||||
else if ( IsPlayerAFK( victimid ) && GetPlayerState( playerid ) != PLAYER_STATE_WASTED ) return SendError( playerid, "This player is in an AFK state." );
|
else if ( IsPlayerAFK( victimid ) && GetPlayerState( playerid ) != PLAYER_STATE_WASTED ) return SendError( playerid, "This player is in an AFK state." );
|
||||||
else if ( IsPlayerInPlayerGang( playerid, victimid ) ) return SendError( playerid, "You cannot use this command on your homies!" );
|
else if ( IsPlayerInPlayerGang( playerid, victimid ) ) return SendError( playerid, "You cannot use this command on your homies!" );
|
||||||
|
|
||||||
|
// event check
|
||||||
|
#if defined __cloudy_event_system
|
||||||
|
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_RAPE ) )
|
||||||
|
#else
|
||||||
|
if ( IsPlayerInEvent( playerid ) )
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
return SendError( playerid, "You cannot use this command since you're in an event." );
|
||||||
|
}
|
||||||
|
|
||||||
new iRandom = random( 101 );
|
new iRandom = random( 101 );
|
||||||
if ( IsPlayerJob( playerid, JOB_MUGGER ) ) { iRandom += 10; } // Adds more success to muggers
|
if ( IsPlayerJob( playerid, JOB_MUGGER ) ) { iRandom += 10; } // Adds more success to muggers
|
||||||
if ( iRandom < 75 || IsPlayerTied( victimid ) )
|
if ( iRandom < 75 || IsPlayerTied( victimid ) )
|
||||||
@ -7006,7 +7052,9 @@ stock IsPlayerAFK( playerid ) return ( ( GetTickCount( ) - p_AFKTime[ playerid ]
|
|||||||
|
|
||||||
stock GetPlayerVIPDuration( playerid ) return p_VIPExpiretime[ playerid ] - g_iTime;
|
stock GetPlayerVIPDuration( playerid ) return p_VIPExpiretime[ playerid ] - g_iTime;
|
||||||
|
|
||||||
|
#if !defined __cloudy_event_system
|
||||||
stock IsPlayerInEvent( playerid ) return ( GetPlayerVirtualWorld( playerid ) == 69 );
|
stock IsPlayerInEvent( playerid ) return ( GetPlayerVirtualWorld( playerid ) == 69 );
|
||||||
|
#endif
|
||||||
|
|
||||||
stock UpdatePlayerEntranceExitTick( playerid, seconds = 2 ) {
|
stock UpdatePlayerEntranceExitTick( playerid, seconds = 2 ) {
|
||||||
p_EntranceTimestamp[ playerid ] = g_iTime + seconds;
|
p_EntranceTimestamp[ playerid ] = g_iTime + seconds;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
v11.60.190
|
||||||
v11.57.188
|
v11.57.188
|
||||||
v11.56.186
|
v11.56.186
|
||||||
v11.55.182
|
v11.55.182
|
||||||
|
2
scriptfiles/changelogs/cnr/v11.60.190.txt
Normal file
2
scriptfiles/changelogs/cnr/v11.60.190.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
(+) Cloudy's advanced event system has been added.
|
||||||
|
(/) Full reversion of the turf war system to how it was pre-hardpoint.
|
Loading…
Reference in New Issue
Block a user