Dialog Cmd problem
#1

Hello all , i get this error in my command Banlist
Код:
CMD:banlist(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 4)
    {
	    new ID, Query[256],string[135], DBResult: result;
		format(Query, sizeof(Query), "SELECT * FROM BANNED");
		result = db_query(bans, Query);
		ID = db_num_rows(result);
		db_free_result(result);
		format(string, sizeof(string), "%s\t      Ban List\n\n{FC4949}Banned Accounts:{FFFFFF} %d\n{FC4949}Permanent Bans: {FFFFFF}%d\n", string,ID,ID);
	 	ShowPlayerDialog( playerid, DIALOG_BANLIST, DIALOG_STYLE_INPUT, "Ban List",string, "Search", "Close" );
	    CMDMessageToAdmins(playerid,"BANLIST");
	    string = "\0", Query = "\0";
    }
	return 1;
}
The Dialog close when i put a name in the Cmd
Reply
#2

PHP код:
format(Querysizeof(Query), "SELECT * FROM BANNED");
result db_query(bansQuery); 
There's no reason to use format if you're not actually formatting anything.

And what's the error?
Reply
#3

(( test message,sorry
Reply
#4

When I put the name of a player, the command is closed, rather it closes the window of the command you understand?
Reply
#5

https://sampwiki.blast.hk/wiki/OnDialogResponse

You need to define DIALOG_BANLIST and make it do something in there.

I get what you're trying to do but I think it's not going to work. Here's an ideal way of doing it:

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_BANLIST)
    {
       if (
response)
       {
            if(
strlen(inputtext) < 3) return SendClientMessage(playerid, -1"You specified an invalid account name."); 
           new 
                
query[128], string[128], DBResultresult;
           
format (querysizeof(query), "SELECT * FROM BANNED Where Name = '%e'"inputtext); 
           
result db_query(bansquery); 
        }
    }

Et cetera, et cetera. Grab the data and store it in a string and show it if the ban exists.
Reply
#6

When i put that code
Pawno stops working xd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)