dragonlord52 Posted January 4, 2009 Author Share Posted January 4, 2009 Could anyone tell me why the variables I want put in the .ini file isn't getting put in there? I've made sure the NPC doesn't die when I hit it as that is what I thought the issue was at first but it didn't fix it.> ' Executes when a player presses the CONTROL key.> Sub OnAttack(Index, Damage)> Dim Target> > If Int(Damage) > 0 Then> If Int(GetPlayerTarget(Index)) > 0 Then> Target = GetPlayerTarget(Index)> map = GetPlayerMap(Index)> x = GetNpcX(map, Target)> y = GetNpcY(map, Target)> Call DamagePlayer(Index, Target, Damage)> Call SpellAnim(1, map, x, y)> Else> Target = GetPlayerTargetNPC(Index)> map = GetPlayerMap(Index)> x = GetNpcX(map, Target)> y = GetNpcY(map, Target)> level = GetPlayerLevel(Index)> points = GetPlayerPOINTS(Index)> Call DamageNPC(Index, Target, Damage)> Call SpellAnim(1, map, x, y)> Call WeaponSkill(Index)> Call PutVar("scripts\characters\" & GetPlayerName(Index) & ".ini", "TEMP", "level", "" & level & "")> Call PutVar("scripts\characters\" & GetPlayerName(Index) & ".ini", "TEMP", "points", "" & points & "")> End If> End If> End SubThanks, the help is much appreciated! Link to comment Share on other sites More sharing options...
DarkMazer Posted January 4, 2009 Share Posted January 4, 2009 I don't really see why there'd be a problem, unless the folder "characters" does not exist inside the folder "scripts"… If it doesn't, add it and try again.If it does, though, try changing:> "" & level & ""to> levelSame goes for points. If that doesn't work, just try messing around with it for a while. I've noticed that the variable never seems to be the right type you want it to be when you're working with PutVar… Link to comment Share on other sites More sharing options...
ddunit Posted January 4, 2009 Share Posted January 4, 2009 I think it doesn't go in .ini but in main.txt… Link to comment Share on other sites More sharing options...
Eviltyphoon Posted January 4, 2009 Share Posted January 4, 2009 Did you add this command```Call WeaponSkill(Index)```? Because it doesn't normally exist.And, as DarkMazer said:Change```"" & level & ""```into```level``` Link to comment Share on other sites More sharing options...
dragonlord52 Posted January 4, 2009 Author Share Posted January 4, 2009 @DarkMazer:> I don't really see why there'd be a problem, unless the folder "characters" does not exist inside the folder "scripts"… If it doesn't, add it and try again.> If it does, though, try changing:to Same goes for points. > > If that doesn't work, just try messing around with it for a while. I've noticed that the variable never seems to be the right type you want it to be when you're working with PutVar...OMG I'm such a n00b sometimes xD that folder is suppose to be charextras xDAnd yes, Call WeaponSkill is a script in progress that I have created.EDIT: I have edited the script with your suggestions and still nothing happens Link to comment Share on other sites More sharing options...
Eviltyphoon Posted January 4, 2009 Share Posted January 4, 2009 Another thing:You didn't declare x, y, map, level, pointsTry this:```' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage) Dim Target Dim x Dim y Dim map Dim level Dim points If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) map = GetPlayerMap(Index) x = GetNpcX(map, Target) y = GetNpcY(map, Target) Call DamagePlayer(Index, Target, Damage) Call SpellAnim(1, map, x, y) Else Target = GetPlayerTargetNPC(Index) map = GetPlayerMap(Index) x = GetNpcX(map, Target) y = GetNpcY(map, Target) level = GetPlayerLevel(Index) points = GetPlayerPOINTS(Index) Call DamageNPC(Index, Target, Damage) Call SpellAnim(1, map, x, y) Call WeaponSkill(Index) Call PutVar("scripts\characters\" & GetPlayerName(Index) & ".ini", "TEMP", "level", "" & level & "") Call PutVar("scripts\characters\" & GetPlayerName(Index) & ".ini", "TEMP", "points", "" & points & "") End If End IfEnd Sub``` Link to comment Share on other sites More sharing options...
dragonlord52 Posted January 6, 2009 Author Share Posted January 6, 2009 Everything in there works fine without the decelerations just so you know. Since I don't use any of those variables in the PutVar commands they shouldn't effect it all.I still don't see the use of dim when you don't always have to have to make things work as every working script I've made (none of them but the skill script are on here) work without it. 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