AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved [HELP]Vip Skin (https://forums.alliedmods.net/showthread.php?t=295685)

Restart 04-01-2017 19:22

[HELP]Vip Skin
 
1 Attachment(s)
Hello, why does my vip skin doesn't show?Because i have Umbrella Swarm skin? :):(

edon1337 04-02-2017 06:57

Re: [HELP]Vip Skin
 
Because that code sucks.
Code:
#include < amxmodx > #include < hamsandwich > new const g_szModel[ ] = "bill" ; #define ADMIN_FLAG ADMIN_KICK public plugin_init( ) {     register_plugin( "Admin Skin", "1.0", "DoNii" ) ;     RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ; } public plugin_precache( ) {     new szBuffer[ 64 ] ;     formatex( szBuffer, charsmax( szBuffer ), "models/player/%s/%s.mdl", g_szModel ) ;         precache_model( szBuffer ) ; } public fw_HamSpawnPost( id ) {     if( ! is_user_alive( id ) )     return HAM_IGNORED ;     if( ~ get_user_flags( id ) & ADMIN_FLAG )     return HAM_IGNORED ;     if( get_user_team( id ) != 2 )     return HAM_IGNORED ;     set_user_info( id, "model", g_szModel ) ;         return HAM_IGNORED ; }

Restart 04-02-2017 07:42

Re: [HELP]Vip Skin
 
Thanks, i will try

D3XT3R 04-02-2017 07:52

Re: [HELP]Vip Skin
 
no use amx_adminmodel its realise and approved and work perfectly in all mods and in umbrella not work because you need delet T model only and plugin be work for CT ONLY!

Restart 04-02-2017 07:58

Re: [HELP]Vip Skin
 
Not working, i deleted t but it still doesn't work :(

OciXCrom 04-02-2017 10:27

Re: [HELP]Vip Skin
 
PHP Code:

new szBuffer64 ] ;
formatexszBuffercharsmaxszBuffer ), "models/player/%s/%s.mdl"g_szModel ) ; 

Missing another g_szModel in the end + 64 isn't enough.
* *

Restart 04-02-2017 10:30

Re: [HELP]Vip Skin
 
So what do i do?

OciXCrom 04-02-2017 10:35

Re: [HELP]Vip Skin
 
Probably add another g_szModel in the end and increase 64 to a bigger number (128 ).

Restart 04-02-2017 11:00

Re: [HELP]Vip Skin
 
Error: http://prntscr.com/erj3eo

OciXCrom 04-02-2017 11:02

Re: [HELP]Vip Skin
 
I'm pretty sure I told you how to fix that 20 minutes ago.

Restart 04-02-2017 11:07

Re: [HELP]Vip Skin
 
Ok

edon1337 04-02-2017 12:02

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by OciXCrom (Post 2508793)
PHP Code:

new szBuffer64 ] ;
formatexszBuffercharsmaxszBuffer ), "models/player/%s/%s.mdl"g_szModel ) ; 


64 is MORE than enough.

models/player//.mdl

19 Chars.
It means there's 45 Chars left / 2 = 22.5 ~ 22 for each Model name.

Quote:

Originally Posted by OciXCrom (Post 2508793)
[php]new szBuffer[ 64 ] ;
Missing another g_szModel in the end + 64 isn't enough.
* *

It's okay like that, it will automatically choose the first one for both, someone already tested it in another plugin that I made for him.

@Restart test the code I gave you.

OciXCrom 04-02-2017 13:06

Re: [HELP]Vip Skin
 
Who told you that? If there are more %s than the number of arguments after the string, it will throw out a "string formatted incorrectly" error, as you can see in the previous post. With that the plugin will NOT work.

D3XT3R 04-02-2017 13:26

Re: [HELP]Vip Skin
 
try this will be work for you fine and tested by me.
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init()
{
        
register_plugin("Vip Skin""1.0""author")
        
register_event("ResetHUD""RestVipSkin""b")
}

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

