Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Stev 2019-06-17 18:04:23 +01:00
commit adbd7ac5de
33 changed files with 2238 additions and 182 deletions

View File

@ -94,7 +94,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
p_Uptime[ playerid ] = 0; p_Uptime[ playerid ] = 0;
ShowAchievement( playerid, "Registering to SF-CnR!", 1 ); ShowAchievement( playerid, "Registering to SF-CnR!", 1 );
p_PlayerLogged{ playerid } = true; p_PlayerLogged{ playerid } = true;
SetPlayerCash( playerid, 0 ); SetPlayerCash( playerid, 5000 );
SetPlayerScore( playerid, 0 ); SetPlayerScore( playerid, 0 );
p_Kills[ playerid ] = 1; p_Kills[ playerid ] = 1;
p_Deaths[ playerid ] = 1; p_Deaths[ playerid ] = 1;
@ -375,7 +375,7 @@ stock SavePlayerData( playerid, bool: logout = false )
if ( IsPlayerCuffed( playerid ) || IsPlayerTazed( playerid ) || IsPlayerTied( playerid ) || p_LeftCuffed{ playerid } || p_QuitToAvoidTimestamp[ playerid ] > g_iTime ) if ( IsPlayerCuffed( playerid ) || IsPlayerTazed( playerid ) || IsPlayerTied( playerid ) || p_LeftCuffed{ playerid } || p_QuitToAvoidTimestamp[ playerid ] > g_iTime )
bQuitToAvoid = true; bQuitToAvoid = true;
#if defined __cloudy_event_system #if defined __cloudy_event_system
if ( IsPlayerInEvent( playerid ) ) if ( IsPlayerInEvent( playerid ) )
bQuitToAvoid = false; bQuitToAvoid = false;

View File

@ -140,6 +140,7 @@ static stock
{ 5, "/editgate", "Editing a gate" }, { 5, "/editgate", "Editing a gate" },
{ 5, "/acunban", "Unbanning a player from AC" }, { 5, "/acunban", "Unbanning a player from AC" },
{ 5, "/safeisbugged", "Debug command for robbery safes" }, { 5, "/safeisbugged", "Debug command for robbery safes" },
{ 5, "/replenishsafe", "Fixes bugged robbery safes" },
{ 5, "/autovehrespawn", "Setting auto respawn for vehicles" }, { 5, "/autovehrespawn", "Setting auto respawn for vehicles" },
{ 5, "/megaban", "The Mega Ban" }, { 5, "/megaban", "The Mega Ban" },
{ 5, "/achangename", "Change a players name" }, { 5, "/achangename", "Change a players name" },

View File

