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

Putvar


killerminx
 Share

Recommended Posts

My server won't read the code putvar when i post this

```
npcnum=GetMapNPCnumber(GetPlayerMap(index),2)
          start_msg=getvar("scripts\mapextras\" & npcnum & ".ini", "QUEST", "Start_Msg")
          Call playermsg(index, name & " : " & start_msg, 15)
          Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", npcnum, 1 )
```
its been working but the put var won't work i don't know wat to do.
Link to comment
Share on other sites

I'm assuming you've already declared some of those variables beforehand.

First
          start_msg=getvar("scripts\mapextras\" & npcnum & ".ini", "QUEST", "Start_Msg")

Make sure that the .ini file exists.

Second

Try:

          Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", int(npcnum), 1 )
Link to comment
Share on other sites

> npcnum=GetMapNPCnumber(GetPlayerMap(index),2)
>           start_msg=getvar("scripts\mapextras\" & npcnum & ".ini", "QUEST", "Start_Msg")
>           Call playermsg(index, name & " : " & start_msg, 15)
>           Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", npcnum, 1 )

The first thing I notice on almost every question, not entirely positive if it actually matters but it will sure make things look more clean, nobody puts spaces between their definitions and math equations. Like, start_msg=getvar. If it were,
start_msg = GetVar
like I said, not positive if it helps, but it will work this way.

Why are you making a separate ini folder for each monster and person? That is pointless and takes up a ton of space.

> If GetVar("scripts\charextras\Players.ini", GetPlayerName(Index), "Quest") = "" Then
>   Call PutVar("scripts\charextras\Players.ini", GetPlayerName(Index), "Quest", "0")
> End If

I haven't tested this, but I believe that would actually work. Also, this is assuming you want to start your definition of whatever it is. Also, what this does is, it will make a list under that persons name and puts Quest=0 under their name. I really don't understand what you are getting at, but I will see how I can help you.. If you want to put something in the "Quest" section, just do this.

> If Blah Blah Blah Then
> Call PutVar("Players.ini", GetPlayerName(Index), "Quest", ConvertToString(NpcNum))

This will put the Npc's number in the Quest=0\. The 0 will change to whatever the Npc's number is.
Link to comment
Share on other sites

@killerminx:

> Well the putvar still aint working so i grabbed me a new a server.
>
> The reason i am making a ini file for each npc is that i can now script more than one quest per map and also have them in more than one quest

Just grab their name and label the quests.. No reason to more than 1 file.
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...