What's wrong ? :c
#1

Hey guys, i have a little problem and i don't know what is wrong ?? ; o
Ekhm... Why the y_ini write the same thing 2 times ? ;c

I have command something like this:

Код:
CMD:unban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdminLevel] > 4)
	{
	    new unstring[64];
		format(unstring, sizeof(unstring), "/users/%s.ini", params);
 		if(!fexist(unstring)) return SendClientMessage(playerid, COLOR_RED, "This player is not in base !");
 		{
			new INI:File = INI_Open(unstring);
			INI_WriteInt(File,"Banned",0);
			INI_Close(File);
			SendClientMessage(playerid, COLOR_GREENMDLY, "You have succesfully unban a player !");
   		}
	}
	return 1;
}
but in some nick.ini it's look like:

Код:
Banned = 0
[data]
Pass = 96FC41390CE2C452E76226DB7D9A0A50E83241F216F65879C389277F6C2362082BAB1A5BE9E3F61DEF5FF02B8D50A647022FB70FD6084A20F574279C88E1C50C
Admin = 0
Vip = 0
Banned = 1
Exp = 47
Kills = 0
Deaths = 1
Money = 10000
Lvl = 0
Why ? ;c

Greetings, micol.
Reply
#2

Here you have to set a tag, ex:

PHP код:
new INI:File INI_Open(unstring);
INI_WriteInt(File,"Banned",0);
INI_Close(File); 
Should be:

PHP код:
new INI:File INI_Open(unstring);
INI_SetTag(File"data");
INI_WriteInt(File,"Banned",0);
INI_Close(File); 
Take a look at my Tutorial:

https://sampforum.blast.hk/showthread.php?tid=388612

EDIT:

Your command will give you alot of errors when you compile it. Go take a look at my Tutorial if you want.
Reply
#3

Thanks for help. All works now. : D

Greeting, micol.
Reply
#4

Your welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)