16.04.2012, 20:21
i got a clan system evrey thing work but when i create a clan its closed the samp serveri know the source of this problem but i dont know how to fix it
You See the dini_Create(CFile); its the problem but when i delet this i cant create a clan why please help me
PHP код:
if(!strcmp(clan_string, "create", true)) {
clan_string = strtok(cmdtext, idx);
format(CFile, sizeof CFile, "Clans/%s.txt",clan_string);
if(!strlen(clan_string)) return SendClientMessage(playerid, red, "USAGE /clan create [name] ");
if(dini_Isset(Name,"Clan")) return SendClientMessage(playerid, red, ".You allready in clan");
if(dini_Exists(CFile)) return SendClientMessage(playerid, red, ".That clan allready exist");
// clan file
dini_Create(CFile);
dini_Set(CFile,"// --- INFO ---","");
dini_Set(CFile,"Clan",clan_string);
dini_Set(CFile,"Leader",Name);
dini_IntSet(CFile,"ClanPlayers",1);
dini_IntSet(CFile,"ClanCash",0);
getdate(year, month, day);
format(CDate, sizeof CDate, "%d/%d/%d",day,month,year);
dini_Set(CFile, "ClanDate",CDate);
dini_Set(CFile,"// --- MEMBERS ---","");
dini_Set(CFile,Name,"ClanPlayer");
dini_Set(CFile,"// --- CLAN SYSTEM >> Created By 'BaNd'","");
// player clan
dini_Set(Name,"// --- CINFO ---","");
dini_Set(Name,"Clan",clan_string);
dini_IntSet(Name,"ClanLvl",4);
dini_IntSet(Name,"ClanLeader",1);
format(string, sizeof(string), ".you Created a Clan Names ''%s'' ",clan_string);
SendClientMessage(playerid, green, string);
SendClientMessage(playerid, green, "to Edit Something Use /edit [command] ");
return 1;
}