AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Variable with IP.. (https://forums.alliedmods.net/showthread.php?t=246229)

IAmReallyCool 08-14-2014 03:36

Variable with IP..
 
I couldn't name this topic properly, but what I want to do is something like this without tries.. :

g_Lives[ "ip here (string)" ] = 2;

And than check it where i need it

new ip = get_user_ip...
if( g_Lives[ ip ] > 0 )

Flick3rR 08-14-2014 04:17

Re: Variable with IP..
 
That sounds strange and useless. It's impossible in the way you want it, but you can use a trie to set cells by IP.

HamletEagle 08-14-2014 05:09

Re: Variable with IP..
 
Just use the player id....

Jhob94 08-14-2014 05:30

Re: Variable with IP..
 
Quote:

Originally Posted by HamletEagle (Post 2183789)
Just use the player id....

Hamlet is right, you just need to use id.
And is better since you dont need to check user IP and ID is safe enough.

If you asking that because you need to save data, then that will not work because it will be reseted on map change. If you want to save data you should use nvault/sql or if you think you can, i would recomment some ini file. But if you want to save data, i guess you won't get help by saving it by IP. It would sound like non-steam so you would only get help if you want save by steam id.

Note: I said "If you asking that because you need to save data". I am not sure what you really need here.

IAmReallyCool 08-14-2014 08:41

Re: Variable with IP..
 
No, i need exactly this, not id, because i want to save player's lives for 1map, so they can't exploit it with reconnecting.

Flick3rR, could you please show me a simple example with trie usage?

YamiKaitou 08-14-2014 08:43

Re: Variable with IP..
 
What you want is not possible. You must use Trie's.

Searching would have given you a [urlhttps://forums.alliedmods.net/showthread.php?t=201872&highlight=trie]tutorial[/url] on how to use Trie's


All times are GMT -4. The time now is 13:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.