@ -346,6 +346,23 @@ CMD:safeisbugged( playerid, params[ ] )
return 1; return 1;
} }
CMD:replenishsafe( playerid, params[ ] )
{
new
rID;
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
else if ( sscanf( params, "d", rID ) ) return SendUsage( playerid, "/replenishsafe [SAFE_ID]" );
else if (!Iter_Contains(RobberyCount, rID)) return SendError( playerid, "This is an invalid Safe ID." );
else
{
printf( "[GM:ADMIN] %s has replenished %d! (Success: %d)", ReturnPlayerName( playerid ), rID, setSafeReplenished( rID ) );
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You've replenished Safe ID %d: "COL_GREY"%s"COL_WHITE".", rID, g_robberyData[ rID ] [ E_NAME ] );
}
return 1;
}
CMD:autovehrespawn( playerid, params[ ] ) CMD:autovehrespawn( playerid, params[ ] )
{ {
#if defined _vsync_included #if defined _vsync_included
@ -1001,3 +1018,41 @@ thread OnPlayerUnforceAC( playerid, player[ ], pID, bool:offline )
} }
return 1; return 1;
} }
CMD:giveboombox( playerid, params[ ] )
{
new
pID;
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/giveboombox [PLAYER_ID]" );
else if ( ! IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
else if ( GetPlayerBoombox( pID ) ) return SendError( playerid, "Player already has boombox in his inventory." );
else
{
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) gave you boombox.", ReturnPlayerName( playerid ), playerid );
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have given boombox to %s(%d).", ReturnPlayerName( pID ), pID );
AddAdminLogLineFormatted( "%s(%d) has given boombox to %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
SetPlayerBoombox( pID, true );
}
return 1;
}
CMD:removeboombox( playerid, params[ ] )
{
new
pID;
if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/removeboombox [PLAYER_ID]" );
else if ( ! IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." );
else if ( ! GetPlayerBoombox( pID ) ) return SendError( playerid, "Player doesn't have boombox in his inventory." );
else
{
SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has removed your boombox.", ReturnPlayerName( playerid ), playerid );
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have removed boombox from %s(%d).", ReturnPlayerName( pID ), pID );
AddAdminLogLineFormatted( "%s(%d) has removed boombox from %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID );
SetPlayerBoombox( pID, false );
}
return 1;
}

View File

@ -255,23 +255,6 @@ CMD:addcomponent( playerid, params[ ] )
return 1; return 1;
} }
CMD:replenishsafe( playerid, params[ ] )
{
new
rID;
if ( !IsPlayerAdmin( playerid ) ) return 0;
else if ( sscanf( params, "d", rID ) ) return SendUsage( playerid, "/replenishsafe [SAFE_ID]" );
else if (!Iter_Contains(RobberyCount, rID)) return SendError( playerid, "This is an invalid Safe ID." );
else
{
printf( "[GM:ADMIN] %s has replenished %d! (Success: %d)", ReturnPlayerName( playerid ), rID, setSafeReplenished( rID ) );
SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You've replenished Safe ID %d: "COL_GREY"%s"COL_WHITE".", rID, g_robberyData[ rID ] [ E_NAME ] );
}
return 1;
}
CMD:driveby( playerid, params[ ] ) CMD:driveby( playerid, params[ ] )
{ {
if ( !IsPlayerAdmin( playerid ) ) return 0; if ( !IsPlayerAdmin( playerid ) ) return 0;

View File

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

View File

@ -68,6 +68,7 @@
#include "irresistible\cnr\features\shamal.pwn" #include "irresistible\cnr\features\shamal.pwn"
#include "irresistible\cnr\features\billboards.pwn" #include "irresistible\cnr\features\billboards.pwn"
#include "irresistible\cnr\features\trolley_car.pwn" #include "irresistible\cnr\features\trolley_car.pwn"
#include "irresistible\cnr\features\boom_box.pwn"
// pool // pool
#include "irresistible\cnr\features\pool.pwn" #include "irresistible\cnr\features\pool.pwn"

View File

@ -366,7 +366,7 @@ stock CreateLoopingAnimation( playerid, animlib[ ], animname[ ], Float:Speed, lo
{ {
// event check // event check
#if defined __cloudy_event_system #if defined __cloudy_event_system
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_KIDNAP ) ) if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_ANIM ) )
#else #else
if ( IsPlayerInEvent( playerid ) ) if ( IsPlayerInEvent( playerid ) )
#endif #endif

View File

@ -0,0 +1,201 @@
/*
* Irresistible Gaming 2018
* Developed by Night
* Module: cnr\features\boom_box.pwn
* Purpose: boombox related feature
*/
/* ** Includes ** */
#include < YSI\y_hooks >
/* ** Definitions ** */
#define DEFAULT_BOOMBOX_RANGE ( 50.0 )
#define BOOMBOX_URL_LEN ( 128 )
/* ** Variables ** */
enum E_BOOMBOX_DATA
{
E_OBJECT, Text3D: E_LABEL, E_MUSIC_AREA,
Float: E_X, Float: E_Y, Float: E_Z,
E_URL[ BOOMBOX_URL_LEN ]
};
static stock
g_boomboxData [ MAX_PLAYERS ] [ E_BOOMBOX_DATA ],
bool: p_Boombox [ MAX_PLAYERS char ],
bool: p_UsingBoombox [ MAX_PLAYERS char ]
;
/* ** Hooks ** */
hook OnPlayerDisconnect( playerid, reason )
{
SetPlayerBoombox( playerid, false );
return 1;
}
#if defined AC_INCLUDED
hook OnPlayerDeathEx( playerid, killerid, reason, Float: damage, bodypart )
#else
hook OnPlayerDeath( playerid, killerid, reason )
#endif
{
Boombox_Destroy( playerid );
return 1;
}
hook OnPlayerJailed( playerid )
{
Boombox_Destroy( playerid );
return 1;
}
hook OnPlayerEnterDynArea( playerid, areaid )
{
foreach ( new i : Player )
{
if ( IsValidDynamicArea( g_boomboxData[ i ] [ E_MUSIC_AREA ] ) )
{
if ( areaid == g_boomboxData[ i ] [ E_MUSIC_AREA ] )
{
// start the music
PlayAudioStreamForPlayer( playerid, g_boomboxData[ i ] [ E_URL ], g_boomboxData[ i ] [ E_X ], g_boomboxData[ i ] [ E_Y ], g_boomboxData[ i ] [ E_Z ], DEFAULT_BOOMBOX_RANGE, 1 );
SendServerMessage( playerid, "You are now listening to a nearby boombox!" );
return 1;
}
}
}
return 1;
}
hook OnPlayerLeaveDynArea( playerid, areaid )
{
foreach ( new i : Player )
{
if ( IsValidDynamicArea( g_boomboxData[ i ] [ E_MUSIC_AREA ] ) )
{
if ( areaid == g_boomboxData[ i ] [ E_MUSIC_AREA ] )
{
// stop the music
StopAudioStreamForPlayer( playerid );
SendServerMessage( playerid, "You stopped listening to a nearby boombox!" );
return 1;
}
}
}
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 ( ! strcmp( params, "play", false, 3 ) )
{
static
Float: X,
Float: Y,
Float: Z,
Float: Angle,
szURL[ BOOMBOX_URL_LEN ];
if ( sscanf( params[ 5 ], sprintf( "s[%d]", BOOMBOX_URL_LEN ), szURL ) ) return SendUsage( playerid, "/boombox play [URL]" );
// else if ( IsPlayerUsingBoombox( playerid ) ) return SendError( playerid, "You are already using Boombox." );
else
{
if ( GetPlayerPos( playerid, X, Y, Z ) && GetPlayerFacingAngle( playerid, Angle ) )
{
new
current_boombox = GetCurrentBoombox( playerid );
if ( current_boombox != -1 && current_boombox != playerid ) {
return SendError( playerid, "You cannot be near another Boombox if you wish to create your own." );
}
if ( IsPlayerUsingBoombox( playerid ) ) {
if ( GetPlayerDistanceFromPoint( playerid, g_boomboxData[ playerid ] [ E_X ], g_boomboxData[ playerid ] [ E_Y ], g_boomboxData[ playerid ] [ E_Z ] ) > DEFAULT_BOOMBOX_RANGE ) {
return SendError( playerid, "You are too far from your boombox. Use "COL_GREY"/boombox stop"COL_WHITE" to stop it." );
}
format( g_boomboxData[ playerid ] [ E_URL ], BOOMBOX_URL_LEN, "%s", szURL );
foreach ( new i : Player ) {
if ( GetPlayerDistanceFromPoint( i, g_boomboxData[ playerid ] [ E_X ], g_boomboxData[ playerid ] [ E_Y ], g_boomboxData[ playerid ] [ E_Z ] ) < DEFAULT_BOOMBOX_RANGE ) {
StopAudioStreamForPlayer( i );
PlayAudioStreamForPlayer( i, g_boomboxData[ playerid ] [ E_URL ], g_boomboxData[ playerid ] [ E_X ], g_boomboxData[ playerid ] [ E_Y ], g_boomboxData[ playerid ] [ E_Z ], DEFAULT_BOOMBOX_RANGE, 1 );
}
}
SendServerMessage( playerid, "You have updated your boombox stream to: "COL_GREY"%s", szURL );
} else {
SendServerMessage( playerid, "If the stream doesn't respond then it must be offline. Use "COL_GREY"/boombox stop"COL_WHITE" to stop the stream." );
Boombox_Create( playerid, szURL, X, Y, Z, Angle );
p_UsingBoombox{ playerid } = true;
}
}
}
}
else if ( ! strcmp( params, "stop", false, 3 ) )
{
if ( ! IsPlayerUsingBoombox( playerid ) ) return SendError( playerid, "You are not using Boombox." );
StopAudioStreamForPlayer( playerid );
Boombox_Destroy( playerid );
SendServerMessage( playerid, "You have removed your Boombox.");
p_UsingBoombox{ playerid } = false;
}
else SendUsage( playerid, "/boombox [PLAY/STOP]" );
return 1;
}
/* ** Functions ** */
stock IsPlayerUsingBoombox( playerid ) return p_UsingBoombox{ playerid };
stock GetPlayerBoombox( playerid ) return p_Boombox{ playerid };
stock SetPlayerBoombox( playerid, bool: toggle )
{
if ( ( p_Boombox{ playerid } = toggle ) == false ) {
Boombox_Destroy( playerid );
}
}
stock Boombox_Destroy( playerid )
{
p_UsingBoombox{ playerid } = false;
g_boomboxData[ playerid ] [ E_X ] = 0.0;
g_boomboxData[ playerid ] [ E_Y ] = 0.0;
g_boomboxData[ playerid ] [ E_Z ] = 0.0;
g_boomboxData[ playerid ] [ E_URL ] [ 0 ] = '\0';
DestroyDynamicObject( g_boomboxData[ playerid ] [ E_OBJECT ] );
DestroyDynamic3DTextLabel( g_boomboxData[ playerid ] [ E_LABEL ] );
DestroyDynamicArea( g_boomboxData[ playerid ] [ E_MUSIC_AREA ] );
return 1;
}
stock Boombox_Create( playerid, szURL[ BOOMBOX_URL_LEN ], Float: X, Float: Y, Float: Z, Float: Angle, Float: fDistance = DEFAULT_BOOMBOX_RANGE )
{
format( g_boomboxData[ playerid ] [ E_URL ], BOOMBOX_URL_LEN, "%s", szURL );
g_boomboxData[ playerid ] [ E_X ] = X;
g_boomboxData[ playerid ] [ E_Y ] = Y;
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, 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;
}
stock GetCurrentBoombox( playerid )
{
foreach ( new i : Player ) {
if ( GetPlayerDistanceFromPoint( playerid, g_boomboxData[ i ] [ E_X ], g_boomboxData[ i ] [ E_Y ], g_boomboxData[ i ] [ E_Z ] ) < DEFAULT_BOOMBOX_RANGE ) {
return i;
}
}
return -1;
}

View File

@ -122,7 +122,7 @@ CMD:taze( playerid, params[ ] )
// event check // event check
#if defined __cloudy_event_system #if defined __cloudy_event_system
if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_KIDNAP ) ) if ( IsPlayerInEvent( playerid ) && ! EventSettingAllow( EVENT_SETTING_ARREST ) )
#else #else
if ( IsPlayerInEvent( playerid ) ) if ( IsPlayerInEvent( playerid ) )
#endif #endif
@ -180,6 +180,9 @@ CMD:arrest( playerid, params[ ] )
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." );
new totalCash = ( p_WantedLevel[ victimid ] < MAX_WANTED_LVL ? p_WantedLevel[ victimid ] : MAX_WANTED_LVL ) * ( COP_ARREST_PAY_PER_WANTED ); new totalCash = ( p_WantedLevel[ victimid ] < MAX_WANTED_LVL ? p_WantedLevel[ victimid ] : MAX_WANTED_LVL ) * ( COP_ARREST_PAY_PER_WANTED );
new totalSeconds = p_WantedLevel[ victimid ] * ( JAIL_SECONDS_MULTIPLIER ); new totalSeconds = p_WantedLevel[ victimid ] * ( JAIL_SECONDS_MULTIPLIER );
if ( GetPlayerLevel( victimid, E_POLICE ) >= 75.0 ) {
totalSeconds = floatround( float( totalSeconds ) * 0.5 );
}
GivePlayerScore( playerid, 2 ); GivePlayerScore( playerid, 2 );
GivePlayerExperience( playerid, E_POLICE ); GivePlayerExperience( playerid, E_POLICE );
GivePlayerCash( playerid, totalCash ); GivePlayerCash( playerid, totalCash );
@ -396,9 +399,13 @@ stock BreakPlayerCuffs( playerid )
} }
else p_BobbyPins[ playerid ] --; else p_BobbyPins[ playerid ] --;
new probability = 50; // success rate probability new Float: probability = fRandomEx( 0.0, 100.0 );
if ( random( 101 ) <= probability ) // multiply success rate every 25 levels (only 1, 2, 3, 4x)
probability *= GetPlayerLevel( playerid, E_POLICE ) / 25.0 + 1.0;
// if probability >= n% after multiplying as well then uncuff
if ( probability >= 75.0 )
{ {
if ( ! IsPlayerCuffed( playerid ) ) if ( ! IsPlayerCuffed( playerid ) )
{ {
@ -439,12 +446,12 @@ stock AwardNearestLEO( playerid, reason )
{ {
if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || IsPlayerDead( playerid ) ) if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || IsPlayerDead( playerid ) )
return false; return false;
#if defined __cloudy_event_system #if defined __cloudy_event_system
if ( IsPlayerInEvent( playerid ) ) if ( IsPlayerInEvent( playerid ) )
return false; return false;
#endif #endif
new Float: radius = ( IsPlayerInAnyVehicle( playerid ) ? 150.0 : 75.0 ); // If player is in a vehicle, increase radius due to ability to get farther quicker. new Float: radius = ( IsPlayerInAnyVehicle( playerid ) ? 150.0 : 75.0 ); // If player is in a vehicle, increase radius due to ability to get farther quicker.
new closestLEO = GetClosestPlayerEx( playerid, CLASS_POLICE, radius ); new closestLEO = GetClosestPlayerEx( playerid, CLASS_POLICE, radius );

View File

@ -32,13 +32,13 @@ CMD:bail( playerid, params[ ] )
else if ( GetPVarInt( pID, "bail_antispam" ) > g_iTime ) return SendError( playerid, "You must wait 10 seconds before offering a bail to this player." ); else if ( GetPVarInt( pID, "bail_antispam" ) > g_iTime ) return SendError( playerid, "You must wait 10 seconds before offering a bail to this player." );
else else
{ {
equa = BAIL_DOLLARS_PER_SECOND * p_JailTime[ pID ]; equa = floatround( float( BAIL_DOLLARS_PER_SECOND * p_JailTime[ pID ] ) * ( 1.0 - GetPlayerLevel( pID, E_POLICE ) / 125.0 ) );
if ( p_JailTime[ pID ] >= ALCATRAZ_TIME_WANTED ) equa *= 2; if ( p_JailTime[ pID ] >= ALCATRAZ_TIME_WANTED ) equa *= 2;
p_BailOfferer[ pID ] = playerid; p_BailOfferer[ pID ] = playerid;
p_BailTimestamp[ pID ] = g_iTime + 120; p_BailTimestamp[ pID ] = g_iTime + 120;
SetPVarInt( pID, "bail_antispam", g_iTime + 1 ); SetPVarInt( pID, "bail_antispam", g_iTime + 1 );
SendServerMessage( playerid, "You have offered %s(%d) bail for "COL_GOLD"%s", ReturnPlayerName( pID ), pID, cash_format( equa ) ); SendServerMessage( playerid, "You have offered %s(%d) bail for "COL_GOLD"%s", ReturnPlayerName( pID ), pID, cash_format( equa ) );
SendClientMessageFormatted( pID, -1, ""COL_GREY"[SERVER]"COL_WHITE" %s(%d) has offered to bail you out for "COL_GOLD"%s"COL_WHITE". "COL_ORANGE"/acceptbail"COL_WHITE" to accept the bail.", ReturnPlayerName( playerid ), playerid, cash_format( equa ) ); SendClientMessageFormatted( pID, -1, ""COL_GREY"[SERVER]"COL_WHITE" %s(%d) has offered to bail you out for "COL_GOLD"%s"COL_WHITE". "COL_ORANGE"/acceptbail"COL_WHITE" to accept the bail.", ReturnPlayerName( playerid ), playerid, cash_format( equa ) );
} }
return 1; return 1;
} }
@ -46,7 +46,7 @@ CMD:bail( playerid, params[ ] )
CMD:acceptbail( playerid, params[ ] ) CMD:acceptbail( playerid, params[ ] )
{ {
new new
equa = BAIL_DOLLARS_PER_SECOND * p_JailTime[ playerid ]; equa = floatround( float( BAIL_DOLLARS_PER_SECOND * p_JailTime[ playerid ] ) * ( 1.0 - GetPlayerLevel( playerid, E_POLICE ) / 125.0 ) );
if ( p_JailTime[ playerid ] >= ALCATRAZ_TIME_WANTED ) if ( p_JailTime[ playerid ] >= ALCATRAZ_TIME_WANTED )
equa *= 2; equa *= 2;
@ -61,7 +61,7 @@ CMD:acceptbail( playerid, params[ ] )
new new
cashEarned = floatround( equa * 0.70 ); cashEarned = floatround( equa * 0.70 );
GivePlayerCash( playerid, -equa ); GivePlayerCash( playerid, -equa );
GivePlayerCash( p_BailOfferer[ playerid ], cashEarned ); GivePlayerCash( p_BailOfferer[ playerid ], cashEarned );
StockMarket_UpdateEarnings( E_STOCK_GOVERNMENT, cashEarned, 0.1 ); StockMarket_UpdateEarnings( E_STOCK_GOVERNMENT, cashEarned, 0.1 );
SendClientMessageFormatted( p_BailOfferer[ playerid ], -1, ""COL_GREEN"[BAIL]"COL_WHITE" %s(%d) has paid bail. You have earned "COL_GOLD"%s"COL_WHITE" from his bail.", ReturnPlayerName( playerid ), playerid, cash_format( cashEarned ) ); SendClientMessageFormatted( p_BailOfferer[ playerid ], -1, ""COL_GREEN"[BAIL]"COL_WHITE" %s(%d) has paid bail. You have earned "COL_GOLD"%s"COL_WHITE" from his bail.", ReturnPlayerName( playerid ), playerid, cash_format( cashEarned ) );

View File

@ -11,7 +11,7 @@
/* ** Definitions ** */ /* ** Definitions ** */
#define MAX_FIRES ( 10 ) #define MAX_FIRES ( 10 )
#define FIRE_EXTINGUISH_PAYOUT ( 4000 ) #define FIRE_EXTINGUISH_PAYOUT ( 5000 )
/* ** Variables ** */ /* ** Variables ** */
enum E_FIRE_DATA enum E_FIRE_DATA
@ -85,13 +85,13 @@ hook OnPlayerUpdateEx( playerid )
if ( g_fireData[ i ] [ E_HEALTH ] <= 0.0 ) if ( g_fireData[ i ] [ E_HEALTH ] <= 0.0 )
{ {
new new min_money_earned = floatround( float( FIRE_EXTINGUISH_PAYOUT ) * 0.75 );
money_earned = RandomEx( FIRE_EXTINGUISH_PAYOUT / 2, FIRE_EXTINGUISH_PAYOUT ); new money_earned = RandomEx( min_money_earned, FIRE_EXTINGUISH_PAYOUT );
ach_HandleExtinguishedFires( playerid ); ach_HandleExtinguishedFires( playerid );
SendClientMessageToAllFormatted( -1, "{A83434}[FIREMAN]"COL_WHITE" %s(%d) has earned "COL_GOLD"%s"COL_WHITE" for extinguishing a house fire.", ReturnPlayerName( playerid ), playerid, cash_format( money_earned ) ); SendClientMessageToAllFormatted( -1, "{A83434}[FIREMAN]"COL_WHITE" %s(%d) has earned "COL_GOLD"%s"COL_WHITE" for extinguishing a house fire.", ReturnPlayerName( playerid ), playerid, cash_format( money_earned ) );
GivePlayerScore( playerid, 2 ); GivePlayerScore( playerid, 2 );
//GivePlayerExperience( playerid, E_FIREMAN ); GivePlayerExperience( playerid, E_ROLEPLAY, 0.5 );
GivePlayerCash( playerid, money_earned ); GivePlayerCash( playerid, money_earned );
StockMarket_UpdateEarnings( E_STOCK_GOVERNMENT, money_earned, 0.15 ); StockMarket_UpdateEarnings( E_STOCK_GOVERNMENT, money_earned, 0.15 );
HouseFire_Remove( i ); HouseFire_Remove( i );
@ -117,6 +117,10 @@ hook OnServerUpdate( )
hook OnServerGameDayEnd( ) hook OnServerGameDayEnd( )
{ {
for ( new fireid = 0; fireid < MAX_FIRES; fireid ++ )
{
HouseFire_Remove( fireid );
}
HouseFire_Create( ); HouseFire_Create( );
return 1; return 1;
} }

View File

@ -649,6 +649,7 @@ thread OnPlayerGangLoaded( playerid )
thread OnGangAdded( gangid ) thread OnGangAdded( gangid )
{ {
g_gangData[ gangid ] [ E_SQL_ID ] = cache_insert_id( ); g_gangData[ gangid ] [ E_SQL_ID ] = cache_insert_id( );
mysql_single_query( sprintf( "UPDATE `USERS` SET `GANG_ID`=%d WHERE `ID`=%d", g_gangData[ gangid ] [ E_SQL_ID ], g_gangData[ gangid ][ E_LEADER ] ) );
return 1; return 1;
} }
@ -770,6 +771,10 @@ thread OnGangKickOffline( playerid, gangid )
mysql_single_query( sprintf( "DELETE FROM `GANG_COLEADERS` WHERE `USER_ID`=%d", player_accid ) ); mysql_single_query( sprintf( "DELETE FROM `GANG_COLEADERS` WHERE `USER_ID`=%d", player_accid ) );
mysql_single_query( sprintf( "UPDATE `USERS` SET `GANG_ID`=-1 WHERE `ID`=%d", player_accid ) ); mysql_single_query( sprintf( "UPDATE `USERS` SET `GANG_ID`=-1 WHERE `ID`=%d", player_accid ) );
for ( new i = 0; i < MAX_COLEADERS; i++ ) if ( g_gangData[ gangid ] [ E_COLEADER ] [ i ] == player_accid ) {
g_gangData[ gangid ] [ E_COLEADER ] [ i ] = 0;
}
SendClientMessageToGang( static_gangid, g_gangData[ static_gangid ] [ E_COLOR ], "[GANG]{FFFFFF} %s has left the gang (KICKED)", player_name ); SendClientMessageToGang( static_gangid, g_gangData[ static_gangid ] [ E_COLOR ], "[GANG]{FFFFFF} %s has left the gang (KICKED)", player_name );
} }
else else

File diff suppressed because it is too large Load Diff

View File

@ -171,7 +171,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
//SendServerMessage( playerid, "You've made "COL_GOLD"%s"COL_WHITE" from exporting. Go and pick another box up!" ); //SendServerMessage( playerid, "You've made "COL_GOLD"%s"COL_WHITE" from exporting. Go and pick another box up!" );
GivePlayerCash( playerid, cash ); GivePlayerCash( playerid, cash );
GivePlayerScore( playerid, 5 ); GivePlayerScore( playerid, 5 );
GivePlayerExperience( playerid, E_ROLEPLAY ); GivePlayerExperience( playerid, E_ROLEPLAY, 1.0 + fDistance / 1000.0 );
DestroyDynamicMapIcon( p_LumberjackMapIcon[ playerid ] ); DestroyDynamicMapIcon( p_LumberjackMapIcon[ playerid ] );
p_LumberjackMapIcon[ playerid ] = CreateDynamicMapIconEx( -2330.8535, -113.9084, 34.00, 51, 0, MAPICON_GLOBAL, 6000.0, { -1 }, { -1 }, aPlayer ); p_LumberjackMapIcon[ playerid ] = CreateDynamicMapIconEx( -2330.8535, -113.9084, 34.00, 51, 0, MAPICON_GLOBAL, 6000.0, { -1 }, { -1 }, aPlayer );
@ -243,6 +243,7 @@ CMD:wood( playerid, params[ ] )
g_treeData[ i ] [ E_CHOPPED ] = true; g_treeData[ i ] [ E_CHOPPED ] = true;
count++; count++;
GivePlayerCash( playerid, 250 ); GivePlayerCash( playerid, 250 );
GivePlayerExperience( playerid, E_ROLEPLAY, 0.4 );
SendServerMessage( playerid, "Tree successfully chopped into smaller pieces. Go to the wood chipper and type "COL_ORANGE"/wood chip{FFFFFF}!" ); SendServerMessage( playerid, "Tree successfully chopped into smaller pieces. Go to the wood chipper and type "COL_ORANGE"/wood chip{FFFFFF}!" );
break; break;
} }

View File

@ -304,6 +304,7 @@ public OnMethamphetamineCooking( playerid, vehicleid, last_chemical )
ShowPlayerHelpDialog( playerid, 5000, "The process is done. Bag it up and do another round if you wish." ); ShowPlayerHelpDialog( playerid, 5000, "The process is done. Bag it up and do another round if you wish." );
SendServerMessage( playerid, "Process is done. Bag it up, and do another round if you wish. Export it for money." ); SendServerMessage( playerid, "Process is done. Bag it up, and do another round if you wish. Export it for money." );
GivePlayerWantedLevel( playerid, 12 ); GivePlayerWantedLevel( playerid, 12 );
GivePlayerExperience( playerid, E_ROLEPLAY );
GivePlayerScore( playerid, 3 ); GivePlayerScore( playerid, 3 );
ach_HandleMethYielded( playerid ); ach_HandleMethYielded( playerid );
SetGVarInt( "meth_yield", CreateDynamicObject( 1579, 2083.684082, 1233.945922, 414.875244, 0.000000, 0.000000, 90.000000, GetPlayerVirtualWorld( playerid ) ), vehicleid ); SetGVarInt( "meth_yield", CreateDynamicObject( 1579, 2083.684082, 1233.945922, 414.875244, 0.000000, 0.000000, 90.000000, GetPlayerVirtualWorld( playerid ) ), vehicleid );
@ -415,6 +416,7 @@ CMD:meth( playerid, params[ ] )
cashEarned = p_Methamphetamine{ playerid } * ( 5000 + random( 1000 ) ); cashEarned = p_Methamphetamine{ playerid } * ( 5000 + random( 1000 ) );
GivePlayerCash( playerid, cashEarned ); GivePlayerCash( playerid, cashEarned );
GivePlayerExperience( playerid, E_ROLEPLAY, float( p_Methamphetamine{ playerid } ) * 0.2 );
StockMarket_UpdateEarnings( E_STOCK_CLUCKIN_BELL, cashEarned, .factor = 0.3 ); StockMarket_UpdateEarnings( E_STOCK_CLUCKIN_BELL, cashEarned, .factor = 0.3 );
SendServerMessage( playerid, "You have exported %d bags of meth, earning you "COL_GOLD"%s"COL_WHITE".", p_Methamphetamine{ playerid }, cash_format( cashEarned ) ); SendServerMessage( playerid, "You have exported %d bags of meth, earning you "COL_GOLD"%s"COL_WHITE".", p_Methamphetamine{ playerid }, cash_format( cashEarned ) );
p_Methamphetamine{ playerid } = 0; p_Methamphetamine{ playerid } = 0;
@ -544,7 +546,7 @@ stock RemovePlayersFromJourney( vehicleID )
SetPlayerPos( playerid, x, y, z ); SetPlayerPos( playerid, x, y, z );
SetPlayerInterior( playerid, 0 ); SetPlayerInterior( playerid, 0 );
SetPlayerVirtualWorld( playerid, 0 ); SetPlayerVirtualWorld( playerid, 0 );
SendServerMessage( playerid, "You have been removed from a player-owned Journey as the player who owned it has left the server." ); SendServerMessage( playerid, "You have been removed from a player-owned Journey as the player who owned it has left the server." );
} }
} }

