28.02.2014, 09:20
pawn Код:
CMD:afactionname(playerid, params[])
{
new
name[128], id, string[128];
if(PlayerInfo[playerid][pAdmin] < 2) return SCM(playerid, COLOR_GREY,"[Error]: You're not authorized to use this command.");
if(sscanf(params, "ds[128]", id, name)) return SendClientMessage(playerid, COLOR_GREY, "[Usage]: /afactionname [factionID] [name]");
if(id < 1 || id > 10 ) return SCM(playerid, COLOR_LIGHTRED, "Invalid faction ID.");
for(new f = 1;f < sizeof(FactionInfo);f++)
{
if(id == f)
{
FactionInfo[id][fName] = name;
new file4[40];
format(file4, sizeof(file4), FPATH, id);
new INI:File = INI_Open(file4);
INI_SetTag(File,"data");
INI_WriteString(File,"Name", FactionInfo[id][fName]);
INI_Close(File);
}
}
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "You have changed the name of this faction to %s.", FactionInfo[id][fName]);
return 1;
}