Raised This Month: $ Target: $400
 0% 

Blockmaker SteamID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WeeZick
Member
Join Date: Oct 2012
Location: Gothenburg, Sweden
Old 02-08-2013 , 11:35   Re: Blockmaker SteamID
Reply With Quote #1

Could you make an example, Please?
WeeZick is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 02-08-2013 , 11:36   Re: Blockmaker SteamID
Reply With Quote #2

Quote:
Originally Posted by WeeZick View Post
Could you make an example, Please?
No, if you don't know basic scripting in pawn then I suggest that you either go read some tutorials or go to the Suggestions / Requests section instead.
__________________
No salvation. Only madness.
P1raten is offline
WeeZick
Member
Join Date: Oct 2012
Location: Gothenburg, Sweden
Old 02-08-2013 , 11:38   Re: Blockmaker SteamID
Reply With Quote #3

Yeh i know i took the wrong section but i dont wanna write all this on that thread again so please just help me :S
WeeZick is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 02-08-2013 , 11:42   Re: Blockmaker SteamID
Reply With Quote #4

So ask for the thread to be moved?

EDIT:

Quote:
Originally Posted by Sylwester View Post
You can't use switch with strings. In this case the best option (other than using flags) would be celltrie.
Really?

How about defining a constant array with SteamID's defined and switching through them?
__________________
No salvation. Only madness.

Last edited by P1raten; 02-08-2013 at 11:43.
P1raten is offline
WeeZick
Member
Join Date: Oct 2012
Location: Gothenburg, Sweden
Old 02-08-2013 , 11:51   Re: Blockmaker SteamID
Reply With Quote #5

Quote:
Originally Posted by P1raten View Post
So ask for the thread to be moved?

EDIT:


Really?

How about defining a constant array with SteamID's defined and switching through them?
Who should i ask?
Btw im not so good at english for example i dont know what "switch statement rather than if statements" means thats why i need help
WeeZick is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 02-08-2013 , 11:53   Re: Blockmaker SteamID
Reply With Quote #6

Quote:
Originally Posted by WeeZick View Post
Who should i ask?
Btw im not so good at english for example i dont know what "switch statement rather than if statements" means thats why i need help
Click this link:

https://forums.alliedmods.net/report.php?p=1888466

And in the box you write something like:

"Can someone please move this thread to Suggestions/Requests"
__________________
No salvation. Only madness.
P1raten is offline
WeeZick
Member
Join Date: Oct 2012
Location: Gothenburg, Sweden
Old 02-08-2013 , 12:13   Re: Blockmaker SteamID
Reply With Quote #7

Done.
But do this works?

public somefunction(id)
{
new szSteamID[32];
get_user_authid(id, szSteamID, charsmax(szSteamID);
if (szSteamID == "SteamID1 Here")
if (szSteamID == "SteamID2 Here")
{
// do stuff here
}
}
WeeZick is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-08-2013 , 12:20   Re: Blockmaker SteamID
Reply With Quote #8

No. You can't compare strings using == operator.
Why don't you just use flags?
PHP Code:
public some_function(id){
    if(!(
get_user_flags(id) & ADMIN_BAN)){
        return
    }
    
    
//do stuff here

Quote:
Originally Posted by P1raten View Post
How about defining a constant array with SteamID's defined and switching through them?
What?
__________________
Impossible is Nothing
Sylwester is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 02-08-2013 , 12:24   Re: Blockmaker SteamID
Reply With Quote #9

Quote:
Originally Posted by Sylwester View Post
No. You can't compare strings using == operator.
Why don't you just use flags?
PHP Code:
public some_function(id){
    if(!(
get_user_flags(id) & ADMIN_BAN)){
        return
    }
    
    
//do stuff here

What?
Sorry, my terminology sucks.

PHP Code:
new const SteamIDs[][] =
{
    
"STEAMID",
    
"STEAMID",
    
"STEAMID",
    
"STEAMID",
    
"STEAMID",
    
"STEAMID"
}; 
__________________
No salvation. Only madness.
P1raten is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 02-08-2013 , 12:25   Re: Blockmaker SteamID
Reply With Quote #10

Quote:
Originally Posted by Sylwester
What?
I guess he meant this:

Code:
new const cstSteamIds[ ][ ] = {     "STEAM_0:0:XXXXXXXXX",     "STEAM_0:1:SAISJGSA"     // ... } public function( id ) {         new szAuthid[ 36 ]     get_user_authid( id, szAuthid, charsmax( szAuthid ) )         new iResult         for( new i; i < sizeof( cstSteamIds ); i ++ )     {         if( equali( szAuthid, cstSteamIds[ i ] ) )         {             iResult = i             break         }     } }
Backstabnoob 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