SA-MP Forums Archive
Problem show dialog! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem show dialog! (/showthread.php?tid=623794)



Problem show dialog! - Cerealguy - 05.12.2016

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! 



Re: Problem show dialog! - TheRohlikar - 05.12.2016

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.


Respuesta: Re: Problem show dialog! - Cerealguy - 05.12.2016

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


Re: Problem show dialog! - TheRohlikar - 05.12.2016

Have you tried "prints" ?
Where it ends...


Respuesta: Re: Problem show dialog! - Cerealguy - 05.12.2016

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


Re: Problem show dialog! - TheRohlikar - 05.12.2016

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


Respuesta: Re: Problem show dialog! - Cerealguy - 05.12.2016

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


Respuesta: Problem show dialog! - Cerealguy - 05.12.2016

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