View File

@ -185,7 +185,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
GivePlayerScore( playerid, 1 + floatround( p_PilotDistance[ playerid ] / 1000.0 ) ); GivePlayerScore( playerid, 1 + floatround( p_PilotDistance[ playerid ] / 1000.0 ) );
StockMarket_UpdateEarnings( E_STOCK_AVIATION, cash_earned, stock_dividend_allocation ); StockMarket_UpdateEarnings( E_STOCK_AVIATION, cash_earned, stock_dividend_allocation );
GivePlayerCash( playerid, cash_earned ); GivePlayerCash( playerid, cash_earned );
GivePlayerExperience( playerid, E_ROLEPLAY ); GivePlayerExperience( playerid, E_ROLEPLAY, 1.0 + p_PilotDistance[ playerid ] / 1000.0 );
ShowPlayerHelpDialog( playerid, 5000, "You have earned ~y~%s ~w~for exporting %s!", cash_format( cash_earned ), g_CargoName[ p_PilotCargo[ playerid ] ] ); ShowPlayerHelpDialog( playerid, 5000, "You have earned ~y~%s ~w~for exporting %s!", cash_format( cash_earned ), g_CargoName[ p_PilotCargo[ playerid ] ] );
StopPlayerPilotWork( playerid ); StopPlayerPilotWork( playerid );

