YINI unban help. - 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: YINI unban help. (
/showthread.php?tid=376442)
YINI unban help. -
romas3110 - 10.09.2012
Ok, so here's the deal, i've been working on a unban command using zcmd,sscanf,yini.
it opens the users profile fine, but it doesn't overwrite the old data, it just writes a new line.
can anyone help me out here?, any help will be much appreciated.
pawn Code:
CMD:unban(playerid, params[])
{
new name[24],str[128];
if(sscanf(params, "s", name)) return SendClientMessage(playerid, grey, "Usage: /unban [playername]");
new string[32];
format(string,sizeof(string),PATH,name);
INI_Load(string);
if(!fexist(string)) return SendClientMessage(playerid, red, "Invalid Playerid / Name.");
INI_WriteInt("Banned",0);
INI_Close(File);
format(str,sizeof(str),"Account unbanned 'Name: %s' ",name);
SCM(playerid, red, str);
return 1;
}
Re: YINI unban help. - HuSs3n - 10.09.2012
you need to use
pawn Code:
INI_SetTag(File,"Your_Data_Tag");
Re: YINI unban help. -
romas3110 - 10.09.2012
Thanks +rep