Raised This Month: $51 Target: $400
 12% 

How to add 2 plugin for mode?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wats0N
Member
Join Date: Aug 2016
Old 09-24-2017 , 10:01   How to add 2 plugin for mode?
Reply With Quote #1

Hi there.
How can I add this biohazard mod to a unique model of owner, admin, vip?
Steam id or ip would be a good solution, but I can not write it.

Somehow it should be:

HTML Code:
;Owners:

"STEAM_x:x:xxxxxxxx" "models/server/owners/owner1.mdl"
"STEAM_x:x:xxxxxxxx" "models/server/owners/owner2.mdl"

;Admins:

"STEAM_x:x:xxxxxxxx" "models/server/admins/admin1.mdl"
"STEAM_x:x:xxxxxxxx" "models/server/admins/admin2.mdl"
"STEAM_x:x:xxxxxxxx" "models/server/admins/admin3.mdl"

;Vips:

"STEAM_x:x:xxxxxxxx" "models/server/vips/vip1.mdl"
"STEAM_x:x:xxxxxxxx" "models/server/vips/vip2.mdl"
"STEAM_x:x:xxxxxxxx" "models/server/vips/vip3.mdl"

;Other

"STEAM_x:x:xxxxxxxx" "models/server/jhony/jhony.mdl"
"STEAM_x:x:xxxxxxxx" "models/server/david/david.mdl"
And biohazard mod sma:

Spoiler
Wats0N is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 09-24-2017 , 10:39   Re: How to add 2 plugin for mode?
Reply With Quote #2

Players Models
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Wats0N
Member
Join Date: Aug 2016
Old 09-25-2017 , 14:35   Re: How to add 2 plugin for mode?
Reply With Quote #3

Quote:
Originally Posted by wickedd View Post
I tried it..
But it does not show, though it is given.
Wats0N is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 09-26-2017 , 00:36   Re: How to add 2 plugin for mode?
Reply With Quote #4

Quote:
Originally Posted by Wats0N View Post
I tried it..
But it does not show, though it is given.
You can use get_user_flag() and use switch with it
like

Code:
new wModel[56]
switch(get_user_flag(id))
{
      case 1:ADMIN_LEVEL_A
           {
                    format(wModel,55,"models/server/owners/owner1.mdl")
            }
      entity_set_string(id, EV_SZ_model, wModel)
}
Example
__________________
And I Am Back.

Last edited by TheSpaniard; 09-29-2017 at 03:30.
TheSpaniard is offline
Wats0N
Member
Join Date: Aug 2016
Old 09-28-2017 , 14:41   Re: How to add 2 plugin for mode?
Reply With Quote #5

Quote:
Originally Posted by TheSpaniard View Post
You can use get_user_flag() and use switch with it
like

Code:
new wModel[56]
switch(get user flag(id))
{
      case 1:ADMIN_LEVEL_A
           {
                    format(wModel,55,"models/server/owners/owner1.mdl")
            }
      entity_set_string(id, EV_SZ_model, wModel)
}
Example
Thanks, but how do I add 4 models (owner, admin, vip, other) to a different legitimacy?
example:
Owner - ADMIN_LEVEL_A
Admin - ADMIN_BAN
Vip - ADMIN_LEVEL_H
Other - ADMIN_KICK
Wats0N is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 09-28-2017 , 15:21   Re: How to add 2 plugin for mode?
Reply With Quote #6

Code:
static sz_pModel[60]; switch (get_user_flags(id)){     case ADMIN_LEVEL_A: {         format(sz_pModel, charsmax(sz_pModel) - 1, "models/player/vip/vip.mdl");         entity_set_string(id, EV_SZ_model, sz_pModel);     }         case ADMIN_BAN: {      /* this is same as the previous case statement       * what you need to do is only copy-paste and edit the 3rd       * param of format, either use format or formatex       * 3rd param = "models/player/<name>/<same as name>"       * also case st. for each ADMIN_FLAG */     } }
__________________

Last edited by Relaxing; 09-28-2017 at 15:22. Reason: typo
Relaxing is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 09-29-2017 , 03:51   Re: How to add 2 plugin for mode?
Reply With Quote #7

