SA-MP Forums Archive
[Help] Class Selection - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Class Selection (/showthread.php?tid=107696)



[Help] Class Selection - Benne - 10.11.2009

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.



Re: [Help] Class Selection - Benne - 10.11.2009

Second page: Bumb.