Problem show dialog!
#1

PHP код:
BanCheck(playerid)
{
    new
        
retrieveName[MAX_PLAYER_NAME],
        
retrieveBannedBy[MAX_PLAYER_NAME],
        
retrieveReason[50],
        
retrieveBanDate,
        
retrieveDuration,
        
retrieveGCPI[60],
        
retrieveIP[16 1],
        
Query[380]
    ;
    
GetPlayerIp(playeridretrieveIPsizeof(retrieveIP));
    
gpci(playeridretrieveGCPIsizeof(retrieveGCPI));
    
    
format(Querysizeof(Query), "SELECT * FROM `Bans` WHERE `Name` = '%s' COLLATE NOCASE OR `GPCI` = '%s' OR `IP` = '%s' LIMIT 1"GetPlayerName(playerid), retrieveGCPIretrieveIP);
    
queryresult db_query(DatabaseQuery);
    if(
db_num_rows(queryresult))
    {
        
db_get_field_assoc(queryresult"Name"retrieveNamesizeof(retrieveName));
        
db_get_field_assoc(queryresult"BannerName"retrieveBannedBysizeof(retrieveBannedBy));
        
db_get_field_assoc(queryresult"Reason"retrieveReasonsizeof(retrieveReason));
        
retrieveBanDate db_get_field_assoc_int(queryresult"BANDATE");
        
retrieveDuration db_get_field_assoc_int(queryresult"UNBANDATE");
        if(
gettime() - retrieveDuration > (retrieveDuration retrieveBanDate))
        {
            
format(Querysizeof(Query), "Your ban expired on %s \nWelcome back %s!"TimestampToDateTime(retrieveDuration), GetPlayerName(playerid));
            
SendClientMessage(playeridCOLOR_SERVERQuery);
            
format(Querysizeof(Query), "DELETE * FROM `Bans` WHERE `Name` = '%s'"retrieveName);
            
queryresult db_query(DatabaseQuery);
            
        }
        else
        {
            new 
globalString[400];
            
format(globalStringsizeof(globalString), "Username: %s - Banned IP: %s"retrieveNameretrieveIPretrieveBannedBy);
            return 
ShowPlayerDialog(playeridDIALOG_BANINFODIALOG_STYLE_MSGBOX""COL_BLUE"Information - "COL_RED"Account BANNED!"globalString"Exit"""); //no show this dialog!
        
}
    }
    
db_free_result(queryresult);
    return 
0;

This dialog!
PHP код:
new globalString[400];
format(globalStringsizeof(globalString), "Username: %s - Banned IP: %s"retrieveNameretrieveIPretrieveBannedBy);
return 
ShowPlayerDialog(playeridDIALOG_BANINFODIALOG_STYLE_MSGBOX""COL_BLUE"Information - "COL_RED"Account BANNED!"globalString"Exit"""); //no show this dialog! 
Reply
#2

Well,... I don't know, if that is problem which cause not showing dialog but...

" format(globalString, sizeof(globalString), "Username: %s - Banned IP: %s", retrieveName, retrieveIP, retrieveBannedBy); "

You do not use all three parameters in your string.
Reply
#3

Quote:
Originally Posted by TheRohlikar
Посмотреть сообщение
Well,... I don't know, if that is problem which cause not showing dialog but...

" format(globalString, sizeof(globalString), "Username: %s - Banned IP: %s", retrieveName, retrieveIP, retrieveBannedBy); "

You do not use all three parameters in your string.
I did not notice it, but it is not the cause of the problem jeje
Reply
#4

Have you tried "prints" ?
Where it ends...
Reply
#5

Quote:
Originally Posted by TheRohlikar
Посмотреть сообщение
Have you tried "prints" ?
Where it ends...
i test with SendClientMessage and working
Reply
#6

Try it without "return". Make less "globalString" (this is unnecessary too I guess).. I really do not know, so I am just trying.
Reply
#7

Quote:
Originally Posted by TheRohlikar
Посмотреть сообщение
Try it without "return". Make less "globalString" (this is unnecessary too I guess).. I really do not know, so I am just trying.
Thank you for trying to help me, but that will not help. Globalstring 400 is for testing i chaging later
Reply
#8

SOLVED, i add leave fuction and add code direct in OnPlayerConnect!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)