24.02.2016, 17:13
Hi. I'm working on my faction system and when you create a faction, you're supposed to get a message with the information you entered.
Everything is writing just fine on the ini file. If I try to create a faction on a faction slot wih atleast 1 member, it says it's already occupied, and the faction name also shows up on the ini file just like it's supposed to.
However, when you use the command, it says: "You created (*should be fNamehere*) faction at slot (slot)." < The faction name doesn't seem to load.
When I use other commands that should return the fName string, it also doesn't show up. Even though the writing works fine and the integers seem to load fine aswell.
Thanks for any help provided.
Код:
CMD:createfaction(playerid,params[]){
if(PlayerInfo[playerid][pAdmin] >= 4){
new fid, name[128];
new string[512];
if(sscanf(params, "ds[128]", fid, name)) return SendClientMessage(playerid, -1, "USAGE: /createfaction [Faction-Slot] [Faction-Name]");
if(fid <= 0 || fid >= 16) return SendClientMessage(playerid, -1, "Invalid Faction ID. ( 1-15 )");
if(FactionInfo[fid][fMembers] >= 1) return SendClientMessage(playerid, -1, "Faction slot occupied.");
new Factionfile[32];
format(Factionfile, sizeof(Factionfile), "factions/%d.ini", fid);
new INI:File = INI_Open(Factionfile);
INI_SetTag(File,"data");
INI_WriteString(File,"Faction Name",name);
INI_WriteInt(File,"Faction Type",0);
INI_WriteInt(File,"Total Members",0);
INI_Close(File);
format(string, sizeof(string), "You created %s faction at slot %d.", FactionInfo[fid][fName], fid);
printf("%s has created faction %s at slot %d.", GetName(playerid), FactionInfo[fid][fName], fid);//ChatLog
return SendClientMessage(playerid, 0xffffffff, string);
}
return 1;
}
However, when you use the command, it says: "You created (*should be fNamehere*) faction at slot (slot)." < The faction name doesn't seem to load.
When I use other commands that should return the fName string, it also doesn't show up. Even though the writing works fine and the integers seem to load fine aswell.
Thanks for any help provided.

