Ban system [ MySQL ]
#1

Well the command and everything works it just doens't load the ban somehow when the player connects

OnPlayerConnect
PHP код:
new query[200];
mysql_format(SQLquerysizeof(query), "SELECT * FROM `users` WHERE `name` = '%e' LIMIT 1"GetName(playerid));
mysql_pquery(SQLquery"CheckPlayerAccount""i"playerid); 
CheckPlayerAccount
PHP код:
new q[128];
mysql_formatSQLqsizeof(q), "SELECT * FROM `banned` WHERE `user_id` = '%d' LIMIT 1"PlayerInfo[playerid][pSqlID] );
mysql_pquerySQLq"CheckPlayerBan""i"playerid ); 
CheckPlayerBan

PHP код:
/*
#define FUNCTION:%0(%1) \
        forward%0(%1); \
        public%0(%1)
*/
FUNCTION: CheckPlayerBanplayerid ) {
    new 
rows;
    
cache_get_row_count(rows);
    if( !
rows ) {
        
SetTimerEx"Login"100false"d"playerid ); // the login dialog and stuff
    
}
    else {
        new 
user_id;
        
user_id cache_get_value_name_int0"user_id"user_id );
        new 
ban_reason64 ], ban_date64 ], ban_adminMAX_PLAYER_NAME ];
        
cache_get_value_name0"ban_reason"ban_reason150 );
        
cache_get_value_name0"ban_date"ban_date150 );
        
cache_get_value_name0"ban_admin"ban_admin150 );
            if( 
user_id == PlayerInfoplayerid ][ pSqlID ] ) {
            
SendClientMessageplayeridRED"BANNED");
            
AC_Kick2playerid ); 
            
/*
            stock AC_Kick2(playerid)
            {
                SetTimerEx("TrueKick", 100, false, "i", playerid);
                GameTextForPlayer(playerid, "~r~Kicked", 60000, 4);
                TogglePlayerControllable(playerid, 0);
            }
            */
            
return 1;
        }
        else 
SetTimerEx"Login"100false"d"playerid );
    }

Reply


Messages In This Thread
Ban system [ MySQL ] - by IdonTmiss - 06.08.2018, 01:49
Re: Ban system [ MySQL ] - by IdonTmiss - 06.08.2018, 02:54
Re: Ban system [ MySQL ] - by DBZdabIt3Bro7 - 06.08.2018, 03:48
Re: Ban system [ MySQL ] - by IdonTmiss - 06.08.2018, 04:28
Re: Ban system [ MySQL ] - by Calisthenics - 06.08.2018, 09:02
Re: Ban system [ MySQL ] - by IdonTmiss - 06.08.2018, 12:41
Re: Ban system [ MySQL ] - by IdonTmiss - 06.08.2018, 14:50
Re: Ban system [ MySQL ] - by Calisthenics - 07.08.2018, 08:38

Forum Jump:


Users browsing this thread: 1 Guest(s)