Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Scripting *Sorry If This Goes Somewhere Else*


astgenator
 Share

Recommended Posts

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 help

Ok 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")) + 1
Call 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

```
TOWN_ID = Int(GetVar("Scripts\charextras\" & TownID & ".ini", "TOWN", "MAX_ID")) + 1
Call 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...