Raised This Month: $ Target: $400
 0% 

Blockmaker SteamID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
P1raten
Senior Member
Join Date: Feb 2010
Old 02-07-2013 , 08:38   Re: Re: Blockmaker SteamID
Reply With Quote #1

Quote:
Originally Posted by WeeZick View Post
Well whats the right section then?
And if you dont understand i want to store the (STEAMID) not some flags.
I did understand. Im just wondering WHY you would want to authenticate users to use your blockmaker instead of just using flags.
__________________
No salvation. Only madness.
P1raten is offline
WeeZick
Member
Join Date: Oct 2012
Location: Gothenburg, Sweden
Old 02-07-2013 , 09:32   Re: Blockmaker SteamID
Reply With Quote #2

Beacouse i want when someone that dont have access to /bm writes it then i want it to say "You'r SteamID didnt get a match!"
WeeZick is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 02-07-2013 , 10:11   Re: Blockmaker SteamID
Reply With Quote #3

Quote:
Originally Posted by WeeZick View Post
Beacouse i want when someone that dont have access to /bm writes it then i want it to say "You'r SteamID didnt get a match!"
It's not - in my opinion - a valid reason why you'd spend time writing code to authenticate through steamID when you can easily just check it with flags.

Let me give you an example of what I mean.

PHP Code:
public somefunction(id)
{
    if (
get_user_flags(id) & ADMIN_IMMUNITY)
    {
        
// do stuff here.
    
}

Versus

PHP Code:
public somefunction(id)
{
    new 
szSteamID[32];
    
get_user_authid(idszSteamIDcharsmax(szSteamID);
    if (
szSteamID == "SteamID here")
    {
        
// do stuff here
    
}

__________________
No salvation. Only madness.
P1raten is offline
WeeZick
Member
Join Date: Oct 2012
Location: Gothenburg, Sweden
Old 02-07-2013 , 16:26   Re: Blockmaker SteamID
Reply With Quote #4

Quote:
Originally Posted by P1raten View Post
It's not - in my opinion - a valid reason why you'd spend time writing code to authenticate through steamID when you can easily just check it with flags.

Let me give you an example of what I mean.

PHP Code:
public somefunction(id)
{
    if (
get_user_flags(id) & ADMIN_IMMUNITY)
    {
        
// do stuff here.
    
}

Versus

PHP Code:
public somefunction(id)
{
    new 
szSteamID[32];
    
get_user_authid(idszSteamIDcharsmax(szSteamID);
    if (
szSteamID == "SteamID here")
    {
        
// do stuff here
    
}

I understand you idea and its pretty nice but what if i want to add more steamid's?
WeeZick is offline
Xr0ol3y
Junior Member
Join Date: Mar 2010
Old 02-07-2013 , 10:12   Re: Blockmaker SteamID
Reply With Quote #5

Quote:
Originally Posted by WeeZick View Post
Beacouse i want when someone that dont have access to /bm writes it then i want it to say "You'r SteamID didnt get a match!"
dude, just use flags for godsake? its the same fucking thing just that it register and read flags instead of steam ID's just add them as admin or change the blockmaker to what flag you ever want it to define access to?
Xr0ol3y is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 02-07-2013 , 10:35   Re: Blockmaker SteamID
Reply With Quote #6

https://forums.alliedmods.net/showthread.php?t=107153


Quote:
Originally Posted by P1raten View Post
It's not - in my opinion - a valid reason why you'd spend time writing code to authenticate through steamID when you can easily just check it with flags.

Let me give you an example of what I mean.

PHP Code:
public somefunction(id)
{
    if (
get_user_flags(id) & ADMIN_IMMUNITY)
    {
        
// do stuff here.
    
}

Versus

PHP Code:
public somefunction(id)
{
    new 
szSteamID[32];
    
get_user_authid(idszSteamIDcharsmax(szSteamID);
    if (
szSteamID == "SteamID here")
    {
        
// do stuff here
    
}


First off, both the methods you provided don't even differ in efficiency. Sure, the second way has two native calls (when fixing your == operator with equal) and you declare a new variable, but the calls are so fast it's not even worth talking about it.

Last edited by Backstabnoob; 02-07-2013 at 10:39.
Backstabnoob is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 02-07-2013 , 10:43   Re: Blockmaker SteamID
Reply With Quote #7

Quote:
Originally Posted by Backstabnoob View Post
https://forums.alliedmods.net/showthread.php?t=107153

First off, both the methods you provided don't even differ in efficiency. Sure, the second way has two native calls (when fixing your == operator with equal) and you declare a new variable, but the calls are so fast it's not even worth talking about it.
True, but let me ask you this:
Which one of them would you choose?
__________________
No salvation. Only madness.
P1raten is offline
Kard1nal
Senior Member
Join Date: Dec 2012
Location: Russia
Old 02-07-2013 , 10:46   Re: Blockmaker SteamID
Reply With Quote #8

Less code or more code with one result = less code.
Kard1nal is offline
Send a message via Skype™ to Kard1nal
WeeZick
Member
Join Date: Oct 2012
Location: Gothenburg, Sweden
Old 02-07-2013 , 16:27   Re: Blockmaker SteamID
Reply With Quote #9

It is much more simple to just add all the steamid's in an enum
WeeZick is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 02-07-2013 , 18:17   Re: Blockmaker SteamID
Reply With Quote #10

Clearly not. With a plugin which uses flags, you don't have to recompile it each time you add a new SteamID.
__________________
micapat 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:11.


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