Raised This Month: $ Target: $400
 0% 

how to hold user ip/authid/userid in plugin ??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 12-03-2010 , 11:53   how to hold user ip/authid/userid in plugin ??
Reply With Quote #1

Hey, I would like to make a plugin that gives an advertisement messages...

PHP Code:
like msgShown[33] = 0;

swtich(msgShown[id]){
   case 
0client_print(idprint_chat"ad number 1"msgShown[id]++;
   case 
1client_print(idprint_chat"ad number 2"msgShown[id]++;
   case 
2client_print(idprint_chat"ad number 3"msgShown[id]++;
   case 
3client_print(idprint_chat"ad number 4"msgShown[id]++;

But if user disconnects, the messages will be shown from start...

These 4 messages should be displayed in order within 1 map :]

Should it look like:

PHP Code:
new userid get_user_userid(id);

client_print(useridprint_chat"ad number 1"msgShown[userid]++; 
reinert is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-03-2010 , 13:41   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #2

If they disconnect then there is no point in trying to send them a message. You cannot use a userid in place of a player entity index.
__________________
fysiks is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 12-04-2010 , 01:50   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #3

I mean reconnecting instead of disconnecting...

By the way, it's just an example with ads, I've other idea ;)
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-04-2010 , 02:12   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #4

You can use Tries to save player data by their name/authid/ip/userid (string format).
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 12-04-2010 , 02:28   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #5

Um is there another way ? Because tries saves for longer time than 1 map . I would like to make very simple plugin, that just gives warnings, for example after 3rd warning u get kick, and I want to save warning numbers for player, because when he comes back. if he gets 1 warning more, he will be banned...

4 warnings - kick
player connects again, he still have 4 warnings, so 1 more, banned !
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-04-2010 , 02:31   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #6

Tries do not save over map.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 12-04-2010 , 02:52   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #7

Ok...

Maybe an example ? (This http://forums.alliedmods.net/showthread.php?t=74753 tutorial didn't me explain anything ;D)
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-04-2010 , 03:00   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #8

Quote:
Originally Posted by reinert View Post
Ok...

Maybe an example ? (This http://forums.alliedmods.net/showthread.php?t=74753 tutorial didn't me explain anything ;D)
That's not a Trie tutorial. That's a custom include that enhances features for Tries.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 12-04-2010 , 03:20   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #9

So I didn't found real tutorial over snippets/tutorials... Could someone give me an example ?
reinert is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-04-2010 , 18:24   Re: how to hold user ip/authid/userid in plugin ??
Reply With Quote #10

I think this is all that you will need:

PHP Code:
new Trie:g_tTrieName

public plugin_init()
{
    
g_tTrieName TrieCreate()
}

// ...

    // set the value
    
TrieSetCell(g_tTrieNameszAuthID1)

// ...

    // get the value
    
new currentvalue
    
if( TrieGetCell(g_tTrieNameszAuthIDcurrentvalue) )
    {
        
SteamID found in Triecurrentvalue is . . . the current value :)
    } 
__________________
fysiks 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 11:24.


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