18.10.2012, 10:40
Here is an example (taken from my script)
Using YINI + ZCMD.
PHP код:
CMD:banofflineplayer(playerid,params[])
{
new string[90],tname[200];
if(sscanf(params, "s[200]", tname)) return SendClientMessage(playerid,Yellow,"Correct Usage: /banofflineplayer [Player Name]");
new filestring[128];
format(filestring, sizeof(filestring), "/Users/%s.ini", tname);
if(!fexist(filestring)) return SendClientMessage(playerid,Lime, "That name doesn't exist");
else
{
new INI:File = INI_Open(filestring);
INI_SetTag(File, "data");
INI_WriteInt(File, "Banned",1);
INI_Close(File);
format(string, sizeof(string),"Success! You have banned %s", tname);
SendClientMessage(playerid, Lime,string);
}
return 1;
}