Merge pull request #10 from zeelorenc/master

Merge
This commit is contained in:
Dusan 2019-06-10 10:18:12 +02:00 committed by GitHub
commit 36208dbe6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 99 additions and 34 deletions

View File

@ -213,7 +213,7 @@
#define DIALOG_VIP_MAIN 1204
#define DIALOG_XPMARKET_SELL 1205
#define DIALOG_BUY_VIP_MAIN 1206
#define DIALOG_BOOMBOX_PLAY 1207
#define DIALOG_VEH_COLORS 1207
/* ** Hooks ** */
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )

View File

@ -32,6 +32,24 @@ hook OnPlayerDisconnect( playerid, reason )
return 1;
}
#if defined AC_INCLUDED
hook OnPlayerDeathEx( playerid, killerid, reason, Float: damage, bodypart )
#else
hook OnPlayerDeath( playerid, killerid, reason )
#endif
{
p_UsingBoombox{ playerid } = false;
Boombox_Destroy( playerid );
return 1;
}
hook OnPlayerJailed( playerid )
{
p_UsingBoombox{ playerid } = false;
Boombox_Destroy( playerid );
return 1;
}
hook OnPlayerEnterDynArea( playerid, areaid )
{
foreach ( new i : Player )
@ -68,42 +86,37 @@ hook OnPlayerLeaveDynArea( playerid, areaid )
return 1;
}
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
if ( ( dialogid == DIALOG_BOOMBOX_PLAY ) && response )
{
static
Float: X, Float: Y, Float: Z, Float: Angle;
if ( isnull( inputtext ) ) return SendError( playerid, "Looks like you didn't provide any URL.");
if ( GetPlayerPos( playerid, X, Y, Z ) && GetPlayerFacingAngle( playerid, Angle ) )
{
Boombox_Create( playerid, inputtext, X, Y, Z, Angle );
p_UsingBoombox{ playerid } = true;
SendServerMessage( playerid, "If the stream doesn't respond then it must be offline. Use "COL_GREY"/boombox stop"COL_WHITE" to stop the stream." );
}
}
return 1;
}
/* ** Commands ** */
CMD:boombox( playerid, params[ ] )
{
if ( ! GetPlayerBoombox( playerid ) )
return SendError( playerid, "You can buy Boombox at Supa Save or a 24/7 store." );
if ( IsPlayerInAnyVehicle(playerid) )
return SendError( playerid, "You cannot use Boombox inside of a vehicle.");
if ( strmatch( params, "play" ) )
if ( ! strcmp( params, "play", false, 3 ) )
{
if ( IsPlayerUsingBoombox( playerid ) ) return SendError( playerid, "You are already using Boombox." );
if ( IsPlayerNearBoombox( playerid ) ) return SendError( playerid, "You cannot be near another Boombox if you wish to create your own." );
static
Float: X, Float: Y, Float: Z, Float: Angle;
ShowPlayerDialog( playerid, DIALOG_BOOMBOX_PLAY, DIALOG_STYLE_INPUT, ""COL_WHITE"Boombox", ""COL_WHITE"Enter the URL below, and streaming will begin.\n\n"COL_ORANGE"Please note, if there isn't a response. It's likely to be an invalid URL.", "Stream", "Back" );
new szURL[ 128 ];
if ( sscanf( params[ 5 ], "s[128]", szURL ) ) return SendUsage( playerid, "/boombox play [URL]" );
else if ( IsPlayerUsingBoombox( playerid ) ) return SendError( playerid, "You are already using Boombox." );
else if ( IsPlayerNearBoombox( playerid ) ) return SendError( playerid, "You cannot be near another Boombox if you wish to create your own." );
else
{
if ( GetPlayerPos( playerid, X, Y, Z ) && GetPlayerFacingAngle( playerid, Angle ) )
{
Boombox_Create( playerid, szURL, X, Y, Z, Angle );
p_UsingBoombox{ playerid } = true;
SendServerMessage( playerid, "If the stream doesn't respond then it must be offline. Use "COL_GREY"/boombox stop"COL_WHITE" to stop the stream." );
}
}
}
else if ( strmatch( params, "stop" ) )
else if ( ! strcmp( params, "stop", false, 3 ) )
{
if ( ! IsPlayerUsingBoombox( playerid ) ) return SendError( playerid, "You are not using Boombox." );
@ -143,7 +156,7 @@ stock Boombox_Create( playerid, szURL[ ], Float: X, Float: Y, Float: Z, Float: A
g_boomboxData[ playerid ] [ E_Z ] = Z;
g_boomboxData[ playerid ] [ E_OBJECT ] = CreateDynamicObject( 2103, X, Y, Z - 0.92, 0, 0, 0, GetPlayerVirtualWorld( playerid ), GetPlayerInterior( playerid ), -1, Angle );
g_boomboxData[ playerid ] [ E_LABEL ] = CreateDynamic3DTextLabel( sprintf( "%s(%d)'s Boombox", ReturnPlayerName( playerid ), playerid ), COLOR_GOLD, X, Y, Z, 10, .worldid = GetPlayerVirtualWorld( playerid ), .interiorid = GetPlayerInterior( playerid ) );
g_boomboxData[ playerid ] [ E_LABEL ] = CreateDynamic3DTextLabel( sprintf( "%s(%d)'s Boombox", ReturnPlayerName( playerid ), playerid ), COLOR_GOLD, X, Y, Z, 20, .worldid = GetPlayerVirtualWorld( playerid ), .interiorid = GetPlayerInterior( playerid ) );
g_boomboxData[ playerid ] [ E_MUSIC_AREA ] = CreateDynamicSphere( X, Y, Z, fDistance, .worldid = GetPlayerVirtualWorld( playerid ), .interiorid = GetPlayerInterior( playerid ) );
return 1;
}

View File

@ -70,7 +70,8 @@ static stock
{ "{8ADE47}Stephanie:"COL_WHITE" Contribute to our feature "COL_GREY"/crowdfunds"COL_WHITE"! Early supporters get benefits!" },
{ "{8ADE47}Stephanie:"COL_WHITE" You can buy premium player homes using "COL_GREY"/estate"COL_WHITE"!" },
{ "{8ADE47}Stephanie:"COL_WHITE" You can buy Irresistible Coins from players using "COL_GREY"/ic buy"COL_WHITE"!" },
{ "{8ADE47}Stephanie:"COL_WHITE" Buy a secure wallet to reduce the amount of money you drop when you die!" }
{ "{8ADE47}Stephanie:"COL_WHITE" Buy a secure wallet to reduce the amount of money you drop when you die!" },
{ "{8ADE47}Stephanie:"COL_WHITE" Buy a boombox and have a music party with your friends in area!" }
},
g_randomMessageTick = 0
;

View File

@ -25,7 +25,36 @@ enum E_CAR_DATA
new
g_vehicleData [ MAX_PLAYERS ] [ MAX_BUYABLE_VEHICLES ] [ E_CAR_DATA ],
bool: g_buyableVehicle [ MAX_VEHICLES char ],
g_vehicleModifications [ MAX_PLAYERS ] [ MAX_BUYABLE_VEHICLES ] [ MAX_CAR_MODS ]
g_vehicleModifications [ MAX_PLAYERS ] [ MAX_BUYABLE_VEHICLES ] [ MAX_CAR_MODS ],
g_vehicleColors [ ] =
{
0x000000AA, 0xF5F5F5AA, 0x2A77A1AA, 0x840410AA, 0x263739AA, 0x86446EAA, 0xD78E10AA, 0x4C75B7AA, 0xBDBEC6AA, 0x5E7072AA,
0x46597AAA, 0x656A79AA, 0x5D7E8DAA, 0x58595AAA, 0xD6DAD6AA, 0x9CA1A3AA, 0x335F3FAA, 0x730E1AAA, 0x7B0A2AAA, 0x9F9D94AA,
0x3B4E78AA, 0x732E3EAA, 0x691E3BAA, 0x96918CAA, 0x515459AA, 0x3F3E45AA, 0xA5A9A7AA, 0x635C5AAA, 0x3D4A68AA, 0x979592AA,
0x421F21AA, 0x5F272BAA, 0x8494ABAA, 0x767B7CAA, 0x646464AA, 0x5A5752AA, 0x252527AA, 0x2D3A35AA, 0x93A396AA, 0x6D7A88AA,
0x221918AA, 0x6F675FAA, 0x7C1C2AAA, 0x5F0A15AA, 0x193826AA, 0x5D1B20AA, 0x9D9872AA, 0x7A7560AA, 0x989586AA, 0xADB0B0AA,
0x848988AA, 0x304F45AA, 0x4D6268AA, 0x162248AA, 0x272F4BAA, 0x7D6256AA, 0x9EA4ABAA, 0x9C8D71AA, 0x6D1822AA, 0x4E6881AA,
0x9C9C98AA, 0x917347AA, 0x661C26AA, 0x949D9FAA, 0xA4A7A5AA, 0x8E8C46AA, 0x341A1EAA, 0x6A7A8CAA, 0xAAAD8EAA, 0xAB988FAA,
0x851F2EAA, 0x6F8297AA, 0x585853AA, 0x9AA790AA, 0x601A23AA, 0x20202CAA, 0xA4A096AA, 0xAA9D84AA, 0x78222BAA, 0x0E316DAA,
0x722A3FAA, 0x7B715EAA, 0x741D28AA, 0x1E2E32AA, 0x4D322FAA, 0x7C1B44AA, 0x2E5B20AA, 0x395A83AA, 0x6D2837AA, 0xA7A28FAA,
0xAFB1B1AA, 0x364155AA, 0x6D6C6EAA, 0x0F6A89AA, 0x204B6BAA, 0x2B3E57AA, 0x9B9F9DAA, 0x6C8495AA, 0x4D8495AA, 0xAE9B7FAA,
0x406C8FAA, 0x1F253BAA, 0xAB9276AA, 0x134573AA, 0x96816CAA, 0x64686AAA, 0x105082AA, 0xA19983AA, 0x385694AA, 0x525661AA,
0x7F6956AA, 0x8C929AAA, 0x596E87AA, 0x473532AA, 0x44624FAA, 0x730A27AA, 0x223457AA, 0x640D1BAA, 0xA3ADC6AA, 0x695853AA,
0x9B8B80AA, 0x620B1CAA, 0x5B5D5EAA, 0x624428AA, 0x731827AA, 0x1B376DAA, 0xEC6AAEAA, 0x000000AA, 0x177517AA, 0x210606AA,
0x125478AA, 0x452A0DAA, 0x571E1EAA, 0x010701AA, 0x25225AAA, 0x2C89AAAA, 0x8A4DBDAA, 0x35963AAA, 0xB7B7B7AA, 0x464C8DAA,
0x84888CAA, 0x817867AA, 0x817A26AA, 0x6A506FAA, 0x583E6FAA, 0x8CB972AA, 0x824F78AA, 0x6D276AAA, 0x1E1D13AA, 0x1E1306AA,
0x1F2518AA, 0x2C4531AA, 0x1E4C99AA, 0x2E5F43AA, 0x1E9948AA, 0x1E9999AA, 0x999976AA, 0x7C8499AA, 0x992E1EAA, 0x2C1E08AA,
0x142407AA, 0x993E4DAA, 0x1E4C99AA, 0x198181AA, 0x1A292AAA, 0x16616FAA, 0x1B6687AA, 0x6C3F99AA, 0x481A0EAA, 0x7A7399AA,
0x746D99AA, 0x53387EAA, 0x222407AA, 0x3E190CAA, 0x46210EAA, 0x991E1EAA, 0x8D4C8DAA, 0x805B80AA, 0x7B3E7EAA, 0x3C1737AA,
0x733517AA, 0x781818AA, 0x83341AAA, 0x8E2F1CAA, 0x7E3E53AA, 0x7C6D7CAA, 0x020C02AA, 0x072407AA, 0x163012AA, 0x16301BAA,
0x642B4FAA, 0x368452AA, 0x999590AA, 0x818D96AA, 0x99991EAA, 0x7F994CAA, 0x839292AA, 0x788222AA, 0x2B3C99AA, 0x3A3A0BAA,
0x8A794EAA, 0x0E1F49AA, 0x15371CAA, 0x15273AAA, 0x375775AA, 0x060820AA, 0x071326AA, 0x20394BAA, 0x2C5089AA, 0x15426CAA,
0x103250AA, 0x241663AA, 0x692015AA, 0x8C8D94AA, 0x516013AA, 0x090F02AA, 0x8C573AAA, 0x52888EAA, 0x995C52AA, 0x99581EAA,
0x993A63AA, 0x998F4EAA, 0x99311EAA, 0x0D1842AA, 0x521E1EAA, 0x42420DAA, 0x4C991EAA, 0x082A1DAA, 0x96821DAA, 0x197F19AA,
0x3B141FAA, 0x745217AA, 0x893F8DAA, 0x7E1A6CAA, 0x0B370BAA, 0x27450DAA, 0x071F24AA, 0x784573AA, 0x8A653AAA, 0x732617AA,
0x319490AA, 0x56941DAA, 0x59163DAA, 0x1B8A2FAA, 0x38160BAA, 0x041804AA, 0x355D8EAA, 0x2E3F5BAA, 0x561A28AA, 0x4E0E27AA,
0x706C67AA, 0x3B3E42AA, 0x2E2D33AA, 0x7B7E7DAA, 0x4A4442AA, 0x28344EAA
}
;
/* ** Hooks ** */
@ -537,6 +566,26 @@ CMD:v( playerid, params[ ] )
return 1;
}
CMD:colors( playerid, params[ ] ) return cmd_colours( playerid, params );
CMD:colours( playerid, params[ ] )
{
const
COLORS_PER_ROW = 20;
static
list[ 4072 ];
list[ 0 ] = '\0';
for ( new J; J != sizeof( g_vehicleColors ); J ++ )
{
format( list, sizeof( list ), "%s{%06x}%03d%s", list, g_vehicleColors[ J ] >>> 8, J, ! ( ( J + 1 ) % COLORS_PER_ROW ) ? ( "\n" ) : ( " " ) );
}
ShowPlayerDialog( playerid, DIALOG_VEH_COLORS, DIALOG_STYLE_MSGBOX, ""COL_WHITE"Vehicle Colors", list, "Okay", "");
return 1;
}
/* ** SQL Threads ** */
thread OnVehicleLoad( playerid )
{
@ -852,7 +901,7 @@ stock dischargeVehicles( playerid )
if ( g_vehicleData[ playerid ][ v ][ E_MODEL ] == 508 ) RemovePlayersFromJourney( g_vehicleData[ playerid ][ v ][ E_VEHICLE_ID ] );
DestroyBuyableVehicle( playerid, v, .db_remove = false );
}
}
return 1;
}

