06.11.2009, 18:06
So been working on this for too long.. stupid thing just doesnt work..:
What happens in I /setclan TestClan [clan]
Clientmessage: Clan using clantag was successfully created (so no names).
A file is made in clans folder called ".ini" (so no name).
Please help me I'm desperite :P
pawn Код:
if(strcmp(cmd, "/setclan", true) == 0)
{
if(AccountInfo[playerid][AdminLevel] >= 4)
{
new clanname, clantag;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /setclan [clan name] [tag]");
return 1;
}
clanname = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /setclan [clan name] [tag]");
tmp = strtok(cmdtext, idx);
clantag = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /setclan [clan name] [tag]");
format(string, sizeof(string), "clans/%s.ini", clanname);
if(dini_Exists(string)) return SendClientMessage(playerid,COLOR_RED, "Clan exists already");
if(!dini_Exists(string))
{
dini_Create(string);
}
dini_Set(string, "clantag", clantag);
format(string, sizeof(string), "Clan %s using clantag %s was successfully created", clanname, clantag);
SendClientMessage(playerid, COLOR_GREEN, string);
SendClientMessage(playerid, COLOR_GREEN, "Use /setclanmember [clan name] [player ID] to add a clanmember");
return 1;
}
else return SendClientMessage(playerid,COLOR_RED, "You're not authorized to use that command");
}
Clientmessage: Clan using clantag was successfully created (so no names).
A file is made in clans folder called ".ini" (so no name).
Please help me I'm desperite :P