View File

@ -134,7 +134,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
GivePlayerScore( playerid, 1 + floatround( p_TrainDistance[ playerid ] / 1000.0 ) ); GivePlayerScore( playerid, 1 + floatround( p_TrainDistance[ playerid ] / 1000.0 ) );
GivePlayerCash( playerid, iCashEarned ); GivePlayerCash( playerid, iCashEarned );
GivePlayerExperience( playerid, E_ROLEPLAY ); GivePlayerExperience( playerid, E_ROLEPLAY, 1.0 + p_TrainDistance[ playerid ] / 1000.0 );
ach_HandleTrainMissions( playerid ); ach_HandleTrainMissions( playerid );

View File

@ -181,7 +181,7 @@ hook OnPlayerEnterDynRaceCP( playerid, checkpointid )
GivePlayerScore( playerid, 1 + floatround( p_TruckingDistance[ playerid ] / 1000.0 ) ); GivePlayerScore( playerid, 1 + floatround( p_TruckingDistance[ playerid ] / 1000.0 ) );
StockMarket_UpdateEarnings( E_STOCK_TRUCKING_COMPANY, iCashEarned, .factor = 1.0 ); StockMarket_UpdateEarnings( E_STOCK_TRUCKING_COMPANY, iCashEarned, .factor = 1.0 );
GivePlayerCash( playerid, iCashEarned ); GivePlayerCash( playerid, iCashEarned );
GivePlayerExperience( playerid, E_ROLEPLAY ); GivePlayerExperience( playerid, E_ROLEPLAY, 1.0 + p_TruckingDistance[ playerid ] / 1000.0 );
p_TruckingDistance [ playerid ] = 0.0; p_TruckingDistance [ playerid ] = 0.0;
p_hasTruckingJob { playerid } = false; p_hasTruckingJob { playerid } = false;

View File

@ -24,7 +24,8 @@ enum E_SHOP_ITEMS
SHOP_ITEM_DRILL, SHOP_ITEM_DRILL,
SHOP_ITEM_METAL_MELTER, SHOP_ITEM_METAL_MELTER,
SHOP_ITEM_WEED_SEED, SHOP_ITEM_WEED_SEED,
SHOP_ITEM_FIREWORKS SHOP_ITEM_FIREWORKS,
SHOP_ITEM_BOOMBOX
} }
enum E_SHOP_DATA enum E_SHOP_DATA
@ -49,7 +50,8 @@ new
{ SHOP_ITEM_MONEY_CASE, false, "Money Case", "Increases robbing amount", 1, 4500 }, // [1250] { SHOP_ITEM_MONEY_CASE, false, "Money Case", "Increases robbing amount", 1, 4500 }, // [1250]
{ SHOP_ITEM_DRILL, true , "Thermal Drill", "Halves safe cracking time", 1, 5000 }, { SHOP_ITEM_DRILL, true , "Thermal Drill", "Halves safe cracking time", 1, 5000 },
{ SHOP_ITEM_METAL_MELTER, true , "Metal Melter", "/breakout", 4, 7500 }, { SHOP_ITEM_METAL_MELTER, true , "Metal Melter", "/breakout", 4, 7500 },
{ SHOP_ITEM_FIREWORKS, true , "Firework", "/fireworks", 0, 50000 } { SHOP_ITEM_FIREWORKS, true , "Firework", "/fireworks", 0, 50000 },
{ SHOP_ITEM_BOOMBOX, false, "Boombox", "/boombox", 1, 15000 }
}, },
g_playerShopItems [ MAX_PLAYERS ] [ E_SHOP_ITEMS ] // gradually move to this g_playerShopItems [ MAX_PLAYERS ] [ E_SHOP_ITEMS ] // gradually move to this
; ;
@ -102,6 +104,11 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{ {
GivePlayerFireworks( playerid, 1 ); GivePlayerFireworks( playerid, 1 );
} }
case SHOP_ITEM_BOOMBOX:
{
if ( GetPlayerBoombox( playerid ) ) return SendError( playerid, "You have already purchased this item." );
SetPlayerBoombox( playerid, true );
}
} }
GivePlayerCash( playerid, -( g_shopItemData[ listitem ] [ E_PRICE ] ) ); GivePlayerCash( playerid, -( g_shopItemData[ listitem ] [ E_PRICE ] ) );
SendServerMessage( playerid, "You have bought a "COL_GREY"%s"COL_WHITE" for "COL_GOLD"%s"COL_WHITE".", g_shopItemData[ listitem ] [ E_NAME ], cash_format( g_shopItemData[ listitem ] [ E_PRICE ] ) ); SendServerMessage( playerid, "You have bought a "COL_GREY"%s"COL_WHITE" for "COL_GOLD"%s"COL_WHITE".", g_shopItemData[ listitem ] [ E_NAME ], cash_format( g_shopItemData[ listitem ] [ E_PRICE ] ) );
@ -191,6 +198,7 @@ stock GetShopItemAmount( playerid, id )
case SHOP_ITEM_METAL_MELTER: return p_MetalMelter[ playerid ]; case SHOP_ITEM_METAL_MELTER: return p_MetalMelter[ playerid ];
case SHOP_ITEM_WEED_SEED: return g_playerShopItems[ playerid ] [ SHOP_ITEM_WEED_SEED ]; case SHOP_ITEM_WEED_SEED: return g_playerShopItems[ playerid ] [ SHOP_ITEM_WEED_SEED ];
case SHOP_ITEM_FIREWORKS: return p_Fireworks[ playerid ]; case SHOP_ITEM_FIREWORKS: return p_Fireworks[ playerid ];
case SHOP_ITEM_BOOMBOX: return GetPlayerBoombox( playerid );
} }
return 0; return 0;
} }
@ -213,6 +221,7 @@ stock SetPlayerShopItemAmount( playerid, id, value )
case SHOP_ITEM_METAL_MELTER: p_MetalMelter[ playerid ] = value; case SHOP_ITEM_METAL_MELTER: p_MetalMelter[ playerid ] = value;
case SHOP_ITEM_WEED_SEED: g_playerShopItems[ playerid ] [ SHOP_ITEM_WEED_SEED ] = value; case SHOP_ITEM_WEED_SEED: g_playerShopItems[ playerid ] [ SHOP_ITEM_WEED_SEED ] = value;
case SHOP_ITEM_FIREWORKS: p_Fireworks[ playerid ] = value; case SHOP_ITEM_FIREWORKS: p_Fireworks[ playerid ] = value;
case SHOP_ITEM_BOOMBOX: SetPlayerBoombox( playerid, !!value );
} }
return 1; 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" 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 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" 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 g_randomMessageTick = 0
; ;

View File

@ -113,7 +113,7 @@ hook OnScriptInit( )
CreateMultipleRobberies( "Church", ROBBERY_SAFE_PAY, 2390.926757, 3195.784179, 1016.920837, -90.00000, 39, 40, 41, 62, 24 ); CreateMultipleRobberies( "Church", ROBBERY_SAFE_PAY, 2390.926757, 3195.784179, 1016.920837, -90.00000, 39, 40, 41, 62, 24 );
CreateRobberyNPC( "Priest", ROBBERY_BOT_PAY, 2383.1968,3193.2842,1017.7320,1.0113, 68, 39, 40, 41, 62, 24 ); CreateRobberyNPC( "Priest", ROBBERY_BOT_PAY, 2383.1968,3193.2842,1017.7320,1.0113, 68, 39, 40, 41, 62, 24 );
CreateMultipleRobberies( "Hotel de Solanum", ROBBERY_SAFE_PAY, -1967.766357, 1367.773925, 6.879500000, 86.700000, 0 ); CreateMultipleRobberies( "Hotel da Novic", ROBBERY_SAFE_PAY, -1967.766357, 1367.773925, 6.879500000, 86.700000, 0 );
CreateRobberyNPC( "Hotel Bartender", ROBBERY_BOT_PAY, -1944.5562,1362.2947,7.3546,86.4801, 126, 0 ); CreateRobberyNPC( "Hotel Bartender", ROBBERY_BOT_PAY, -1944.5562,1362.2947,7.3546,86.4801, 126, 0 );
CreateMultipleRobberies( "Vehicle Dealership", ROBBERY_SAFE_PAY, -1862.799682, -652.836608, 1001.578125, -89.80000, 0 ); CreateMultipleRobberies( "Vehicle Dealership", ROBBERY_SAFE_PAY, -1862.799682, -652.836608, 1001.578125, -89.80000, 0 );

View File