public 
RestVipSkin(id)
{
        if (
get_user_flags(id) & ADMIN_LEVEL_H) {
                if (
cs_get_user_team(id) == CS_TEAM_CT) {
                        
cs_set_user_model(id"YOUR_SKIN_MODEL")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE



EFFx 04-02-2017 13:28

Re: [HELP]Vip Skin
 
Why these return at plugin_precache() and RestVipSkin() ? why (id, level, cid)?

D3XT3R 04-02-2017 13:33

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by EFFx (Post 2508838)
Why these return at plugin_precache() and RestVipSkin() ? why (id, level, cid)?

why i answer you?, and you didnt answer me to support in yours furien mod.

edon1337 04-02-2017 14:22

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by OciXCrom (Post 2508831)
Who told you that? If there are more %s than the number of arguments after the string, it will throw out a "string formatted incorrectly" error, as you can see in the previous post. With that the plugin will NOT work.

You're right! I didn't know, sorry.

The code before didn't even work, here's the working one + tested.
Code:
#include < amxmodx > #include < fakemeta > #include < hamsandwich > new const g_szModel[ ] = "bill" ; #define ADMIN_FLAG ADMIN_KICK public plugin_init( ) {     register_plugin( "Admin Skin", "1.0", "DoNii" ) ;     RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ;     register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" ) } public plugin_precache( ) {     new szBuffer[ 64 ] ;     formatex( szBuffer, charsmax( szBuffer ), "models/player/%s/%s.mdl", g_szModel, g_szModel ) ;         precache_model( szBuffer ) ; } public fw_HamSpawnPost( id ) {     if( ! is_user_alive( id ) )     return HAM_IGNORED ;     if( ~ get_user_flags( id ) & ADMIN_FLAG )     return HAM_IGNORED ;     if( get_user_team( id ) != 2 )     return HAM_IGNORED ;     set_user_info( id, "model", g_szModel ) ;         return HAM_HANDLED ; } public fw_SetClientKeyValue( id, const infobuffer[ ], const key[ ] ) {     if( get_user_team( id ) != 2 )     return FMRES_IGNORED ;     if( ~ get_user_flags( id ) & ADMIN_KICK )     return FMRES_IGNORED ;     if( equal( key, "model" ) ) {         set_user_info( id, "model", g_szModel ) ;         return FMRES_SUPERCEDE ;     }         return FMRES_IGNORED ; }

edon1337 04-02-2017 14:24

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by D3XT3R (Post 2508837)
try this will be work for you fine and tested by me.
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init()
{
        
register_plugin("Vip Skin""1.0""author")
        
register_event("ResetHUD""RestVipSkin""b")
}

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

public 
RestVipSkin(id)
{
        if (
get_user_flags(id) & ADMIN_LEVEL_H) {
                if (
cs_get_user_team(id) == CS_TEAM_CT) {
                        
cs_set_user_model(id"YOUR_SKIN_MODEL")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE



That's one of the worst Model changing codes I've ever seen. Good job.

Restart 04-02-2017 14:39

Re: [HELP]Vip Skin
 
Thanks, i wil try :)

Restart 04-02-2017 14:56

Re: [HELP]Vip Skin
 
Both options not working :( Something is wrong with mine Umbrella Skin.

edon1337 04-02-2017 15:08

Re: [HELP]Vip Skin
 
I tested it before posting, you probably have a plugin that affects the models.

Restart 04-02-2017 15:11

Re: [HELP]Vip Skin
 
I have this in umbrella_swarm.sma:
new const g_priv_models[][] = { "umbrella", "umbrella", "umbrella", "umbrella" }

edon1337 04-02-2017 16:50

Re: [HELP]Vip Skin
 
That probably messes with it, you could try setting a delay on Ham_Spawn and check if it would reset the model of Umbrella mod.
Code:
#include < amxmodx > #include < fakemeta > #include < hamsandwich > new const g_szModel[ ] = "bill" ; #define ADMIN_FLAG ADMIN_KICK public plugin_init( ) {     register_plugin( "Admin Skin", "1.0", "DoNii" ) ;     RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ;     register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" ) } public plugin_precache( ) {     new szBuffer[ 64 ] ;     formatex( szBuffer, charsmax( szBuffer ), "models/player/%s/%s.mdl", g_szModel, g_szModel ) ;         precache_model( szBuffer ) ; } public fw_HamSpawnPost( id ) {     if( ! is_user_alive( id ) )     return HAM_IGNORED ;     if( ~ get_user_flags( id ) & ADMIN_FLAG )     return HAM_IGNORED ;     if( get_user_team( id ) != 2 )     return HAM_IGNORED ;     set_task( 1.0, "fw_HamSpawnPostDelay", id ) ;         return HAM_HANDLED ; } public fw_SetClientKeyValue( id, const infobuffer[ ], const key[ ] ) {     if( get_user_team( id ) != 2 )     return FMRES_IGNORED ;     if( ~ get_user_flags( id ) & ADMIN_KICK )     return FMRES_IGNORED ;     if( equal( key, "model" ) ) {         set_user_info( id, "model", g_szModel ) ;         return FMRES_SUPERCEDE ;     }         return FMRES_IGNORED ; } public fw_HamSpawnPostDelay( id ) {     set_user_info( id, "model", g_szModel ) ;     remove_task( id ) ; }

Restart 04-02-2017 16:52

Re: [HELP]Vip Skin
 
How?I don't know how to do it?

Restart 04-02-2017 16:57

Re: [HELP]Vip Skin
 
I mean, when i transfer to ct it shows, but than repalaces with umbrella skin.

edon1337 04-02-2017 16:57

Re: [HELP]Vip Skin
 
Code:
#include < amxmodx > #include < fakemeta > #include < hamsandwich > new const g_szModel[ ] = "bill" ; #define ADMIN_FLAG ADMIN_KICK public plugin_init( ) {     register_plugin( "Admin Skin", "1.0", "DoNii" ) ;     RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ;     register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" ) } public plugin_precache( ) {     new szBuffer[ 64 ] ;     formatex( szBuffer, charsmax( szBuffer ), "models/player/%s/%s.mdl", g_szModel, g_szModel ) ;         precache_model( szBuffer ) ; } public fw_HamSpawnPost( id ) {     set_task( 1.0, "fw_HamSpawnPostDelay", id ) ; } public fw_SetClientKeyValue( id, const infobuffer[ ], const key[ ] ) {     if( get_user_team( id ) != 2 )     return FMRES_IGNORED ;     if( ~ get_user_flags( id ) & ADMIN_KICK )     return FMRES_IGNORED ;     if( equal( key, "model" ) ) {         set_user_info( id, "model", g_szModel ) ;         return FMRES_SUPERCEDE ;     }         return FMRES_IGNORED ; } public fw_HamSpawnPostDelay( id ) {     if( ! is_user_alive( id ) )     return PLUGIN_CONTINUE ;     if( ~ get_user_flags( id ) & ADMIN_FLAG )     return PLUGIN_CONTINUE ;     if( get_user_team( id ) != 2 )     return PLUGIN_CONTINUE ;     set_user_info( id, "model", g_szModel ) ;     remove_task( id ) ;         return PLUGIN_CONTINUE ; }

EDIT : By the way, you could just use the first code and put this plugin's name before umbrella swarm's in plugins.ini !

Restart 04-02-2017 17:26

Re: [HELP]Vip Skin
 
It's not working, because it's something wrong with mine umbrella_swarm.sma.

D3XT3R 04-02-2017 17:32

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by Restart (Post 2508882)
I have this in umbrella_swarm.sma:
new const g_priv_models[][] = { "umbrella", "umbrella", "umbrella", "umbrella" }

lol mine umbrella since 2014 of psychical and my edtion so look now

in this like it has access levels of ct normal players and vip and admin and s admin skins
first one for all and other one for vip just change from umbrella to other ur model as Bill

Restart 04-02-2017 18:03

Re: [HELP]Vip Skin
 
So do you mean, that
new const g_priv_models[][] = { "umbrella", "umbrella", "umbrella", "umbrella" }

Is vip models or what?

Restart 04-02-2017 18:06

Re: [HELP]Vip Skin
 
Yes, it's your's, because it is what i can find for free :P

Restart 04-02-2017 18:06

Re: [HELP]Vip Skin
 
And why is it old?I find this mode in every server :D

Restart 04-02-2017 18:26

Re: [HELP]Vip Skin
 
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh, i get it now, do you mean by:
new const g_priv_models[][] = { "Umbrella", "Vip", "Admin" }

???

Restart 04-02-2017 18:31

Re: [HELP]Vip Skin
 
Omg, thank you so much!!! It's WORKING!!!!!!!!!!

OciXCrom 04-02-2017 19:17

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by edon1337 (Post 2508898)
EDIT : By the way, you could just use the first code and put this plugin's name before umbrella swarm's in plugins.ini !

After*

edon1337 04-03-2017 07:01

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by OciXCrom (Post 2508932)
After*

No. He already put it after and it didn't work.

@Restart how did you solve it?

D3XT3R 04-03-2017 07:03

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by Restart (Post 2508925)
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh, i get it now, do you mean by:
new const g_priv_models[][] = { "Umbrella", "Vip", "Admin" }

???

yep Vip its flag like i remember ADMIN_LEVEL_H and admin is ban flag and sadmin is immunity and not 3

should be like this.
new const g_priv_models[][] = { "Umbrella", "Vip", "Admin", "Sadmin" }

D3XT3R 04-03-2017 07:04

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by Restart (Post 2508919)
Yes, it's your's, because it is what i can find for free :P

not free -_- i post the unnaproved version from 2014 :P abd its updated in 2017 from AMX REZ TEAM
and approved, but this version good

D3XT3R 04-03-2017 07:05

Re: [HELP]Vip Skin
 
Quote:

Originally Posted by Restart (Post 2508918)
So do you mean, that
new const g_priv_models[][] = { "umbrella", "umbrella", "umbrella", "umbrella" }

Is vip models or what?

i mean with it this:

new const g_priv_models[][] = { "NORMAL PLAYERS MODEL", "VIPS MODEL", "ADMINS MODEL", "SADMINS MODEL" }

Restart 04-03-2017 10:47

Re: [HELP]Vip Skin
 
Yeah, it's d3xt3r's Umbrella Swarm, and for me is so good, d3xt3r i mean there was 3 words not 4, i just added another "umbrella", btw it's normal vip admin and here is mine:

new const g_priv_models[][] = { "umbrella", "bill", "goku" }

but here was it before when i didn't add "umbrella":

new const g_priv_models[][] = { "umbrella", "umbrella", "umbrella" }

:)

Restart 04-03-2017 10:57

Re: [HELP]Vip Skin
 
edon1337, d3xt3r helped me, i just opened umbrella_swarm.sma and founded this line:
new const g_priv_models[][] = { "umbrella", "umbrella", "umbrella" }

g_priv_models mean that it's with access, you need to change "umbrella" to like the folder name of skin you want to put -this sets the normal skin, the other "umbrella" is vip skin and last "umbrella" is admin skin.


All times are GMT -4. The time now is 00:53.

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