[INI]Groupname detect?
#7

I made this now:
Код:
dcmd_creategroup(playerid, params[])
{
	new groupname ,g = GetFreeGroupID();
	new pName4[MAX_PLAYER_NAME];
	GetPlayerName(playerid,pName4,sizeof(pName4));
	//if(!IsPlayerAdmin(playerid)) return 0;
	if(sscanf(params,"s",groupname)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /creategroup [Groupname]");
	if(strlen(params) > 49 || strlen(params) < 3) return SendClientMessage(playerid, COLOR_RED, "Usage: /groupcreate [Group name 3-50 characters])!");
	if(fexist(GroupFile(g))) return SendClientMessage(playerid,COLOR_RED,"This groupname already exist.");
	else
	{
        fcreate(GroupFile(groupname));
		format(GroupInfo[g][gName], 35, "%s", groupname);
		format(GroupInfo[g][gOwner], 25, "%s", pName4);
		new INI:file = INI_Open(GroupFile(groupname));
		INI_WriteString(file, "GroupName", params);
		INI_WriteString(file, "GroupOwner", pName4);
		INI_WriteInt(file, "GroupMoney", 0);
		INI_WriteInt(file, "GroupScore", 0);
		INI_WriteInt(file, "GroupKills", 0);
		INI_WriteInt(file, "GroupDeaths", 0);
		INI_Close(file);
	}
    return 1;
}
How can i save groupname as the file like if i do:
Код:
/creategroup test
The file will be named test.ini
I tested this code but then the file appears in numbers like :116.ini
And when i do /creategroup test2 there dont will be made a new file.
How can i fix those problems?

Thanks Admigo
Reply


Messages In This Thread
[INI]Groupname detect? - by Admigo - 18.09.2012, 17:22
Re: [INI]Groupname detect? - by Jochemd - 18.09.2012, 17:23
Re: [INI]Groupname detect? - by Admigo - 18.09.2012, 17:30
Re: [INI]Groupname detect? - by Jochemd - 18.09.2012, 17:53
Re: [INI]Groupname detect? - by Admigo - 18.09.2012, 17:59
Re: [INI]Groupname detect? - by Jochemd - 18.09.2012, 18:29
Re: [INI]Groupname detect? - by Admigo - 18.09.2012, 19:41

Forum Jump:


Users browsing this thread: 3 Guest(s)