[Help] Class Selection
#1

Hello I am making a /saveselection command for people who would like to create their own selection. It all went good with no errors, warnings and such. But somehow the .txt file that should be saved doesn't save. Could anyone help me?
This is my script:

pawn Код:
new idx;
    new tmp[256];
    new cmd[256];
    cmd = strtok(cmdtext, idx);
    //-----------------
    if(strcmp(cmdtext,"/SaveSelection",true) == 0 || strcmp(cmdtext, "/SaveS", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(!IsPlayerAdmin(playerid))
        {
          SendClientMessage(playerid, COLOR_GREY, "You're not logged in as admin !");
          return 1;
            }
        tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "Command: /Saveclass [Class name]");
                return 1;
            }
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Command: /saveclass [Classname]");
            {
                new Float:X, Float:Y, Float:Z, filestr[64], string[128], Float:Ang;
                GetPlayerPos(playerid, X, Y, Z);
                GetPlayerFacingAngle(playerid, Ang);
                format(filestr, sizeof(filestr), "%s.txt", tmp);
                if(fexist(filestr)) return SendClientMessage(playerid, COLOR_WHITE, "There's already a file with that name! Please choose another filename.");
                {//---Rest comes here.
Reply
#2

Second page: Bumb.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)