Merge branch 'changes' of https://bitbucket.org/lorenc/cnr into changes

This commit is contained in:
Steven Howard 2018-09-25 16:30:09 +01:00
commit b8df0fc32f
8 changed files with 20 additions and 14 deletions

View File

@ -33,4 +33,4 @@
// #include "irresistible\cnr\features\eastereggs.pwn" // #include "irresistible\cnr\features\eastereggs.pwn"
// pool // pool
// #include "irresistible\cnr\features\pool.pwn" #include "irresistible\cnr\features\pool.pwn"

View File

@ -112,7 +112,7 @@ CMD:crowdfunds( playerid, params[ ] ) return ShowPlayerCrowdfunds( playerid );
/* ** Functions ** */ /* ** Functions ** */
stock ShowPlayerCrowdfunds( playerid ) { stock ShowPlayerCrowdfunds( playerid ) {
return mysql_tquery( dbHandle, return mysql_tquery( dbHandle,
"SELECT CROWDFUNDS.ID, CROWDFUNDS.FEATURE, CROWDFUNDS.FUND_TARGET, SUM(CROWDFUND_PATREONS.AMOUNT) AS RAISED, UNIX_TIMESTAMP(RELEASE_DATE) AS RELEASE, UNIX_TIMESTAMP(END_DATE) AS END FROM CROWDFUNDS " \ "SELECT CROWDFUNDS.ID, CROWDFUNDS.FEATURE, CROWDFUNDS.FUND_TARGET, SUM(CROWDFUND_PATREONS.AMOUNT) AS RAISED, UNIX_TIMESTAMP(RELEASE_DATE) AS RELEASE_TS, UNIX_TIMESTAMP(END_DATE) AS END_TS FROM CROWDFUNDS " \
"LEFT JOIN CROWDFUND_PATREONS on CROWDFUNDS.ID = CROWDFUND_PATREONS.CROWDFUND_ID " \ "LEFT JOIN CROWDFUND_PATREONS on CROWDFUNDS.ID = CROWDFUND_PATREONS.CROWDFUND_ID " \
"GROUP BY CROWDFUNDS.ID ORDER BY CROWDFUNDS.ID DESC LIMIT " # MAX_CROWDFUNDS, "GROUP BY CROWDFUNDS.ID ORDER BY CROWDFUNDS.ID DESC LIMIT " # MAX_CROWDFUNDS,
"OnDisplayCrowdfunds", "i", playerid "OnDisplayCrowdfunds", "i", playerid
@ -230,9 +230,7 @@ thread OnDisplayCrowdfundInfo( playerid, crowdfund_id )
thread OnDisplayCrowdfunds( playerid ) thread OnDisplayCrowdfunds( playerid )
{ {
new new
rows; rows = cache_get_row_count( );
cache_get_data( rows, tmpVariable );
if ( ! rows ) { if ( ! rows ) {
return SendError( playerid, "There is no crowdfund to show. Try again later." ); return SendError( playerid, "There is no crowdfund to show. Try again later." );
@ -259,8 +257,8 @@ thread OnDisplayCrowdfunds( playerid )
new Float: percent_raised = ( amount_raised / target_amount ) * 100.0; new Float: percent_raised = ( amount_raised / target_amount ) * 100.0;
new curr_timestamp = gettime( ); new curr_timestamp = gettime( );
new release_timestamp = cache_get_field_content_int( row, "RELEASE", dbHandle ); new release_timestamp = cache_get_field_content_int( row, "RELEASE_TS", dbHandle );
new end_timestamp = cache_get_field_content_int( row, "END", dbHandle ); new end_timestamp = cache_get_field_content_int( row, "END_TS", dbHandle );
// inactive // inactive
if ( ( curr_timestamp > release_timestamp && release_timestamp != 0 ) || ( curr_timestamp > end_timestamp ) ) if ( ( curr_timestamp > release_timestamp && release_timestamp != 0 ) || ( curr_timestamp > end_timestamp ) )

View File

@ -320,7 +320,7 @@ hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
new houseid = p_InHouse[ playerid ]; new houseid = p_InHouse[ playerid ];
format( g_houseData[ houseid ] [ E_HOUSE_NAME ], 30, "%s", inputtext); format( g_houseData[ houseid ] [ E_HOUSE_NAME ], 30, "%s", inputtext);
mysql_format( dbHandle, szNormalString, sizeof( szNormalString ), "UPDATE `HOUSES` SET `NAME`='%s' WHERE `ID`=%d", g_houseData[ houseid ] [ E_HOUSE_NAME ], p_InHouse[ playerid ] ); mysql_format( dbHandle, szNormalString, sizeof( szNormalString ), "UPDATE `HOUSES` SET `NAME`='%e' WHERE `ID`=%d", g_houseData[ houseid ] [ E_HOUSE_NAME ], p_InHouse[ playerid ] );
mysql_single_query( szNormalString ); mysql_single_query( szNormalString );
format( szBigString, sizeof( szBigString ), ""COL_GOLD"House:"COL_WHITE" %s(%d)\n"COL_GOLD"Owner:"COL_WHITE" %s\n"COL_GOLD"Price:"COL_WHITE" %s", g_houseData[ houseid ] [ E_HOUSE_NAME ], houseid, g_houseData[ houseid ] [ E_OWNER ], cash_format( g_houseData[ houseid ] [ E_COST ] ) ); format( szBigString, sizeof( szBigString ), ""COL_GOLD"House:"COL_WHITE" %s(%d)\n"COL_GOLD"Owner:"COL_WHITE" %s\n"COL_GOLD"Price:"COL_WHITE" %s", g_houseData[ houseid ] [ E_HOUSE_NAME ], houseid, g_houseData[ houseid ] [ E_OWNER ], cash_format( g_houseData[ houseid ] [ E_COST ] ) );
UpdateDynamic3DTextLabelText( g_houseData[ houseid ] [ E_LABEL ] [ 0 ], COLOR_WHITE, szBigString ); UpdateDynamic3DTextLabelText( g_houseData[ houseid ] [ E_LABEL ] [ 0 ], COLOR_WHITE, szBigString );
@ -392,10 +392,12 @@ CMD:h( playerid, params[ ] )
if ( p_accountSecurityData[ playerid ] [ E_ID ] && ! p_accountSecurityData[ playerid ] [ E_VERIFIED ] && p_accountSecurityData[ playerid ] [ E_MODE ] != SECURITY_MODE_DISABLED ) if ( p_accountSecurityData[ playerid ] [ E_ID ] && ! p_accountSecurityData[ playerid ] [ E_VERIFIED ] && p_accountSecurityData[ playerid ] [ E_MODE ] != SECURITY_MODE_DISABLED )
return SendError( playerid, "You must be verified in order to use this feature. "COL_YELLOW"(use /verify)" ); return SendError( playerid, "You must be verified in order to use this feature. "COL_YELLOW"(use /verify)" );
#if VIP_ALLOW_OVER_LIMIT == false
if ( ! p_VIPLevel[ playerid ] && p_OwnedHouses[ playerid ] > GetPlayerHouseSlots( playerid ) && ! strmatch( params, "sell" ) ) { if ( ! p_VIPLevel[ playerid ] && p_OwnedHouses[ playerid ] > GetPlayerHouseSlots( playerid ) && ! strmatch( params, "sell" ) ) {
ResetSpawnLocation( playerid ); ResetSpawnLocation( playerid );
return SendError( playerid, "Please renew your V.I.P or sell this home to match your house allocated limit (/h sell)." ); return SendError( playerid, "Please renew your V.I.P or sell this home to match your house allocated limit (/h sell)." );
} }
#endif
new new
ID = p_InHouse[ playerid ]; ID = p_InHouse[ playerid ];

View File

@ -236,6 +236,7 @@ thread HouseListing_OnBuyHome( playerid, house_listing_id )
// credit seller if they are on/offline // credit seller if they are on/offline
new new
houseid = cache_get_field_content_int( 0, "HOUSE_ID" ),
sellerid; sellerid;
foreach ( sellerid : Player ) if ( GetPlayerAccountID( sellerid ) == owner_account_id ) { foreach ( sellerid : Player ) if ( GetPlayerAccountID( sellerid ) == owner_account_id ) {
@ -246,13 +247,11 @@ thread HouseListing_OnBuyHome( playerid, house_listing_id )
if ( 0 <= sellerid < MAX_PLAYERS && Iter_Contains( Player, sellerid ) ) { if ( 0 <= sellerid < MAX_PLAYERS && Iter_Contains( Player, sellerid ) ) {
p_OwnedHouses[ sellerid ] --; p_OwnedHouses[ sellerid ] --;
GivePlayerIrresistibleCoins( sellerid, ask_price ); GivePlayerIrresistibleCoins( sellerid, ask_price );
SendServerMessage( sellerid, "You have successfully sold your house for "COL_GOLD"%s IC"COL_WHITE" to %s(%d)!", number_format( ask_price, .decimals = 2 ), ReturnPlayerName( playerid ), playerid ); SendServerMessage( sellerid, "You have successfully sold your home (%s) for "COL_GOLD"%s IC"COL_WHITE" to %s(%d)!", g_houseData[ houseid ] [ E_HOUSE_NAME ], number_format( ask_price, .decimals = 2 ), ReturnPlayerName( playerid ), playerid );
} else { } else {
mysql_single_query( sprintf( "UPDATE `USERS` SET `COINS` = `COINS` + %f WHERE `ID` = %d", ask_price, owner_account_id ) ); mysql_single_query( sprintf( "UPDATE `USERS` SET `COINS` = `COINS` + %f WHERE `ID` = %d", ask_price, owner_account_id ) );
} }
new
houseid = cache_get_field_content_int( 0, "HOUSE_ID" );
// show sellers name & house name // show sellers name & house name
SendServerMessage( playerid, "You have successfully bought %s's home (%s"COL_WHITE") for "COL_GOLD"%s IC"COL_WHITE"!", g_houseData[ houseid ] [ E_OWNER ], g_houseData[ houseid ] [ E_HOUSE_NAME ], number_format( ask_price, .decimals = 2 ) ); SendServerMessage( playerid, "You have successfully bought %s's home (%s"COL_WHITE") for "COL_GOLD"%s IC"COL_WHITE"!", g_houseData[ houseid ] [ E_OWNER ], g_houseData[ houseid ] [ E_HOUSE_NAME ], number_format( ask_price, .decimals = 2 ) );

View File

@ -68,7 +68,8 @@ static stock
{ "{8ADE47}Stephanie:"COL_WHITE" Race your friends in a street race or outrun race by using "COL_GREY"/race"COL_WHITE"!" }, { "{8ADE47}Stephanie:"COL_WHITE" Race your friends in a street race or outrun race by using "COL_GREY"/race"COL_WHITE"!" },
{ "{8ADE47}Stephanie:"COL_WHITE" Want 3 days of free V.I.P? Add an "COL_GREY"/email"COL_WHITE" to your account!" }, { "{8ADE47}Stephanie:"COL_WHITE" Want 3 days of free V.I.P? Add an "COL_GREY"/email"COL_WHITE" to your account!" },
{ "{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" Don't want to be interrupted as an innocent player? Enter passive mode with "COL_GREY"/passive"COL_WHITE"!" } { "{8ADE47}Stephanie:"COL_WHITE" Don't want to be interrupted as an innocent player? Enter passive mode with "COL_GREY"/passive"COL_WHITE"!" },
{ "{8ADE47}Stephanie:"COL_WHITE" You can buy premium player homes using "COL_GREY"/estate"COL_WHITE"!" }
}, },
g_randomMessageTick = 0 g_randomMessageTick = 0
; ;

View File

@ -245,6 +245,7 @@ CMD:v( playerid, params[ ] )
if ( p_accountSecurityData[ playerid ] [ E_ID ] && ! p_accountSecurityData[ playerid ] [ E_VERIFIED ] && p_accountSecurityData[ playerid ] [ E_MODE ] != SECURITY_MODE_DISABLED ) if ( p_accountSecurityData[ playerid ] [ E_ID ] && ! p_accountSecurityData[ playerid ] [ E_VERIFIED ] && p_accountSecurityData[ playerid ] [ E_MODE ] != SECURITY_MODE_DISABLED )
return SendError( playerid, "You must be verified in order to use this feature. "COL_YELLOW"(use /verify)" ); return SendError( playerid, "You must be verified in order to use this feature. "COL_YELLOW"(use /verify)" );
#if VIP_ALLOW_OVER_LIMIT == false
// force hoarders to sell // force hoarders to sell
if ( ! p_VIPLevel[ playerid ] && p_OwnedVehicles[ playerid ] > GetPlayerVehicleSlots( playerid ) && ! strmatch( params, "sell" ) && ! strmatch( params, "bring" ) ) { if ( ! p_VIPLevel[ playerid ] && p_OwnedVehicles[ playerid ] > GetPlayerVehicleSlots( playerid ) && ! strmatch( params, "sell" ) && ! strmatch( params, "bring" ) ) {
for( new i = 0; i < p_OwnedVehicles[ playerid ]; i++ ) if ( g_vehicleData[ playerid ] [ i ] [ E_OWNER_ID ] == p_AccountID[ playerid ] ) { for( new i = 0; i < p_OwnedVehicles[ playerid ]; i++ ) if ( g_vehicleData[ playerid ] [ i ] [ E_OWNER_ID ] == p_AccountID[ playerid ] ) {
@ -252,6 +253,7 @@ CMD:v( playerid, params[ ] )
} }
return SendError( playerid, "Please renew your V.I.P or sell this vehicle to match your vehicle allocated limit. (/v sell/bring only)" ); return SendError( playerid, "Please renew your V.I.P or sell this vehicle to match your vehicle allocated limit. (/v sell/bring only)" );
} }
#endif
new new
vehicleid = GetPlayerVehicleID( playerid ), vehicleid = GetPlayerVehicleID( playerid ),

View File

@ -39,6 +39,8 @@
#define ICM_NAME ( 7 ) #define ICM_NAME ( 7 )
#define ICM_VEH_SLOT ( 8 ) #define ICM_VEH_SLOT ( 8 )
#define VIP_ALLOW_OVER_LIMIT ( true )
/* ** Variables ** */ /* ** Variables ** */
enum E_IC_MARKET_DATA enum E_IC_MARKET_DATA
{ {

View File

@ -53,7 +53,7 @@ native gpci ( playerid, serial[ ], len );
new bool: False = false; new bool: False = false;
#define IsPlayerPlayingPool(%0) (False) // #define IsPlayerPlayingPool(%0) (False)
/* ** SF-CNR ** */ /* ** SF-CNR ** */
#include "irresistible\_main.pwn" #include "irresistible\_main.pwn"
@ -14128,10 +14128,12 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
if ( ! response ) if ( ! response )
return ShowPlayerSpawnMenu( playerid ); return ShowPlayerSpawnMenu( playerid );
#if VIP_ALLOW_OVER_LIMIT == false
if ( ! p_VIPLevel[ playerid ] && p_OwnedHouses[ playerid ] > GetPlayerHouseSlots( playerid ) ) { if ( ! p_VIPLevel[ playerid ] && p_OwnedHouses[ playerid ] > GetPlayerHouseSlots( playerid ) ) {
ResetSpawnLocation( playerid ); ResetSpawnLocation( playerid );
return SendError( playerid, "Please renew your V.I.P or sell this home to match your house allocated limit (/h sell)." ); return SendError( playerid, "Please renew your V.I.P or sell this home to match your house allocated limit (/h sell)." );
} }
#endif
new x = 0; new x = 0;
@ -18012,7 +18014,7 @@ stock GivePlayerWantedLevel( playerid, wantedlevel, bool:loadingstats = false )
format( szWanted, sizeof( szWanted ), "] %d ]", p_WantedLevel[ playerid ] ); format( szWanted, sizeof( szWanted ), "] %d ]", p_WantedLevel[ playerid ] );
PlayerTextDrawSetString( playerid, p_WantedLevelTD[ playerid ], szWanted ); PlayerTextDrawSetString( playerid, p_WantedLevelTD[ playerid ], szWanted );
if ( ! p_inMovieMode{ playerid } ) PlayerTextDrawShow( playerid, p_WantedLevelTD[ playerid ] ); if ( ! p_inMovieMode{ playerid } ) PlayerTextDrawShow( playerid, p_WantedLevelTD[ playerid ] );
PassiveMode_Reset( playerid, 0 ); // remove passive mode if the player is wanted ResetPlayerPassiveMode( playerid, .passive_disabled = true ); // remove passive mode if the player is wanted
} }
} }
else SetPlayerColorToTeam( playerid ), PlayerTextDrawHide( playerid, p_WantedLevelTD[ playerid ] ), Uncuff( playerid ); else SetPlayerColorToTeam( playerid ), PlayerTextDrawHide( playerid, p_WantedLevelTD[ playerid ] ), Uncuff( playerid );