View File

@ -538,6 +538,7 @@ public OnPlayerDisconnect( playerid, reason )
p_OwnedHouses [ playerid ] = 0;
p_OwnedVehicles [ playerid ] = 0;
p_ToggledViewPM { playerid } = false;
p_TogglePBChat { playerid } = false;
p_VIPExpiretime [ playerid ] = 0;
p_Kills [ playerid ] = 0;
p_Deaths [ playerid ] = 0;
@ -1291,7 +1292,7 @@ public OnPlayerDeath( playerid, killerid, reason )
//DCC_SendChannelMessageFormatted( discordGeneralChan, "*%s(%d) has killed %s(%d) - %s!*", ReturnPlayerName( killerid ), killerid, ReturnPlayerName( playerid ), playerid, ReturnWeaponName( reason ) );
if ( !IsPlayerAdminOnDuty( killerid ) )
if ( !IsPlayerAdminOnDuty( killerid ) && ! IsPlayerInEvent( killerid ) )
{
new
killerGangId = p_GangID[ killerid ];
@ -1439,7 +1440,7 @@ public OnPlayerDeath( playerid, killerid, reason )
DeletePVar( playerid, "used_cmd_kill" );
}
if ( ! IsPlayerInPaintBall( playerid ) && !p_LeftPaintball{ playerid } && !IsPlayerAdminOnDuty( playerid ) )
if ( ! IsPlayerInPaintBall( playerid ) && !p_LeftPaintball{ playerid } && ! IsPlayerAdminOnDuty( playerid ) && ! IsPlayerInEvent( playerid ) )
{
if ( playerGangId != INVALID_GANG_ID )
SaveGangData( playerGangId ), g_gangData[ playerGangId ] [ E_DEATHS ]++;
@ -5416,8 +5417,9 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
format( szLargeString, 750, "%s"COL_GREY"Weed Seeds:"COL_WHITE" %d\n"\
""COL_GREY"Fireworks:{FFFFFF} %d\n"\
""COL_GREY"Explosive Bullets:{FFFFFF} %d\n",
szLargeString, GetPlayerShopItemAmount( playerid, SHOP_ITEM_WEED_SEED ), p_Fireworks[ pID ], p_ExplosiveBullets[ pID ] );
""COL_GREY"Explosive Bullets:{FFFFFF} %d\n"\
""COL_GREY"Boombox:{FFFFFF} %s\n",
szLargeString, GetPlayerShopItemAmount( playerid, SHOP_ITEM_WEED_SEED ), p_Fireworks[ pID ], p_ExplosiveBullets[ pID ], p_Boombox{ pID } == true ? ( "Yes" ) : ( "No" ) );
ShowPlayerDialog( playerid, DIALOG_STATS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Item Statistics", szLargeString, "Okay", "Back" );
}