@ -172,7 +172,7 @@ hook OnProgressCompleted( playerid, progressid, params )
Get2DCity( szCity, g_entranceData[ id ] [ E_EX ], g_entranceData[ id ] [ E_EY ], g_entranceData[ id ] [ E_EZ ] ); Get2DCity( szCity, g_entranceData[ id ] [ E_EX ], g_entranceData[ id ] [ E_EY ], g_entranceData[ id ] [ E_EZ ] );
GetZoneFromCoordinates( szLocation, g_entranceData[ id ] [ E_EX ], g_entranceData[ id ] [ E_EY ], g_entranceData[ id ] [ E_EZ ] ); GetZoneFromCoordinates( szLocation, g_entranceData[ id ] [ E_EX ], g_entranceData[ id ] [ E_EY ], g_entranceData[ id ] [ E_EZ ] );
if ( !strmatch( szCity, "San Fierro" ) && !strmatch( szCity, "Las Venturas" ) && !strmatch( szCity, "Los Santos" ) ) g_robberyData[ robberyid ] [ E_SAFE_LOOT ] /= 2; // Halve Profit outside SF, LV & LS if ( !strmatch( szCity, "San Fierro" ) && !strmatch( szCity, "Las Venturas" ) && !strmatch( szCity, "Los Santos" ) ) g_robberyData[ robberyid ] [ E_SAFE_LOOT ] /= 2; // Halve Profit outside SF, LV & LS
//if ( strmatch( szCity, "Las Venturas" ) || strmatch( szCity, "Los Santos" ) ) g_robberyData[ robberyid ] [ E_SAFE_LOOT ] = floatround( g_robberyData[ robberyid ] [ E_SAFE_LOOT ] * 0.75 ); // Remove 25% if ( strmatch( szCity, "Las Venturas" ) || strmatch( szCity, "Los Santos" ) ) g_robberyData[ robberyid ] [ E_SAFE_LOOT ] = floatround( g_robberyData[ robberyid ] [ E_SAFE_LOOT ] * 0.5 ); // Remove 50%
SendGlobalMessage( COLOR_GOLD, "[ROBBERY]"COL_WHITE" %s(%d) has robbed "COL_GOLD"%s"COL_WHITE" from %s near %s in %s!", ReturnPlayerName( playerid ), playerid, cash_format( g_robberyData[ robberyid ] [ E_SAFE_LOOT ] ), g_robberyData[ robberyid ] [ E_NAME ], szLocation, szCity ); SendGlobalMessage( COLOR_GOLD, "[ROBBERY]"COL_WHITE" %s(%d) has robbed "COL_GOLD"%s"COL_WHITE" from %s near %s in %s!", ReturnPlayerName( playerid ), playerid, cash_format( g_robberyData[ robberyid ] [ E_SAFE_LOOT ] ), g_robberyData[ robberyid ] [ E_NAME ], szLocation, szCity );
} }
else if ( p_InBusiness[ playerid ] != -1 ) else if ( p_InBusiness[ playerid ] != -1 )
@ -538,6 +538,10 @@ stock createRobberyLootInstance( playerid, robberyid, type )
random_chance = 100.0; random_chance = 100.0;
} }
if ( GetPlayerLevel( playerid, E_POLICE ) >= 50.0 ) {
random_chance = 100.0;
}
// level increase chance of success // level increase chance of success
random_chance += GetPlayerLevel( playerid, E_ROBBERY ) * 0.2; // increase success rate by 0.2% per level random_chance += GetPlayerLevel( playerid, E_ROBBERY ) * 0.2; // increase success rate by 0.2% per level

View File

@ -571,3 +571,7 @@ stock GetGaragePos( garageid, &Float: X, &Float: Y, &Float: Z ) {
Y = g_garageData[ garageid ] [ E_Y ]; Y = g_garageData[ garageid ] [ E_Y ];
Z = g_garageData[ garageid ] [ E_Z ]; Z = g_garageData[ garageid ] [ E_Z ];
} }
stock IsPlayerInGarage( playerid ) {
return p_InGarage[ playerid ] != -1;
}

View File

@ -25,7 +25,36 @@ enum E_CAR_DATA
new new
g_vehicleData [ MAX_PLAYERS ] [ MAX_BUYABLE_VEHICLES ] [ E_CAR_DATA ], g_vehicleData [ MAX_PLAYERS ] [ MAX_BUYABLE_VEHICLES ] [ E_CAR_DATA ],
bool: g_buyableVehicle [ MAX_VEHICLES char ], 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 ** */ /* ** Hooks ** */
@ -537,6 +566,26 @@ CMD:v( playerid, params[ ] )
return 1; 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 ** */ /* ** SQL Threads ** */
thread OnVehicleLoad( playerid ) 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 ] ); if ( g_vehicleData[ playerid ][ v ][ E_MODEL ] == 508 ) RemovePlayersFromJourney( g_vehicleData[ playerid ][ v ][ E_VEHICLE_ID ] );
DestroyBuyableVehicle( playerid, v, .db_remove = false ); DestroyBuyableVehicle( playerid, v, .db_remove = false );
} }
} }
return 1; return 1;
} }

View File

