vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Usergroup checker - View Topic
Topic Rating: *****
Printable View
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 34
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Usergroup checker (9th Jan 10 at 7:32am UTC)
Resolved
Code:
 
  1. <script>
  2. function GroupCheck(GroupId){
  3.  
  4. GCheck = false;
  5.  
  6. for(i = 0; i <= vf_usergroup.length; i++){
  7.  
  8. if(vf_usergroup[i] = GroupId){
  9.  
  10. GCheck = true;
  11. break;
  12.  
  13. }
  14.  
  15. }
  16.  
  17. return GCheck;
  18.  
  19. }
  20. </script>
 


Used to check if the user that is on is in a specific usergroup.

It isn't working right though

I am using it like:

Code:
 
  1. <script>
  2. if(GroupCheck(14)){
  3. //code
  4. }
  5. </script>
 

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 11
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: Usergroup checker (9th Jan 10 at 11:06pm UTC)
To do a conditional check it needs a double ==

if(vf_usergroup[i] == GroupId){

Image
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 34
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Usergroup checker (9th Jan 10 at 11:09pm UTC)
I can't believe I made THAT mistake o.o

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 11
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: Usergroup checker (9th Jan 10 at 11:24pm UTC)
Sometimes we all just need a fresh pair of eyes to spot the simple things {Smile}

Image
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 34
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Usergroup checker (9th Jan 10 at 11:28pm UTC)
And you are very good at fixing code I write

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
 Printable View

All times are GMT+0 :: The current time is 6:38am
Page generated in 0.7118 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums