if(strcmp(cmd, "/makefaction", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
if (PlayerInfo[playerid][pAdmin] < 8)
{
SendClientMessage(playerid, COLOR_RED, "Invalid admin level, you cannot use this command");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_USAGE, "USAGE: /makefaction [faction name] [faction ID]");
return 1;
}
new factionname[128];
factionname = strval(tmp);
new factionid = strval(tmp);
format(string, sizeof(string), "/settings/factions.cfg", playername);
new File: file = fopen(string, io_read);
new File:hFile;
hFile = fopen(string, io_append);
new var[32];//
format(var, 32, "%s fName\n", FactionInfo[factionid][fName]);fwrite(hFile, var);
format(var, 32, "%s fLeader\n", FactionInfo[factionid][fLeader]);fwrite(hFile, var);
format(var, 32, "%d fID\n", FactionInfo[factionid][fID]);fwrite(hFile, var);
format(var, 32, "%s fRank1\n", FactionInfo[factionid][fRank1]);fwrite(hFile, var);
format(var, 32, "%s fRank2\n", FactionInfo[factionid][fRank2]);fwrite(hFile, var);
format(var, 32, "%s fRank3\n", FactionInfo[factionid][fRank3]);fwrite(hFile, var);
format(var, 32, "%s fRank4\n", FactionInfo[factionid][fRank4]);fwrite(hFile, var);
format(var, 32, "%s fRank5\n", FactionInfo[factionid][fRank5]);fwrite(hFile, var);
fclose(hFile);
FactionInfo[factionid][fName] = factionname;
return 1;
}
Originally Posted by Assyria
Antonio, that was very stupid post, you think anyone will help you anymore?
|