astgenator Posted July 13, 2009 Author Share Posted July 13, 2009 I am currently scripting a town system into my game and i am puzzled.i want to set a variable to +1 of something in a separate INI file.Ill show you what i mean.```Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "TOWN", "ID", 0)Now i want it to be instead of 0 something like"Scripts\charextras\" & TownID & ".ini", "TOWN", "MAX_ID", + 1```would i do this?```TOWN_ID = (GetVar("Scripts\charextras\" & TownID & ".ini", "TOWN", "MAX_ID") + 1)Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "TOWN", "ID", (TOWN_ID))```Thanks to anyone that can helpOk i also want to add one to the ini so the ID changes each time. This is what i've come up with```TOWN_ID = Int(GetVar("Scripts\charextras\" & TownID & ".ini", "TOWN", "MAX_ID")) + 1Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "TOWN", "ID", TOWN_ID)Call PutVar("Scripts\charextras\" & TownID & ".ini", "TOWN", "MAX_ID", TOWN_ID)``` Link to comment Share on other sites More sharing options...
emblem Posted July 13, 2009 Share Posted July 13, 2009 ```TOWN_ID = Int(GetVar("Scripts\charextras\" & TownID & ".ini", "TOWN", "MAX_ID")) + 1Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "TOWN", "ID", TOWN_ID)```I used int because it probably will complain about adding a number to a string lol. Link to comment Share on other sites More sharing options...
astgenator Posted July 13, 2009 Author Share Posted July 13, 2009 thanks, it was bugging me Link to comment Share on other sites More sharing options...
emblem Posted July 13, 2009 Share Posted July 13, 2009 I guess I probably should have moved this. 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