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(playerid, retrieveIP, sizeof(retrieveIP));
    
gpci(playerid, retrieveGCPI, sizeof(retrieveGCPI));
    
    
format(Query, sizeof(Query), "SELECT * FROM `Bans` WHERE `Name` = '%s' COLLATE NOCASE OR `GPCI` = '%s' OR `IP` = '%s' LIMIT 1", GetPlayerName(playerid), retrieveGCPI, retrieveIP);
    
queryresult = db_query(Database, Query);
    if(
db_num_rows(queryresult))
    {
        
db_get_field_assoc(queryresult, "Name", retrieveName, sizeof(retrieveName));
        
db_get_field_assoc(queryresult, "BannerName", retrieveBannedBy, sizeof(retrieveBannedBy));
        
db_get_field_assoc(queryresult, "Reason", retrieveReason, sizeof(retrieveReason));
        
retrieveBanDate = db_get_field_assoc_int(queryresult, "BANDATE");
        
retrieveDuration = db_get_field_assoc_int(queryresult, "UNBANDATE");
        if(
gettime() - retrieveDuration > (retrieveDuration - retrieveBanDate))
        {
            
format(Query, sizeof(Query), "Your ban expired on %s \nWelcome back %s!", TimestampToDateTime(retrieveDuration), GetPlayerName(playerid));
            
SendClientMessage(playerid, COLOR_SERVER, Query);
            
format(Query, sizeof(Query), "DELETE * FROM `Bans` WHERE `Name` = '%s'", retrieveName);
            
queryresult = db_query(Database, Query);
            
        }
        else
        {
            new 
globalString[400];
            
format(globalString, sizeof(globalString), "Username: %s - Banned IP: %s", retrieveName, retrieveIP, retrieveBannedBy);
            return 
ShowPlayerDialog(playerid, DIALOG_BANINFO, DIALOG_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(globalString, sizeof(globalString), "Username: %s - Banned IP: %s", retrieveName, retrieveIP, retrieveBannedBy);
return 
ShowPlayerDialog(playerid, DIALOG_BANINFO, DIALOG_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: