Raised This Month: $ Target: $400
 0% 

Variable with IP..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IAmReallyCool
Member
Join Date: Nov 2013
Old 08-14-2014 , 03:36   Variable with IP..
Reply With Quote #1

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 )
IAmReallyCool is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-14-2014 , 04:17   Re: Variable with IP..
Reply With Quote #2

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.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-14-2014 , 05:09   Re: Variable with IP..
Reply With Quote #3

Just use the player id....
__________________
HamletEagle is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-14-2014 , 05:30   Re: Variable with IP..
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
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.
__________________
Jhob94 is offline
IAmReallyCool
Member
Join Date: Nov 2013
Old 08-14-2014 , 08:41   Re: Variable with IP..
Reply With Quote #5

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?
IAmReallyCool is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-14-2014 , 08:43   Re: Variable with IP..
Reply With Quote #6

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
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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