Код:
COMMAND:createfaction(playerid,params[])
{
new string[80],file[40],name;
if(GetPlayerMoney(playerid) < 150000) return SendClientMessage(playerid,COLOR_RED,"You're not allowed to do this");
if(sscanf(params,"s",name)) return SendClientMessage(playerid,COLOR_GREY,"USAGE:/createfaction [faction name]");
format(file,sizeof(file),"%s.ini",name);
if(!fexist(file))
{
dini_Create(file);
dini_IntSet(file, "Name",FactionInfo[fname] = name);
format(string,sizeof(string),"Succesfully created faction: %s",name);
SendClientMessage(playerid,COLOR_YELLOW,string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This team already exists");
}
return 1;
}
Код:
enum fInfo
{
fowner,
fname,
ftype,
}
new FactionInfo[MAX_PLAYERS][pInfo];