Results 1 to 10 of 15

Thread: MODDING : How to make virtual money.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Oct 2012
    Posts
    10
    Thanks
    2
    Thanked 22 Times in 8 Posts
    Right, and guid arg is useless too. I really like feedback, but you behave like a child.
    But OK... If the baby cry, I'll try to help...

    ********THREADS UPDATED:
    Code:
    loadMoneyFile(start)
    {
        if(!isPlayer(self))
            return;
        
        guid=self getGuid();
        if(!isDefined(guid) || guid==0)
            return;
        
        if(!isDefined(start))
            start=0;
            
        fid=openFile("money\\"+guid+".acc","read");
        if(fid!=-1)
        {
            self.money=int(fGetArg(fid,0));
            closeFile(fid);
        }
        else    // If no saved file found
        {
            self.money=start;
            self manageMoneyFile();    // Create and update the saved file with every kill
        }
    }
    
    manageMoneyFile()
    {
        if(!isPlayer(self))
            return;
        
        guid=self getGuid();
        if(!isDefined(guid) || guid==0)
            return;
        
        fid=openFile("money\\"+guid+".acc","write");
        closeFile(fid);
        
        fid=openFile("money\\"+guid+".acc","append");
        fPrintLn(fid,self.money);
        closeFile(fid);
    }
    Last edited by DisSle; 25th November 2012 at 21:08.

  2. #2
    Private
    Join Date
    Nov 2012
    Location
    Denmark, where else
    Posts
    27
    Thanks
    5
    Thanked 13 Times in 6 Posts
    I agree with izno, it is his code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •