Save, read and compare user IP in fvault
I add my ip that I found in amx_who, with amx_save_ip "ip". Then I reconnect and says the user ip isn't in the file. What can I do?
PHP Code:
|
Re: Save, read and compare user IP in fvault
There are several major issues with this plugin. The first is that you aren't looking at the data in the vault at all. You get it from the vault but you don't actually do anything with it. Though I'm confident you're not setting and getting the data to and from the vault properly. You're also wrongly using both of your global variables. In fact, neither of those global variables should exist in this plugin.
It would probably be easier to help you with this if you can explain what you are actually trying to do. |
Re: Save, read and compare user IP in fvault
Quote:
What I'm trying to do is get the user ip when he joins and save it in a string. Then read the vault data and compare if the user IP is in it. The saveds ip are added manually with the command "amx_save_ip <ip>". If the user IP exist in the file, do something. Else, do other thing. |
Re: Save, read and compare user IP in fvault
Quote:
|
Re: Save, read and compare user IP in fvault
There are a few things that need fixing in your code, below is part of your problem. I recommend you instead use nvault with nvault array, it will be easier to store multiple pieces of data for a player, in this case name and IP, and also steam id if you want. With fvault, you'll need to string it all together and then pull the info back out. "Name: bugsy IP: 255.255.255.255:12345 SteamID: STEAM_0:0:12345"
Code:
Not tested: PHP Code:
|
Re: Save, read and compare user IP in fvault
Quote:
I'll learn nvault if I cant make this work with fvault. |
Re: Save, read and compare user IP in fvault
You do not need to store both the name and IP in the vault data since the name is stored as the key, so you'll always have it. Try this:
An assumption is 1 ip per player name PHP Code:
|
Re: Save, read and compare user IP in fvault
Quote:
|
| All times are GMT -4. The time now is 02:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.