Not sure how to use dini_Create
#1

What am I doing?
I am working on a police database system that officers can use to see if a player has any active warrans...

When a player (officer) clicks on a search textdraw, he gets a dialog where he can type the name of a player he wants to search.
Also officers can create warrants by clicking on a create warrant textdraw and then they will get a dialog where they have to type in the players name...

How is that suppose to work?
Well when a officer wants to make a warrant he will type in a players name and in scriptfiles/warrants, folder with that player name will be created. ((dini_Create))
When a officer wants to check if a player has a active warrant,the script will check if the folder exists with ((dini_Exists))

But the problem is...
When a player types in a name of a player he wants to add to the "wanted list" dini doesnt create a file with that players name...
What am I doing wrong?

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_NEWWARANT)
	    {
	        if(response == 1)
        	{
        	    new name = strval(inputtext);
        	    new namef[100];
        	    format(String,sizeof(String),"%s.ini",name);
                dini_Create("/Warrants/%s.ini");
	            SendClientMessage(playerid,COLOR_RED,"Warrant created!");
	            return 1;
	        }
	        return 1;
	    }
    if(dialogid == DIALOG_SEARCH)
    {
    	if(response == 1)
        {
        	new ime = strval(inputtext);
    	    new namef[100];
    	    format(namef,sizeof(namef),"%s.ini",name);
            if(dini_Exists("/Warrants/%s.ini"))
			{
            	SendClientMessage(playerid,COLOR_RED,"Warrant found!");
				//napravi_textdrawe_za_nadenu_tjeralicu_start

				//napravi_textdrawe_za_nadenu_tjeralicu_end
   			}
   			else{
   			    	SendClientMessage(playerid,COLOR_GREEN,"No active warrant");
   			    }
		}
        return 1;
    }
	return 0;
}
ps
Sorry for my bad english
Reply


Messages In This Thread
Not sure what am I doing wrong with dini_Create - by Slavica - 16.04.2017, 13:06
Re: Not sure how to use dini_Create - by ShadowMortar - 16.04.2017, 16:22
Re: Not sure how to use dini_Create - by ShadowMortar - 16.04.2017, 16:25
Re: Not sure how to use dini_Create - by Slavica - 16.04.2017, 16:38
Re: Not sure how to use dini_Create - by fatlirmorina - 16.04.2017, 18:18
Re: Not sure how to use dini_Create - by Slavica - 16.04.2017, 18:34
Re: Not sure how to use dini_Create - by Slavica - 16.04.2017, 18:40
Re: Not sure how to use dini_Create - by Slavica - 16.04.2017, 18:59
Re: Not sure how to use dini_Create - by Vince - 16.04.2017, 19:39
Re: Respuesta: Not sure how to use dini_Create - by Slavica - 17.04.2017, 13:13

Forum Jump:


Users browsing this thread: 1 Guest(s)