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

PutVar


Choseal
 Share

Recommended Posts

Hey, it's me again, sorry for all the questions :P

I made this little script that will help me report hackers when they are somewhere they shouldn't be:

                Case 3
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Login_Name", Getplayerlogin(Index))
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Name", Getplayername(Index))
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Sprite", Getplayersprite(Index))
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Current_Map", Getplayermap(Index))
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_X", Getplayerx(Index))
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Y", Getplayery(Index)) Exit Sub
End Select
End Sub

Now the problem is, it works, and it makes the file with the characters name, but it's a .Dat file, and I can't open it with notepad, it's completely empty. (0 Kb)

Did I do something wrong? (This is my first time working with put and get vars)
Link to comment
Share on other sites

@Choseal:

> Hey, it's me again, sorry for all the questions :P
>
> I made this little script that will help me report hackers when they are somewhere they shouldn't be:
>
>                 Case 3
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Login_Name", Getplayerlogin(Index))
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Name", Getplayername(Index))
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Sprite", Getplayersprite(Index))
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Current_Map", Getplayermap(Index))
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_X", Getplayerx(Index))
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Y", Getplayery(Index)) Exit Sub
> End Select
> End Sub
>
> Now the problem is, it works, and it makes the file with the characters name, but it's a .Dat file, and I can't open it with notepad, it's completely empty. (0 Kb)
>
> Did I do something wrong? (This is my first time working with put and get vars)

The dat files are usually in the \Accounts\ folder, there's no reason it should generate a dat file in the \Scripts
security\ folder
Though, I should point out, you have a sytntax error (afew of them).
Firstly, "Eit Sub" should be a on a new line, not after the final putvar.
Also, you can't have, e.g.:
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Login_Name", Getplayerlogin(Index))
It would need to be:
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Login_Name", "" & Getplayerlogin(Index) & "")
Let me know what happens.
Link to comment
Share on other sites

Ooh, sorry, the Exit Sub was just a mistake cause by me deleting a sentence while posting on the forum, it was OK in the main.txt.

Ok, I fixed it now, but I still get that .Dat file, altough I now noticed it didn't have a file extension at all.. o.o

```
                Case 3
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Login_Name", "" & Getplayerlogin(Index) & "")
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Name", "" & Getplayername(Index) & "")
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Sprite", "" & Getplayersprite(Index) & "")
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Current_Map", "" & Getplayermap(Index) & "")
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_X", "" & Getplayerx(Index) & "")
Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Y", "" & Getplayery(Index) & "")
Exit Sub
End Select
End Sub
```
Link to comment
Share on other sites

@Choseal:

> Ooh, sorry, the Exit Sub was just a mistake cause by me deleting a sentence while posting on the forum, it was OK in the main.txt.
>
> Ok, I fixed it now, but I still get that .Dat file, altough I now noticed it didn't have a file extension at all.. o.o
>
> ```
>                 Case 3
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Login_Name", "" & Getplayerlogin(Index) & "")
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Name", "" & Getplayername(Index) & "")
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Sprite", "" & Getplayersprite(Index) & "")
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Current_Map", "" & Getplayermap(Index) & "")
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_X", "" & Getplayerx(Index) & "")
> Call putvar("Scripts\security\" & GetPlayerName(Index) & ".ini", "MAP", "Player_Y", "" & Getplayery(Index) & "")
> Exit Sub
> End Select
> End Sub
> ```

Can you post me a screenshot of the folder containing the .dat files?
Link to comment
Share on other sites

This works for me…

2 suggestions: Try capitalizing the .ini bit. The second is that you create the .ini in the source and use sadscript to put variables into it - shouldn't be needed but sometimes computers can be stupid.
Link to comment
Share on other sites

@Choseal:

> ![](http://i40.tinypic.com/wb9sb5.jpg)
>
> I can change the file into a .ini file, but it's still empty..
>
> And sorry Crimson, I wouldn't know how to make a .ini file in the source..

[off-topic]OMFG, YOU'RE DUTCH! Welcome to the Club.[/off-topic]

Regards,
  Godlord.
Link to comment
Share on other sites

@Choseal:

> Yep, I'm using EE 2.7.
>
> So..With those commands, I just need to make that map, and it automaticly generates a .ini file with the players name, etc. right?

It depends which sub you posted that in; did you put it as Case 3 for a scripted tile?

You could just put it in the OnNewChar sub (I think that's what it's called) for it to auto-generate when a player logs into the game.  Or, you could put it in the OnMapLoad sub, etc.
Link to comment
Share on other sites

@Choseal:

> Lol, thank you, do I need to pay some kind of entrance fee? x3
>
> *Takes a quick bow* I've heared a lot about you! :P
>
> [/Goes back on-topic]
>
> Edit: Omg, fleshlight >.> xD

It's just the Dutch board.

@Bobosk:

> by chance, in your folder options, are you "Hiding extentions of known file types"..?
> (i don't see why this would be a problem, but humor me xD)

That could be possible though. But that still wouldn't explain why the files are empty.

Regards,
  Godlord.
Link to comment
Share on other sites

Nope, that wasn't on, but I dont think that would have fixed anything anyway, because it didn't show a pictogram either.

I've uploaded the file, using winRar, because MediaFire wouldn't let me upload 0kb files x3

http://www.mediafire.com/?sharekey=01363181f915f377391d7d881749d3a7e04e75f6e8ebb871
Link to comment
Share on other sites

Try this:
```
                Case 3
Dim path
path = "Scripts\security\" & GetPlayerName(Index) & ".ini"
Call putvar("" & path, "MAP", "Login_Name", "" & Getplayerlogin(Index) & "")
Call putvar("" & path, "MAP", "Player_Name", "" & Getplayername(Index) & "")
Call putvar("" & path, "MAP", "Player_Sprite", "" & Getplayersprite(Index) & "")
Call putvar("" & path, "MAP", "Current_Map", "" & Getplayermap(Index) & "")
Call putvar("" & path, "MAP", "Player_X", "" & Getplayerx(Index) & "")
Call putvar("" & path, "MAP", "Player_Y", "" & Getplayery(Index) & "")
        Exit Sub
  End Select
End Sub

```It may help.
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...