Create faction
#3

1. Wrong topic Scripting Discussion instead.
2. A few errors in it e.g. format(string3, sizeof(string3), Factions_FOLDER, ftag);
You missed out the ""s, %s and ftag would make it a number name rather than the name you typed. Just use tmp.
pawn Code:
if(strcmp(cmd, "/createfaction", true) == 0)
{
  if(IsPlayerConnected(playerid))
  {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
      SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /createfaction [tag]");
      return 1;
    }
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][AdminLevel] == 1338)
    {
      new string3[126];
      format(string3, sizeof(string3), "/Factions_FOLDER/%s",tmp);
      new File: fFile = fopen(string3, io_write);
      if (fFile)
    {
        new var[128];
        format(var, 128, "fName=%s\n","None");fwrite(fFile, var);
        format(var, 128, "fX=%f\n",0.000000);fwrite(fFile, var);
        format(var, 128, "fY=%f\n",0.000000);fwrite(fFile, var);
        format(var, 128, "fZ=%f\n",0.000000);fwrite(fFile, var);
        format(var, 128, "fRank1=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fRank2=%d\n",0);fwrite(fFile, var);
      format(var, 128, "fRank3=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fRank4=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fRank5=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fRank6=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fRank7=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fRank8=%d\n",0);fwrite(fFile, var);
      format(var, 128, "fRank9=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fRank10=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin1=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin2=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin3=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin4=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin5=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin6=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin7=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin8=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin9=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fSkin10=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fJoinRank=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fUseSkins=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fType=%d\n",0);fwrite(fFile, var);
        format(var, 128, "fRankAmount=%d\n",0);fwrite(fFile, var);
        fclose(fFile);
        format(str, sizeof(str), "You make faction with tag %s", ftag);
        SendClientMessage(playerid,COLOR_GRAD2, str);
      }
    }
    else
    {
      SendClientMessage(playerid, COLOR_GRAD1, "  You are not authorized to use that command!");
    }
  }
  return 1;
}
Reply


Messages In This Thread
Create faction - by gecatahh - 18.10.2009, 17:51
Re: Create faction - by gecatahh - 18.10.2009, 22:59
Re: Create faction - by Badger(new) - 18.10.2009, 23:31
Re: Create faction - by gecatahh - 19.10.2009, 00:22
Re: Create faction - by Arnold_Collins - 05.10.2011, 15:54

Forum Jump:


Users browsing this thread: 2 Guest(s)