fix potential market issues with selling while not logged in

This commit is contained in:
Lorenc Pekaj 2018-11-05 10:33:37 +11:00
parent baed9eb28c
commit b09f52b4fb
2 changed files with 2 additions and 2 deletions

View File

@ -341,7 +341,7 @@ thread StockMarket_OnPurchaseOrder( playerid, stockid, Float: shares )
new sold_amount_minus_fee = floatround( sold_shares * ask_price - sold_amount_fee );
if ( 0 <= sellerid < MAX_PLAYERS && Iter_Contains( Player, sellerid ) ) {
if ( 0 <= sellerid < MAX_PLAYERS && Iter_Contains( Player, sellerid ) && IsPlayerLoggedIn( sellerid ) ) {
GivePlayerBankMoney( sellerid, sold_amount_minus_fee ), Beep( sellerid );
SendServerMessage( sellerid, "You have sold %s %s shares to %s(%d) for "COL_GOLD"%s"COL_WHITE" (plus %0.1f%s fee)!", number_format( sold_shares, .decimals = 2 ), g_stockMarketData[ stockid ] [ E_NAME ], ReturnPlayerName( playerid ), playerid, cash_format( sold_amount_minus_fee ), STOCK_MARKET_TRADING_FEE * 100.0, "%%" );
} else {

View File

@ -251,7 +251,7 @@ thread PlayerMarket_OnPurchaseOrder( playerid, sellorderid, Float: purchase_amou
new after_fee_amount = floatround( float( purchase_cost ) * 0.995, floatround_floor );
if ( 0 <= sellerid < MAX_PLAYERS && Iter_Contains( Player, sellerid ) ) {
if ( 0 <= sellerid < MAX_PLAYERS && Iter_Contains( Player, sellerid ) && IsPlayerLoggedIn( sellerid ) ) {
GivePlayerBankMoney( sellerid, after_fee_amount ), Beep( sellerid );
SendServerMessage( sellerid, "You have successfully sold %s IC to %s(%d) for "COL_GOLD"%s"COL_WHITE" (-0.5%s fee)!", number_format( purchase_amount, .decimals = 3 ), ReturnPlayerName( playerid ), playerid, cash_format( after_fee_amount ), "%%" );
} else {