Problema players_models

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
Jucks
Membru, skill +3
Membru, skill +3
Posts: 1141
Joined: 20 May 2016, 16:28
Detinator Steam: Da
Fond eXtream: 0
Contact:

01 May 2017, 18:48

JaiLBreaK wrote:new const g_szModel[ ] = {

"model1.mdl",
"model2.mdl"
}
asta face toata trb...............
Testeaza
| Afiseaza codul
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

new const g_szModel[][] = {

    "model1.mdl",
    "model2.mdl"
}

#define VIP_FLAG ADMIN_LEVEL_H

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 ] ;
    for(new i;i<sizeof(g_szModel);i++)
    {
        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 ) & VIP_FLAG ) 
    return HAM_IGNORED ;

    set_user_info( id, "model", g_szModel[random_num(0,charsmax(g_szModel)] ) ;
    
    return HAM_HANDLED ;
}

public fw_SetClientKeyValue( id, const infobuffer[ ], const key[ ] ) {

    if( ~ get_user_flags( id ) & VIP_FLAG )
    return FMRES_IGNORED ;

    if( equal( key, "model" ) ) {

        set_user_info( id, "model", g_szModel[random_num(0,charsmax(g_szModel)] ) ;
        return FMRES_SUPERCEDE ;
    }
    
    return FMRES_IGNORED ;
}

Rezolvasem inainte , oricum mersi
Detinator : # Go.Tried.Ro #
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests