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-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.


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

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