Raised This Month: $ Target: $400
 0% 

if (get_user_flags(id) & ADMIN_USER) { CANT FIX!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
StivJ
Junior Member
Join Date: Feb 2018
Old 02-04-2018 , 17:00   if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #1

Hi

Trying to solve this model scrypt.
I want to have this model ONLY on LEVEL C. Because on level c I already have prefix for VIP Girls.
I tried to change ADMIN_USER to ADMIN_LEVEL_C but still it show me the model. I tried play with levels it doesnt matter i have access to level A or LEVEL H, still the model is showing up!

I saw post here that someone got fixed this problem by just changing USER to LEVEL_x. NOT in my case.!
THank you guys!!!

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
        
register_plugin("AMX Admin Girl""1.0""whitemike & homorapian")
        
register_event("ResetHUD""resetModel""b")
        return 
PLUGIN_CONTINUE
}

public 
plugin_precache() {
        
precache_model("models/player/ladyadmin/ladyadmin.mdl")
        
precache_model("models/player/ladyadmin/ladyadmin.mdl")

        return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid) {
        if (
get_user_flags(id) & ADMIN_USER) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"ladyadmin")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"ladyadmin")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE

StivJ is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 02-04-2018 , 18:53   Re: if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #2

First, func header should be:
Quote:
public resetModel(id) {
Next, change "ADMIN_USER" with the flag that you want.

If you are tried with ADMIN_LEVEL_C and you saw the model, this means you have this flag.
__________________
My English is A0
E1_531G is offline
StivJ
Junior Member
Join Date: Feb 2018
Old 02-05-2018 , 06:02   Re: if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #3

Quote:
Originally Posted by E1_531G View Post
First, func header should be:

Next, change "ADMIN_USER" with the flag that you want.

If you are tried with ADMIN_LEVEL_C and you saw the model, this means you have this flag.
Hi I changed like you said. I gave myself level A access but still I have the model on me.

I dont understand really. For example in some other working GIRL model script If I give LEVEL H access to LEVEL C (in my case LEVEL H is owner and LEVEL C is Girl VIP.) it means that OWNER WITH LEVEL H AND LEVEL C will also have this GIRL Model? Or the OWNER will get the model for LEVEL. and this LEVEL C model will not stay and he can chose it!!

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
        
register_plugin("AMX Admin Girl""1.0""whitemike & homorapian")
        
register_event("ResetHUD""resetModel""b")
        return 
PLUGIN_CONTINUE
}

public 
plugin_precache() {
        
precache_model("models/player/ladyadmin/ladyadmin.mdl")
        
precache_model("models/player/ladyadmin/ladyadmin.mdl")

        return 
PLUGIN_CONTINUE
}

public 
resetModel(id) {
        if (
get_user_flags(id) & ADMIN_LEVEL_C) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"ladyadmin")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"ladyadmin")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE


Last edited by StivJ; 02-05-2018 at 06:14.
StivJ is offline
StivJ
Junior Member
Join Date: Feb 2018
Old 02-05-2018 , 06:38   Re: if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #4

I just tried out and I figured out that this model is on ADMIN_CFG //Flag "h"
But how can I change it and why the script doesnt work when I change the LEVELS??
Thank you for your help guys!!
StivJ is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 02-05-2018 , 07:24   Re: if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #5

init and precache don't take return values. resetHUD does not have parameters, you would have to loop through every player. use Ham_Spawn instead

not sure what problem you have with the flags, code seems to be fine

Last edited by jimaway; 02-05-2018 at 07:25.
jimaway is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 02-05-2018 , 17:58   Re: if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #6

If you are owner you should not have girl flag.
__________________
My English is A0
E1_531G is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-05-2018 , 19:06   Re: if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #7

Code looks fine to me, are you sure there isn't a second version running in the background with ADMIN_USER?
__________________
Bugsy is offline
StivJ
Junior Member
Join Date: Feb 2018
Old 02-06-2018 , 09:03   Re: if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #8

Quote:
Originally Posted by E1_531G View Post
If you are owner you should not have girl flag.
Lol. I tought if I could get it to another flag then I will not take that flag as an owner. But amx_cfg seems to be stuff that I will need in future. But of course I will not take that flag if I will not get fixed this!
StivJ is offline
StivJ
Junior Member
Join Date: Feb 2018
Old 02-06-2018 , 09:05   Re: if (get_user_flags(id) & ADMIN_USER) { CANT FIX!
Reply With Quote #9

Quote:
Originally Posted by Bugsy View Post
Code looks fine to me, are you sure there isn't a second version running in the background with ADMIN_USER?
Yea. I even tried on my other server + I tried to reinstall server and upload it back.But didnt work. Only works with AMX_cfg flag
StivJ 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 20:19.


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