@ -1,6 +1,6 @@
/* /*
* Irresistible Gaming (c) 2018 * Irresistible Gaming (c) 2018
* Developed by Lorenc * Developed by Lorenc, Cloudy
* Module: cnr\features\vehicles\vehicle_modifications.pwn * Module: cnr\features\vehicles\vehicle_modifications.pwn
* Purpose: custom vehicle components (objects) for player vehicles * Purpose: custom vehicle components (objects) for player vehicles
*/ */
@ -30,6 +30,16 @@
#define PREVIEW_MODEL_COMPONENT ( 10 ) // some random number #define PREVIEW_MODEL_COMPONENT ( 10 ) // some random number
#define COMPONENT_EDIT_TYPE_X 0
#define COMPONENT_EDIT_TYPE_Y 1
#define COMPONENT_EDIT_TYPE_Z 2
#define COMPONENT_EDIT_TYPE_RX 3
#define COMPONENT_EDIT_TYPE_RY 4
#define COMPONENT_EDIT_TYPE_RZ 5
#define TIMER_UPDATE_RATE 50
#define MAX_COMPONENT_OFFSET 3.0
enum E_CAR_MODS enum E_CAR_MODS
{ {
E_CATEGORY, E_LIMIT, E_MODEL_ID, E_CATEGORY, E_LIMIT, E_MODEL_ID,
@ -227,102 +237,10 @@ new
g_vehiclePimpData[ MAX_PLAYERS ] [ MAX_BUYABLE_VEHICLES ] [ E_PIMP_DATA ] g_vehiclePimpData[ MAX_PLAYERS ] [ MAX_BUYABLE_VEHICLES ] [ E_PIMP_DATA ]
; ;
/* ** Forwards ** */
forward OnUpdateVehicleComponents( playerid );
/* ** Hooks ** */ /* ** Hooks ** */
hook OnPlayerEditDynObject( playerid, objectid, response, Float: x, Float: y, Float: z, Float: rx, Float: ry, Float: rz )
{
if ( GetPVarType( playerid, "components_editing" ) != 0 )
{
new
ownerid = INVALID_PLAYER_ID,
vehicleid = GetPlayerVehicleID( playerid ),
slotid = GetPVarInt( playerid, "components_editing" ),
v = getVehicleSlotFromID( vehicleid, ownerid )
;
if ( v == -1 )
return CancelEdit( playerid ), SendError( playerid, "You need to be in a buyable vehicle." );
if ( playerid != ownerid )
return CancelEdit( playerid ), SendError( playerid, "This vehicle does not belong to you." );
if ( !g_vehiclePimpData[ ownerid ] [ v ] [ E_CREATED ] [ slotid ] )
return CancelEdit( playerid ), SendError( playerid, "Internal Server Error (0x1C)." );
if ( g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ] != objectid )
return CancelEdit( playerid ), SendError( playerid, "Internal Server Error (0x2D)." );
static
Float: X, Float: Y, Float:Z, Float: Angle;
if ( response == EDIT_RESPONSE_FINAL )
{
// Grab positions prior
GetVehicleZAngle( vehicleid, Angle );
GetVehiclePos( vehicleid, X, Y, Z );
// Calculate offsets
new
Float: fDistance = VectorSize( x - X, y - Y, 0.0 ),
Float: fAngle = Angle - atan2( y - Y, x - X ),
Float: finalX = fDistance * floatcos( fAngle, degrees ),
Float: finalY = fDistance * floatsin( -fAngle, degrees ),
Float: finalZ = z - Z
;
// Get model size
GetVehicleModelInfo( GetVehicleModel( vehicleid ), VEHICLE_MODEL_INFO_SIZE, X, Y, Z );
// Half because we're using pretty much the radius, not circumference (way to look at it)
X /= 2.0, Y /= 2.0;
if ( floatabs( finalX ) > X + 0.35 ) {
SendServerMessage( playerid, "The object breaches the X axis limit for this vehicle (%0.1f). It has been moved.", ( finalX = X + 0.35 ) );
}
if ( floatabs( finalY ) > Y + 0.35 ) {
SendServerMessage( playerid, "The object breaches the Y axis limit for this vehicle (%0.1f). It has been moved.", ( finalY = Y + 0.35 ) );
}
if ( floatabs( finalZ ) > Z + 0.35 ) {
SendServerMessage( playerid, "The object breaches the Z axis limit for this vehicle (%0.1f). It has been moved.", ( finalZ = Z + 0.35 ) );
}
// Readjust variables
g_vehiclePimpData[ ownerid ] [ v ] [ E_X ] [ slotid ] = finalX;
g_vehiclePimpData[ ownerid ] [ v ] [ E_Y ] [ slotid ] = finalY;
g_vehiclePimpData[ ownerid ] [ v ] [ E_Z ] [ slotid ] = finalZ;
g_vehiclePimpData[ ownerid ] [ v ] [ E_RX ] [ slotid ] = rx;
g_vehiclePimpData[ ownerid ] [ v ] [ E_RY ] [ slotid ] = ry;
g_vehiclePimpData[ ownerid ] [ v ] [ E_RZ ] [ slotid ] = rz - Angle;
format( szNormalString, sizeof( szNormalString ), "UPDATE `COMPONENTS` SET `X`=%f,`Y`=%f,`Z`=%f,`RX`=%f,`RY`=%f,`RZ`=%f WHERE `ID`=%d", finalX, finalY, finalZ, rx, ry, rz - Angle, g_vehiclePimpData[ ownerid ] [ v ] [ E_SQL_ID ] [ slotid ] );
mysql_single_query( szNormalString );
//DestroyDynamicObject( g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ] );
//g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ] = CreateDynamicObject( g_vehiclePimpData[ ownerid ] [ v ] [ E_MODEL ] [ slotid ], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 );
AttachDynamicObjectToVehicle( g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ], vehicleid, finalX, finalY, finalZ, rx, ry, rz - Angle );
GetVehiclePos( vehicleid, X, Y, Z );
return SetVehiclePos( vehicleid, X, Y, Z + 0.05 );
}
else if ( response == EDIT_RESPONSE_CANCEL )
{
//DestroyDynamicObject( g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ] );
//g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ] = CreateDynamicObject( g_vehiclePimpData[ ownerid ] [ v ] [ E_MODEL ] [ slotid ], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 );
AttachDynamicObjectToVehicle( g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ], vehicleid,
g_vehiclePimpData[ ownerid ] [ v ] [ E_X ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_Y ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_Z ] [ slotid ],
g_vehiclePimpData[ ownerid ] [ v ] [ E_RX ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_RY ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_RZ ] [ slotid ] );
// Sync new position
if ( GetVehiclePos( vehicleid, X, Y, Z ) ) {
SetVehiclePos( vehicleid, X, Y, Z + 0.05 );
}
}
return Y_HOOKS_BREAK_RETURN_1;
}
return 1;
}
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{ {
if ( ( dialogid == DIALOG_COMPONENTS_CATEGORY ) && response ) { if ( ( dialogid == DIALOG_COMPONENTS_CATEGORY ) && response ) {
@ -515,30 +433,35 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
} }
case 1: // Edit case 1: // Edit
{ {
new if ( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_DISABLED ] [ i ] )
Float: X, Float: Y, Float: Z, Float: Angle; {
SendError( playerid, "This component is disabled, enable it first." );
return ShowPlayerVehicleComponentMenu( playerid, ownerid, vehicleid, i );
}
GetVehiclePos( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], X, Y, Z ); SetPVarFloat( playerid, "component_pos_x", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_X ] [ i ] );
GetVehicleZAngle( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], Angle ); SetPVarFloat( playerid, "component_pos_y", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_Y ] [ i ] );
DestroyDynamicObject( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ i ] ); SetPVarFloat( playerid, "component_pos_z", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_Z ] [ i ] );
SetPVarFloat( playerid, "component_rot_x", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RX ] [ i ] );
SetPVarFloat( playerid, "component_rot_y", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RY ] [ i ] );
SetPVarFloat( playerid, "component_rot_z", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RZ ] [ i ] );
// printf("Destroyed %d", g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ i ] ); ShowPlayerHelpDialog(
playerid, 0,
"~g~A or D -~w~ Move object~n~"\
"~g~/px - ~w~X axis~n~\
~g~/py - ~w~Y axis~n~\
~g~/pz - ~w~Z axis~n~\
~g~/rx - ~w~X rotation~n~\
~g~/ry - ~w~Y rotation~n~\
~g~/rz - ~w~Z rotation~n~\
~g~Press Y - ~w~Save~n~\
~g~Press N - ~w~Cancel~n~\
~g~Hold SPACE - ~w~Faster edit"
);
X += g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_X ] [ i ]; SendClientMessage( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You have started editing the component." );
Y += g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_Y ] [ i ]; SetTimerEx( "OnUpdateVehicleComponents", TIMER_UPDATE_RATE, false, "d", playerid );
Z += g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_Z ] [ i ];
new
iObject = CreateDynamicObject( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_MODEL ] [ i ], X, Y, Z, g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RX ] [ i ], g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RY ] [ i ], g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RZ ] [ i ] - Angle, .worldid = GetVehicleVirtualWorld( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ] ) );
// printf("%d = CreateDynamicObject( %d, %f, %f, %f, %f, %f, %f )", iObject, g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_MODEL ] [ i ], X, Y, Z, g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RX ] [ i ], g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RY ] [ i ], g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_RZ ] [ i ] - Angle );
if ( ( g_vehiclePimpData[ ownerid ] [ vehicleid ] [ E_OBJECT ] [ i ] = iObject ) ) {
GetVehiclePos( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], X, Y, Z );
SetVehiclePos( g_vehicleData[ ownerid ] [ vehicleid ] [ E_VEHICLE_ID ], X, Y, Z + 0.05 );
EditDynamicObject( playerid, iObject );
}
} }
case 2: // sell case 2: // sell
{ {
@ -667,7 +590,151 @@ thread OnPlayerCreateVehicleComponent( playerid, vehicleid, slotid )
return 1; return 1;
} }
/* ** Callbacks ** */
public OnUpdateVehicleComponents( playerid )
{
// just incase, to avoid bugs
if ( ! IsPlayerEditingVehicle( playerid ) || ! IsPlayerInGarage( playerid ) )
return EndPlayerEditComponent( playerid );
new
ownerid = INVALID_PLAYER_ID,
vehicleid = GetPlayerVehicleID( playerid ),
slotid = GetPVarInt( playerid, "components_editing" ),
v = getVehicleSlotFromID( vehicleid, ownerid )
;
if ( v == -1 || playerid != ownerid || ! g_vehiclePimpData[ ownerid ] [ v ] [ E_CREATED ] [ slotid ] || g_vehiclePimpData[ ownerid ] [ v ] [ E_DISABLED ] [ slotid ] )
return SendServerMessage( playerid, "Vehicle component editing was cancelled." ), EndPlayerEditComponent( playerid );
new
LR, KEYS, Float: VALUE = -1.0;
GetPlayerKeys( playerid, KEYS, tmpVariable, LR );
if ( KEYS & KEY_YES )
{
SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You have saved the component you were editing." );
return EndPlayerEditComponent( ownerid, v, slotid, true );
}
else if ( KEYS & KEY_NO )
{
SendClientMessage( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You have cancelled editing the component." );
return EndPlayerEditComponent( ownerid, v, slotid );
}
if ( LR > 0 )
VALUE = 0.01;
else if ( LR < 0 )
VALUE = -0.01;
if ( VALUE != -1.0 )
{
// hold space to edit components faster
if ( KEYS & KEY_HANDBRAKE )
VALUE *= 3;
new Float: tmpPosX = GetPVarFloat( playerid, "component_pos_x" );
new Float: tmpPosY = GetPVarFloat( playerid, "component_pos_y" );
new Float: tmpPosZ = GetPVarFloat( playerid, "component_pos_z" );
new Float: tmpRotX = GetPVarFloat( playerid, "component_rot_x" );
new Float: tmpRotY = GetPVarFloat( playerid, "component_rot_y" );
new Float: tmpRotZ = GetPVarFloat( playerid, "component_rot_z" );
switch( GetPVarInt( playerid, "component_edit_type" ) )
{
case COMPONENT_EDIT_TYPE_X:
SetPVarFloat( playerid, "component_pos_x", ( tmpPosX += VALUE ) );
case COMPONENT_EDIT_TYPE_Y:
SetPVarFloat( playerid, "component_pos_y", ( tmpPosY += VALUE ) );
case COMPONENT_EDIT_TYPE_Z:
SetPVarFloat( playerid, "component_pos_z", ( tmpPosZ += VALUE ) );
case COMPONENT_EDIT_TYPE_RX:
SetPVarFloat( playerid, "component_rot_x", ( tmpRotX += ( ( VALUE * 360 ) / 100 ) * 10 ) );
case COMPONENT_EDIT_TYPE_RY:
SetPVarFloat( playerid, "component_rot_y", ( tmpRotY += ( ( VALUE * 360 ) / 100 ) * 10 ) );
case COMPONENT_EDIT_TYPE_RZ:
SetPVarFloat( playerid, "component_rot_z", ( tmpRotZ += ( ( VALUE * 360 ) / 100 ) * 10 ) );
default:
return EndPlayerEditComponent( playerid, v, slotid );
}
// add movement limit of MAX_COMPONENT_OFFSET units
if ( tmpPosX > MAX_COMPONENT_OFFSET ) tmpPosX = MAX_COMPONENT_OFFSET;
else if ( tmpPosX < -MAX_COMPONENT_OFFSET ) tmpPosX = -MAX_COMPONENT_OFFSET;
if ( tmpPosY > MAX_COMPONENT_OFFSET ) tmpPosY = MAX_COMPONENT_OFFSET;
else if ( tmpPosY < -MAX_COMPONENT_OFFSET ) tmpPosY = -MAX_COMPONENT_OFFSET;
if ( tmpPosZ > MAX_COMPONENT_OFFSET ) tmpPosZ = MAX_COMPONENT_OFFSET;
else if ( tmpPosZ < -MAX_COMPONENT_OFFSET ) tmpPosZ = -MAX_COMPONENT_OFFSET;
// attach object to vehicle
AttachDynamicObjectToVehicle(
g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ], g_vehicleData[ ownerid ] [ v ] [ E_VEHICLE_ID ],
tmpPosX, tmpPosY, tmpPosZ,
tmpRotX, tmpRotY, tmpRotZ
);
}
return SetTimerEx( "OnUpdateVehicleComponents", TIMER_UPDATE_RATE, false, "d", playerid );
}
/* ** Functions ** */ /* ** Functions ** */
stock EndPlayerEditComponent( playerid, vehicleid = -1, slotid = -1, bool: save = false )
{
if ( save )
{
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RX ] [ slotid ] = GetPVarFloat( playerid, "component_rot_x" );
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RY ] [ slotid ] = GetPVarFloat( playerid, "component_rot_y" );
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RZ ] [ slotid ] = GetPVarFloat( playerid, "component_rot_z" );
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_X ] [ slotid ] = GetPVarFloat( playerid, "component_pos_x" );
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_Y ] [ slotid ] = GetPVarFloat( playerid, "component_pos_y" );
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_Z ] [ slotid ] = GetPVarFloat( playerid, "component_pos_z" );
format(
szNormalString, sizeof( szNormalString ),
"UPDATE `COMPONENTS` SET `X`=%f,`Y`=%f,`Z`=%f,`RX`=%f,`RY`=%f,`RZ`=%f WHERE `ID`=%d",
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_X ] [ slotid ], g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_Y ] [ slotid ], g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_Z ] [ slotid ],
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RX ] [ slotid ], g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RY ] [ slotid ], g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RZ ] [ slotid ],
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_SQL_ID ] [ slotid ]
);
mysql_single_query( szNormalString );
}
DeletePVar( playerid, "components_editing" );
DeletePVar( playerid, "component_edit_type" );
DeletePVar( playerid, "component_pos_x" );
DeletePVar( playerid, "component_pos_y" );
DeletePVar( playerid, "component_pos_z" );
DeletePVar( playerid, "component_rot_x" );
DeletePVar( playerid, "component_rot_y" );
DeletePVar( playerid, "component_rot_z" );
if ( vehicleid != -1 && slotid != -1 )
{
AttachDynamicObjectToVehicle(
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_OBJECT ] [ slotid ],
g_vehicleData[ playerid ] [ vehicleid ] [ E_VEHICLE_ID ],
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_X ] [ slotid ],
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_Y ] [ slotid ],
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_Z ] [ slotid ],
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RX ] [ slotid ],
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RY ] [ slotid ],
g_vehiclePimpData[ playerid ] [ vehicleid ] [ E_RZ ] [ slotid ]
);
}
HidePlayerHelpDialog( playerid );
return 1;
}
stock GetVehicleComponentSlot( playerid, vehicleid ) { stock GetVehicleComponentSlot( playerid, vehicleid ) {
for( new id = 0; id < MAX_PIMPS; id++ ) { for( new id = 0; id < MAX_PIMPS; id++ ) {
@ -715,8 +782,9 @@ stock ReplaceVehicleCustomComponents( ownerid, v, bool: recreate_obj = false ) {
g_vehiclePimpData[ ownerid ] [ v ] [ E_X ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_Y ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_Z ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_X ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_Y ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_Z ] [ slotid ],
g_vehiclePimpData[ ownerid ] [ v ] [ E_RX ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_RY ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_RZ ] [ slotid ] ); g_vehiclePimpData[ ownerid ] [ v ] [ E_RX ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_RY ] [ slotid ], g_vehiclePimpData[ ownerid ] [ v ] [ E_RZ ] [ slotid ] );
// Update virtual world // Update virtual world - There was an error appearing here, so make sure object is valid.
Streamer_SetIntData( STREAMER_TYPE_OBJECT, g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ], E_STREAMER_WORLD_ID, GetVehicleVirtualWorld( g_vehicleData[ ownerid ] [ v ] [ E_VEHICLE_ID ] ) ); if ( IsValidDynamicObject( g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ] ) )
Streamer_SetIntData( STREAMER_TYPE_OBJECT, g_vehiclePimpData[ ownerid ] [ v ] [ E_OBJECT ] [ slotid ], E_STREAMER_WORLD_ID, GetVehicleVirtualWorld( g_vehicleData[ ownerid ] [ v ] [ E_VEHICLE_ID ] ) );
} }
} }
@ -773,3 +841,56 @@ hook OnPlayerEndModelPreview( playerid, handleid )
} }
return 1; return 1;
} }
/* ** Commands ** */
CMD:px( playerid, params[ ] )
{
if ( ! IsPlayerEditingVehicle( playerid ) ) return SendError( playerid, "You're not editing a vehicle." );
SetPVarInt( playerid, "component_edit_type", COMPONENT_EDIT_TYPE_X );
return SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You're now editing the X axis of the component." );
}
CMD:py( playerid, params[ ] )
{
if ( ! IsPlayerEditingVehicle( playerid ) ) return SendError( playerid, "You're not editing a vehicle." );
SetPVarInt( playerid, "component_edit_type", COMPONENT_EDIT_TYPE_Y );
return SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You're now editing the Y axis of the component." );
}
CMD:pz( playerid, params[ ] )
{
if ( ! IsPlayerEditingVehicle( playerid ) ) return SendError( playerid, "You're not editing a vehicle." );
SetPVarInt( playerid, "component_edit_type", COMPONENT_EDIT_TYPE_Z );
return SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You're now editing the Z axis of the component." );
}
CMD:rx( playerid, params[ ] )
{
if ( ! IsPlayerEditingVehicle( playerid ) ) return SendError( playerid, "You're not editing a vehicle." );
SetPVarInt( playerid, "component_edit_type", COMPONENT_EDIT_TYPE_RX );
return SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You're now editing the X rotation of the component." );
}
CMD:ry( playerid, params[ ] )
{
if ( ! IsPlayerEditingVehicle( playerid ) ) return SendError( playerid, "You're not editing a vehicle." );
SetPVarInt( playerid, "component_edit_type", COMPONENT_EDIT_TYPE_RY );
return SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You're now editing the Y rotation of the component." );
}
CMD:rz( playerid, params[ ] )
{
if ( ! IsPlayerEditingVehicle( playerid ) ) return SendError( playerid, "You're not editing a vehicle." );
SetPVarInt( playerid, "component_edit_type", COMPONENT_EDIT_TYPE_RZ );
return SendClientMessageFormatted( playerid, -1, ""COL_GREY"[GARAGE]"COL_WHITE" You're now editing the Z rotation of the component." );
}
stock IsPlayerEditingVehicle( playerid ) {
return GetPVarType( playerid, "components_editing" ) != 0;
}

View File

@ -13,6 +13,9 @@
#define CASINO_REWARDS_DIVISOR 10.0 // 1000 points becomes 1 point #define CASINO_REWARDS_DIVISOR 10.0 // 1000 points becomes 1 point
#define CASINO_REWARDS_COST_MP 1.0 // half of the price (since it costs (1/payout_percent) times more) #define CASINO_REWARDS_COST_MP 1.0 // half of the price (since it costs (1/payout_percent) times more)
#define CASINO_POINTS_SELL_MINIMUM 10000
#define CASINO_POINTS_SELL_VALUE 10.0
/* ** Variables ** */ /* ** Variables ** */
enum E_REWARDS_DATA enum E_REWARDS_DATA
{ {
@ -53,6 +56,11 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
if ( listitem >= sizeof( g_casinoRewardsShopItems ) ) if ( listitem >= sizeof( g_casinoRewardsShopItems ) )
{ {
new rewards_item = listitem - sizeof( g_casinoRewardsShopItems ); new rewards_item = listitem - sizeof( g_casinoRewardsShopItems );
if ( rewards_item >= sizeof( g_casinoRewardsItems ) ) {
return ShowPlayerSellMenu( playerid );
}
new Float: rewards_points = g_casinoRewardsItems[ rewards_item ] [ E_POINTS ]; new Float: rewards_points = g_casinoRewardsItems[ rewards_item ] [ E_POINTS ];
if ( p_CasinoRewardsPoints[ playerid ] < rewards_points ) if ( p_CasinoRewardsPoints[ playerid ] < rewards_points )
@ -142,6 +150,37 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
mysql_single_query( sprintf( "UPDATE `USERS` SET `CASINO_REWARDS` = %f WHERE `ID`=%d", p_CasinoRewardsPoints[ playerid ], p_AccountID[ playerid ] ) ); mysql_single_query( sprintf( "UPDATE `USERS` SET `CASINO_REWARDS` = %f WHERE `ID`=%d", p_CasinoRewardsPoints[ playerid ], p_AccountID[ playerid ] ) );
return 1; return 1;
} }
else if ( dialogid == DIALOG_CASINO_POINTS_MARKET )
{
if ( ! response ) {
return ShowPlayerRewardsMenu( playerid );
}
new total_points = floatround( p_CasinoRewardsPoints[ playerid ], floatround_floor );
new sell_amount = strval( inputtext );
if ( sell_amount < CASINO_POINTS_SELL_MINIMUM )
{
SendError( playerid, "Minimum amount of Casino Points that you can sell is %s.", number_format( CASINO_POINTS_SELL_MINIMUM ) );
return ShowPlayerSellMenu( playerid );
}
else if ( sell_amount > total_points )
{
SendError( playerid, "You do not have this much Casino Points." );
return ShowPlayerSellMenu( playerid );
}
else
{
new
credit = floatround( float( sell_amount ) * CASINO_POINTS_SELL_VALUE, floatround_floor );
GivePlayerCash( playerid, credit );
p_CasinoRewardsPoints[ playerid ] -= float( sell_amount );
SendGlobalMessage( -1, ""COL_GREY"[CASINO]{FFFFFF} %s(%d) has sold %s casino points for "COL_GOLD"%s"COL_WHITE"!", ReturnPlayerName( playerid ), playerid, points_format( sell_amount ), cash_format( credit ) );
mysql_single_query( sprintf( "UPDATE `USERS` SET `CASINO_REWARDS` = %f WHERE `ID`=%d", p_CasinoRewardsPoints[ playerid ], p_AccountID[ playerid ] ) );
}
return 1;
}
return 1; return 1;
} }
@ -235,10 +274,27 @@ stock ShowPlayerRewardsMenu( playerid )
for ( new i = 0; i < sizeof( g_casinoRewardsItems ); i ++ ) { for ( new i = 0; i < sizeof( g_casinoRewardsItems ); i ++ ) {
format( szString, sizeof( szString ), "%s%s\t \t"COL_GOLD"%s points\n", szString, g_casinoRewardsItems[ i ] [ E_NAME ], points_format( g_casinoRewardsItems[ i ] [ E_POINTS ] ) ); format( szString, sizeof( szString ), "%s%s\t \t"COL_GOLD"%s points\n", szString, g_casinoRewardsItems[ i ] [ E_NAME ], points_format( g_casinoRewardsItems[ i ] [ E_POINTS ] ) );
} }
strcat( szString, ""COL_GREEN"Sell Your Points\t \t"COL_GREEN">>>" );
} }
return ShowPlayerDialog( playerid, DIALOG_CASINO_REWARDS, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Casino Rewards Items", szString, "Buy", "Cancel" ); return ShowPlayerDialog( playerid, DIALOG_CASINO_REWARDS, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Casino Rewards Items", szString, "Buy", "Cancel" );
} }
stock ShowPlayerSellMenu( playerid )
{
new value = floatround( p_CasinoRewardsPoints[ playerid ] * CASINO_POINTS_SELL_VALUE );
format( szBigString, sizeof( szBigString ),
""COL_WHITE"Please input how much Casino Points you want to sell.\n\n"\
"Exchange Rate is "COL_GOLD"1 "COL_WHITE"Casino Point for "COL_GOLD"%s\n\n"\
""COL_WHITE"You have "COL_GOLD"%s "COL_WHITE"Casino Points that can be sold for "COL_GOLD"%s",
cash_format( CASINO_POINTS_SELL_VALUE, .decimals = 0 ),
points_format( p_CasinoRewardsPoints[ playerid ] ),
cash_format( value, .decimals = 0 )
);
return ShowPlayerDialog( playerid, DIALOG_CASINO_POINTS_MARKET, DIALOG_STYLE_INPUT, "{FFFFFF}Casino Points Market", szBigString, "Sell", "Back" );
}
stock IsCasinoRewardsShopItem( E_SHOP_ITEMS: itemid ) { stock IsCasinoRewardsShopItem( E_SHOP_ITEMS: itemid ) {
for ( new i = 0; i < sizeof( g_casinoRewardsShopItems ); i ++ ) if ( itemid == g_casinoRewardsShopItems[ i ] ) { for ( new i = 0; i < sizeof( g_casinoRewardsShopItems ); i ++ ) if ( itemid == g_casinoRewardsShopItems[ i ] ) {
return true; return true;

View File

@ -248,6 +248,21 @@ hook OnPlayerDeath( playerid, killerid, reason )
return 1; return 1;
} }
/* ** Commands ** */
CMD:jackpots( playerid, params[ ] )
{
format( szBigString, sizeof( szBigString ), "The Visage Casino\t"COL_GREEN"%s\n\
4 Dragons Casino\t"COL_GREEN"%s\n\
Caligulas Casino\t"COL_GREEN"%s",
cash_format( g_casinoPoolData[ 2 ] [ E_POOL ] ),
cash_format( g_casinoPoolData[ 1 ] [ E_POOL ] ),
cash_format( g_casinoPoolData[ 0 ] [ E_POOL ] )
);
ShowPlayerDialog( playerid, DIALOG_NULL, DIALOG_STYLE_TABLIST, ""COL_GOLD"Jackpots", szBigString, "Okay", "" );
return 1;
}
/* ** Callbacks ** */ /* ** Callbacks ** */
public OnPlayerUseSlotMachine( playerid, slotid, first_combo, second_combo, third_combo ) public OnPlayerUseSlotMachine( playerid, slotid, first_combo, second_combo, third_combo )
{ {

View File

@ -3672,9 +3672,9 @@ hook OnScriptInit( )
CreateDynamicObject( 19353, -1971.630371, 1345.444091, 4.487493, 0.000000, 0.000000, 132.000106 ); CreateDynamicObject( 19353, -1971.630371, 1345.444091, 4.487493, 0.000000, 0.000000, 132.000106 );
CreateDynamicObject( 19353, -1972.768188, 1342.837890, 4.487494, 0.000000, 0.000000, 0.300101 ); CreateDynamicObject( 19353, -1972.768188, 1342.837890, 4.487494, 0.000000, 0.000000, 0.300101 );
CreateDynamicObject( 19353, -1972.757202, 1340.717895, 4.487494, 0.000000, 0.000000, 0.300101 ); CreateDynamicObject( 19353, -1972.757202, 1340.717895, 4.487494, 0.000000, 0.000000, 0.300101 );
SetDynamicObjectMaterialText( CreateDynamicObject( 3074, -1966.0687, 1345.0089, 3.1941, 0.0000, 0.0000, -78.5715 ), 0, "Solanum", 130, "Times New Roman", 18, 1, -1, 0, 1); SetDynamicObjectMaterialText( CreateDynamicObject( 3074, -1966.0687, 1345.0089, 3.1941, 0.0000, 0.0000, -78.5715 ), 0, "Novic", 130, "Times New Roman", 18, 1, -1, 0, 1);
SetDynamicObjectMaterialText( CreateDynamicObject( 3074, -1969.9720, 1341.4737, 3.1941, 0.0000, 0.0000, -16.3579 ), 0, "Hotel", 130, "Times New Roman", 18, 1, -1, 0, 1); SetDynamicObjectMaterialText( CreateDynamicObject( 3074, -1969.9720, 1341.4737, 3.1941, 0.0000, 0.0000, -16.3579 ), 0, "Hotel", 130, "Times New Roman", 18, 1, -1, 0, 1);
SetDynamicObjectMaterialText( CreateDynamicObject( 3074, -1968.2480, 1343.4796, 3.5041, 0.0000, 0.0000, -47.5979 ), 0, "de", 130, "Times New Roman", 24, 1, -1, 0, 1); SetDynamicObjectMaterialText( CreateDynamicObject( 3074, -1968.2480, 1343.4796, 3.5041, 0.0000, 0.0000, -47.5979 ), 0, "da", 130, "Times New Roman", 24, 1, -1, 0, 1);
// Freefall // Freefall
SetDynamicObjectMaterial( CreateDynamicObject( 19355, -1758.228759, 860.904357, 31.404382, 0.000000, 0.000000, 90.000000 ), 0, 9900, "pointysfe", "pointy_sfe", 0 ); SetDynamicObjectMaterial( CreateDynamicObject( 19355, -1758.228759, 860.904357, 31.404382, 0.000000, 0.000000, 90.000000 ), 0, 9900, "pointysfe", "pointy_sfe", 0 );

View File

@ -538,6 +538,7 @@ public OnPlayerDisconnect( playerid, reason )
p_OwnedHouses [ playerid ] = 0; p_OwnedHouses [ playerid ] = 0;
p_OwnedVehicles [ playerid ] = 0; p_OwnedVehicles [ playerid ] = 0;
p_ToggledViewPM { playerid } = false; p_ToggledViewPM { playerid } = false;
p_TogglePBChat { playerid } = false;
p_VIPExpiretime [ playerid ] = 0; p_VIPExpiretime [ playerid ] = 0;
p_Kills [ playerid ] = 0; p_Kills [ playerid ] = 0;
p_Deaths [ playerid ] = 0; p_Deaths [ playerid ] = 0;
@ -727,19 +728,19 @@ public OnPlayerSpawn( playerid )
SpawnToPaintball( playerid, p_PaintBallArena{ playerid } ); SpawnToPaintball( playerid, p_PaintBallArena{ playerid } );
return 1; return 1;
} }
#if defined __cloudy_event_system #if defined __cloudy_event_system
else if ( IsPlayerInEvent( playerid ) ) else if ( IsPlayerInEvent( playerid ) )
{ {
if( ! EventSettingAllow( 0 ) && g_eventData[ EV_STARTED ] ) if( ! EventSettingAllow( 0 ) && g_eventData[ EV_STARTED ] )
{ {
SetPlayerInEvent( playerid ); // respawns player in event. SetPlayerInEvent( playerid ); // respawns player in event.
return 1; return 1;
} }
else RemovePlayerFromEvent( playerid, true ); // changes the InEvent variable to false. else RemovePlayerFromEvent( playerid, true ); // changes the InEvent variable to false.
} }
#endif #endif
if ( p_Class[ playerid ] == CLASS_CIVILIAN ) if ( p_Class[ playerid ] == CLASS_CIVILIAN )
{ {
if ( !p_JobSet{ playerid } ) if ( !p_JobSet{ playerid } )
@ -850,7 +851,7 @@ public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float:
#else #else
if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ hitid ] > 2 ) if ( p_Class[ playerid ] == CLASS_POLICE && p_WantedLevel[ hitid ] > 2 )
#endif #endif
{ {
p_QuitToAvoidTimestamp[ hitid ] = g_iTime + 3; p_QuitToAvoidTimestamp[ hitid ] = g_iTime + 3;
} }
@ -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 ) ); //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 new
killerGangId = p_GangID[ killerid ]; killerGangId = p_GangID[ killerid ];
@ -1439,7 +1440,7 @@ public OnPlayerDeath( playerid, killerid, reason )
DeletePVar( playerid, "used_cmd_kill" ); 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 ) if ( playerGangId != INVALID_GANG_ID )
SaveGangData( playerGangId ), g_gangData[ playerGangId ] [ E_DEATHS ]++; SaveGangData( playerGangId ), g_gangData[ playerGangId ] [ E_DEATHS ]++;
@ -5197,7 +5198,8 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
""COL_GREY"/robstore{FFFFFF} - Displays the key to press in-order to rob a store.\n"\ ""COL_GREY"/robstore{FFFFFF} - Displays the key to press in-order to rob a store.\n"\
""COL_GREY"/pdjail{FFFFFF} - Displays the time until jail cells are available for raiding.\n"\ ""COL_GREY"/pdjail{FFFFFF} - Displays the time until jail cells are available for raiding.\n"\
""COL_GREY"/banks{FFFFFF} - Displays the time until certain banks are available for robbing.\n" ); ""COL_GREY"/banks{FFFFFF} - Displays the time until certain banks are available for robbing.\n" );
strcat( szCMDS, ""COL_GREY"/stoprob{FFFFFF} - Stops your current robbery.\n"\ strcat( szCMDS, ""COL_GREY"/jackpots{FFFFFF} - Displays current jackpots in all casinos.\n"\
""COL_GREY"/stoprob{FFFFFF} - Stops your current robbery.\n"\
""COL_GREY"/job{FFFFFF} - Shows your job.\n"\ ""COL_GREY"/job{FFFFFF} - Shows your job.\n"\
""COL_GREY"/911{FFFFFF} - Calls the emergency services.\n"\ ""COL_GREY"/911{FFFFFF} - Calls the emergency services.\n"\
""COL_GREY"/placehit{FFFFFF} - Places a hit on a specified player.\n"\ ""COL_GREY"/placehit{FFFFFF} - Places a hit on a specified player.\n"\
@ -5295,6 +5297,8 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
strcat( szCMDS, ""COL_GREY"/labelinfo{FFFFFF} - Displays your label text with the 32 character limit.\n"\ strcat( szCMDS, ""COL_GREY"/labelinfo{FFFFFF} - Displays your label text with the 32 character limit.\n"\
""COL_GREY"/radio{FFFFFF} - Shows the list of radio stations you can listen to.\n"\ ""COL_GREY"/radio{FFFFFF} - Shows the list of radio stations you can listen to.\n"\
""COL_GREY"/stopradio{FFFFFF} - Stops the radio from playing.\n"\ ""COL_GREY"/stopradio{FFFFFF} - Stops the radio from playing.\n"\
""COL_GREY"/boombox{FFFFFF} - Places a boombox at your position which plays music in small area.\n"\
""COL_GREY"/colors(/colours){FFFFFF} - Shows the list of all available colours in-game.\n"\
""COL_GREY"/moviemode{FFFFFF} - Toggles movie mode so you can record without all the text on the screen." ); ""COL_GREY"/moviemode{FFFFFF} - Toggles movie mode so you can record without all the text on the screen." );
ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Miscellaneous Commands", szCMDS, "Okay", "Back" ); ShowPlayerDialog( playerid, DIALOG_CMDS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Miscellaneous Commands", szCMDS, "Okay", "Back" );
} }
@ -5415,8 +5419,9 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
format( szLargeString, 750, "%s"COL_GREY"Weed Seeds:"COL_WHITE" %d\n"\ format( szLargeString, 750, "%s"COL_GREY"Weed Seeds:"COL_WHITE" %d\n"\
""COL_GREY"Fireworks:{FFFFFF} %d\n"\ ""COL_GREY"Fireworks:{FFFFFF} %d\n"\
""COL_GREY"Explosive Bullets:{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"Boombox:{FFFFFF} %s\n",
szLargeString, GetPlayerShopItemAmount( playerid, SHOP_ITEM_WEED_SEED ), p_Fireworks[ pID ], p_ExplosiveBullets[ pID ], GetPlayerBoombox( pID ) ? ( "Yes" ) : ( "No" ) );
ShowPlayerDialog( playerid, DIALOG_STATS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Item Statistics", szLargeString, "Okay", "Back" ); ShowPlayerDialog( playerid, DIALOG_STATS_REDIRECT, DIALOG_STYLE_MSGBOX, "{FFFFFF}Item Statistics", szLargeString, "Okay", "Back" );
} }

