MySQL pays
#4

Код:
SELECT * FROM users WHERE PayCheck > 0
Код:
public MakePays( playerid )
{
    new rows, STRING[ 128 ], NAME[ 24 ], PAY;
    cache_get_row_count( rows ), printf( "%d", rows );
if(rows > 0)
{
	    for( new i; i != rows; i ++ )
    {
        cache_get_value_name( i, "PlayerName", NAME );
        cache_get_value_name_int( i, "PayCheck", PAY );
	        mysql_format( MHandle, STRING , sizeof( STRING ), "UPDATE bank_accounts SET Balance=Balance+%d WHERE Owner='%s' && Disabled=0 LIMIT 1", PAY, NAME ), mysql_query( MHandle, STRING );
        mysql_format( MHandle, STRING , sizeof( STRING ), "UPDATE users SET PayCheck='0' WHERE PlayerName='%s' LIMIT 1", NAME ), mysql_query( MHandle, STRING );
	        for( playerid; playerid < MAX_PLAYERS; playerid ++ )
        {
            if( CompareEx( NAME, PlayerName( playerid ) ) )
            {
                if( IsPlayerConnected( playerid ) )
                {
                    SendFormatMessage( playerid, -1, "[{f3ff4a} SZERVER {ffffff}] Fizetйsed бtutalva a bankszбmlбdra! ( {f3ff4a}$%s{ffffff} )", FormatNumber( PAY ) );
                }
            }
        }
    }
    }
    return 1;
}
and change this
Код:
for( playerid; playerid < MAX_PLAYERS; playerid ++ )
{
    if( CompareEx( NAME, PlayerName( playerid ) ) )
    {
        if( IsPlayerConnected( playerid ) )
        {
            SendFormatMessage( playerid, -1, "[{f3ff4a} SZERVER {ffffff}] Fizetйsed бtutalva a bankszбmlбdra! ( {f3ff4a}$%s{ffffff} )", FormatNumber( PAY ) );
        }
    }
}
to this
Код:
for( playerid; playerid < MAX_PLAYERS; playerid ++ )
{
    if( IsPlayerConnected( playerid ) )
    {
        if( CompareEx( NAME, PlayerName( playerid ) ) )
        {
                SendFormatMessage( playerid, -1, "[{f3ff4a} SZERVER {ffffff}] Fizetйsed бtutalva a bankszбmlбdra! ( {f3ff4a}$%s{ffffff} )", FormatNumber( PAY ) );
        }
    }
}
Reply


Messages In This Thread
MySQL pays - by [HUN]Amf - 05.04.2018, 16:16
Re: MySQL pays - by Gforcez - 05.04.2018, 16:41
Re: MySQL pays - by [HUN]Amf - 05.04.2018, 17:46
Re: MySQL pays - by m4karow - 05.04.2018, 17:48
Re: MySQL pays - by Dayrion - 05.04.2018, 17:49
Re: MySQL pays - by [HUN]Amf - 05.04.2018, 17:53
Re: MySQL pays - by Dayrion - 05.04.2018, 18:00
Re: MySQL pays - by [HUN]Amf - 05.04.2018, 18:01
Re: MySQL pays - by Dayrion - 05.04.2018, 18:03
Re: MySQL pays - by [HUN]Amf - 05.04.2018, 18:04

Forum Jump:


Users browsing this thread: 1 Guest(s)