Quote:
Originally Posted by Wats0N View Post
Thanks, but how do I add 4 models (owner, admin, vip, other) to a different legitimacy?
example:
Owner - ADMIN_LEVEL_A
Admin - ADMIN_BAN
Vip - ADMIN_LEVEL_H
Other - ADMIN_KICK
PHP Code:
public skins(id)
{
static 
pModel[56]
    if(
get_user_flags(id) & ADMIN_LEVEL_A)
    {
        
format(pModel55"models/server/owners/owner1.mdl")
    }
    if(
get_user_flags(id) & ADMIN_BAN)
    {
        
format(pModel55"models/server/admins/admin1.mdl")
    }
    if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
format(pModel55"models/server/vips/vip1.mdl")
    }
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        
format(pModel55"models/server/others/jhony.mdl")
    }
    
entity_set_string(idEV_SZ_modelpModel)
}
return 
PLUGIN_*

Ayman you were right
Now This Should Work.
__________________
And I Am Back.

Last edited by TheSpaniard; 09-29-2017 at 06:36. Reason: Typo's as pointed out by ayman
TheSpaniard is offline
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 09-29-2017 , 04:11   Re: How to add 2 plugin for mode?
Reply With Quote #8

get_user_flags

PHP Code:
case 1ADMIN_

PHP Code:
case ADMIN_*: 
P.S: I don't really think that this way will work, you need to check if get_user_flags(id) & ADMIN_*, not ==.
__________________

Last edited by Ayman Khaled; 09-29-2017 at 06:12.
Ayman Khaled is offline
Old 09-29-2017, 04:23
TheSpaniard
This message has been deleted by TheSpaniard. Reason: NVM
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 09-29-2017 , 13:32   Re: How to add 2 plugin for mode?
Reply With Quote #9

It's more recommended to use switch.
Also if the main owner has all flags, it might create a conflict.
Use get_user_flags(id, read_flags("bit"))
__________________
Relaxing is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-29-2017 , 13:44   Re: How to add 2 plugin for mode?
Reply With Quote #10

Quote:
Originally Posted by TheSpaniard View Post
You can use get_user_flag() and use switch with it
like

Code:
new wModel[56]
switch(get_user_flag(id))
{
      case 1:ADMIN_LEVEL_A
           {
                    format(wModel,55,"models/server/owners/owner1.mdl")
            }
      entity_set_string(id, EV_SZ_model, wModel)
}
Example
That makes no sense.

Quote:
Originally Posted by Relaxing View Post
Code:
static sz_pModel[60]; switch (get_user_flags(id)){     case ADMIN_LEVEL_A: {         format(sz_pModel, charsmax(sz_pModel) - 1, "models/player/vip/vip.mdl");         entity_set_string(id, EV_SZ_model, sz_pModel);     }         case ADMIN_BAN: {      /* this is same as the previous case statement       * what you need to do is only copy-paste and edit the 3rd       * param of format, either use format or formatex       * 3rd param = "models/player/<name>/<same as name>"       * also case st. for each ADMIN_FLAG */     } }
Not a good solution.

Quote:
Originally Posted by TheSpaniard View Post
PHP Code:
public skins(id)
{
static 
pModel[56]
    if(
get_user_flags(id) & ADMIN_LEVEL_A)
    {
        
format(pModel55"models/server/owners/owner1.mdl")
    }
    if(
get_user_flags(id) & ADMIN_BAN)
    {
        
format(pModel55"models/server/admins/admin1.mdl")
    }
    if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
format(pModel55"models/server/vips/vip1.mdl")
    }
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        
format(pModel55"models/server/others/jhony.mdl")
    }
    
entity_set_string(idEV_SZ_modelpModel)
}
return 
PLUGIN_*

Ayman you were right
Now This Should Work.
Use 'else if'.
Quote:
Originally Posted by Relaxing View Post
It's more recommended to use switch.
Also if the main owner has all flags, it might create a conflict.
Use get_user_flags(id, read_flags("bit"))
No it's not recommended, that won't work.
__________________
edon1337 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:43.


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