View File

@ -1,3 +1,5 @@
v11.68.210
v11.66.204
v11.65.200 v11.65.200
v11.60.190 v11.60.190
v11.57.188 v11.57.188

View File

@ -2,8 +2,11 @@
(+) Adds CAC mode and new locations for the duel system (Stev). (+) Adds CAC mode and new locations for the duel system (Stev).
(+) Adds /givearmour for level 5s (Nemesis). (+) Adds /givearmour for level 5s (Nemesis).
(+) Adds roleplay level. Get benefits to minijobs by levelling it up. E.g. higher success mining. (+) Adds roleplay level. Get benefits to minijobs by levelling it up. E.g. higher success mining.
(+) Adds a boombox system. Buy one at Supa Save and play music locally with your friends.
(+) Hotel da Novic rooms come now prefurnished.
(/) Inactive accounts will get removed now after 1 year. (/) Inactive accounts will get removed now after 1 year.
(/) Oldschool class selection has been restored. (/) Oldschool class selection has been restored.
(/) "/vip" has been reformatted (Night). (/) "/vip" has been reformatted (Night).
(*) Fix global message spam with slot machines. (*) Fix global message spam with slot machines.
(*) Fix issue with features being shown and unavoidable on register. (*) Fix issue with features being shown and unavoidable on register.
(*) Meth now pays roleplay experience.

View File

@ -0,0 +1,6 @@
(+) Typing "/boombox play" again while your boombox is active will update the stream.
(+) "/jackpots" added. Shows the current casino slot machine jackpots.
(+) "/colors" added for people curious about vehicle colors.
(+) You can now sell your casino points for in-game money.
(/) Vehicle component placement overhaul. Accurately and easily place vehicle components!
(*) Kill death ratio is unaffected now during events.

View File

@ -0,0 +1,8 @@
(+) New players are given $5,000 when they register.
(+) Police level over 75 will half the number of seconds you spend in jail.
(+) Success rate of bobby pins doubles every 25th police level.
(+) Bail is reduced up to a maximum of 80% with every police level.
(/) Payout for robberies in LS and LV has been reduced.
(/) Fireman minimum pay increased, maximum set to $5,000 though per fire.
(*) Adds map loading/unloading functionality to event module.
(*) All fires are remade after an in-game day.