escfoe2 Posted July 12, 2009 Author Share Posted July 12, 2009 :huh: I'm in need of help but its very simple I just don't know how or if there is a way to do what I need! What I am trying to do is add + 1 to a variable in a .ini file. Here is the trying example. Call PutVar("Scripts\Rank\" & GetPlayerName(Index) & ".ini", "Player Rank", "num_npc_kls", !@#$) I want !@#$ to just be bumped up + 1! Is there a way?? :icon_crap: Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 12, 2009 Share Posted July 12, 2009 I'm telling you right now, you'd crash your main if you added this:```Call PutVar("Scripts\Rank\" & GetPlayerName(Index) & ".ini", "Player Rank", "num_npc_kls", [email]!@#$[/email])```Since the "email" tag isn't supported in VBScripting.Anyway, I'm going to assume you have a number in that rank, and you want the number to be raised by one.This is actually pretty easy; you just need to get the value, convert it to a number, add 1 to that number, and put it back, like so:```Dim NumberNumber = Int(GetVar("Scripts\Rank\" & GetPlayerName(Index) & ".ini", "Player Rank", "num_npc_kls"))Number = Number + 1Call PutVar("Scripts\Rank\" & GetPlayerName(Index) & ".ini", "Player Rank", "num_npc_kls", Number)```That _should_ work.Also, try to be abit less sloppy with formatting in your posts; think of it this way; would the CEO of Nintendo, ask for help on something code-related, like that (using email tags, and making the size really big, etc)? Link to comment Share on other sites More sharing options...
Godlord Posted July 12, 2009 Share Posted July 12, 2009 > Call PutVar("db.ini", "section", "number", Int(GetVar("db.ini", "section", "number")) + 1)@AR: you won, but I like my way more ;D.Regards, Godlord. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now