Stripes Admin-Models

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Ake
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 19 Dec 2013, 17:30
Detinator Steam: Da
Has thanked: 88 times
Been thanked: 2 times

23 Dec 2013, 00:04

cruyff wrote:Incercati asa:
.SMA | Afiseaza codul
#include < amxmodx >
#include < cstrike >

#define PLUGIN_NAME "Stripes admin models"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "AgentStrike"

#pragma semicolon 1

new const g_szModel_T[ ] = "models/player/adm_stripes_te/adm_stripes_te.mdl";
new const g_szModel_CT[ ] = "models/player/adm_stripes_ct/adm_stripes_ct.mdl";

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	// ResetHUD
	
	register_event( "ResetHUD", "evReset_Hud", "be" );
}
public plugin_precache( )
{
	precache_model( g_szModel_T );
	precache_model( g_szModel_CT );
}
public evReset_Hud( id )
{
	if( UserIsAdmin( id ) ) // Ow yes, good bool :D
	{
		set_task( 3.0, "reset_model", id );
	}
}
public reset_model( id )
{
	if( get_user_team( id ) == 1 )
	{
		cs_set_user_model( id, "adm_stripes_te" );
	}
	else if( get_user_team( id ) == 2 )
	{
		cs_set_user_model( id, "adm_stripes_ct" );
	}
	else
	{
		cs_reset_user_model( id );
	}
}
stock bool:UserIsAdmin( id )
{
	if( get_user_flags( id ) & ADMIN_KICK )
		return true;
	return false;
}

@AgentStrike, nu te supara de un mic 'UPDATE' la pluginul tau. Te-am scapat de < amxmisc > si am adaugat bool-ul lui Askhanar. :)>-
Deci acesta merge 100% ??
RoyalServer 2
bachusteam
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 14 Jul 2012, 10:14
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

23 Dec 2013, 00:40

Salut , puteti face acest plugin sa mearga doar la o anumita clasa de admin? adica asta: "abcdefghijkmnopqrstu"

exemplu din 7 clase de admini doar una singura sa il aiba, sper sa nu fie greu de realizat . MS
Clasic + Respawn Mod
Image
Clasic Mod
Image
GunGame Mod
Image
User avatar
CryWolf
Administrator
Administrator
Posts: 6505
Joined: 07 Aug 2008, 16:33
Detinator Steam: Da
Reputatie: Administrator
Fost Scripter
Manager CS2.eXtream.Ro
Fost Detinator ZM.eXtream.Ro
Fost manager CS.eXtream.Ro
Fost manager CSGO.eXtream.Ro
Fost manager global
Location: Botosani
Discord: crywolf1989
Has thanked: 202 times
Been thanked: 850 times
Contact:

23 Dec 2013, 10:07

Eu nu asi folosi cstrike ca metoda de switch sau detectare a echipei fakemeta este mult mai utilizabil si mai ok
.SMA | Afiseaza codul
[code=php]
#include < amxmodx >
#include < fakemeta >

#define PLUGIN_NAME "Stripes admin models"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "AgentStrike"

const OFFSET_CSTEAMS = 114

new const g_szModel_T [ ] = "models/player/adm_stripes_te/adm_stripes_te.mdl";
new const g_szModel_CT [ ] = "models/player/adm_stripes_ct/adm_stripes_ct.mdl";

new g_has_custom_model[33]
new g_player_model[33][32]

public plugin_init( )
{
    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
    
    // ResetHUD
    
    register_event( "ResetHUD", "evReset_Hud", "be" );
    
    register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")
    register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")
}
public plugin_precache( )
{
    precache_model( g_szModel_T );
    precache_model( g_szModel_CT );
}

public evReset_Hud( id )
{
    if( UserIsAdmin ( id ) ) // Ow yes, good bool :D
    {
        set_task( 3.0, "reset_model", id );
    }
}

public reset_model( id )
{
    switch ( fm_get_user_team ( id ) )
    {
        case 0: fm_reset_user_model ( id );
        case 1: fm_set_user_model ( id, g_szModel_T );
        case 2: fm_set_user_model ( id, g_szModel_CT );
        default: fm_reset_user_model ( id );
    }
}

stock bool:UserIsAdmin( id )
{
    if( get_user_flags( id ) & ADMIN_KICK )
        return true;
    return false;
}

stock fm_set_user_model(player, const modelname[])
{
    engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname);

    g_has_custom_model[player] = true
}

stock fm_get_user_model(player, model[], len)
{
    engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}

stock fm_reset_user_model(player)
{
    g_has_custom_model[player] = false
    
    dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}

// new
public fw_SetClientKeyValue(id, const infobuffer[], const key[])
{
    if (g_has_custom_model[id] && equal(key, "model"))
        return FMRES_SUPERCEDE
        
    return FMRES_IGNORED
}

public fw_ClientUserInfoChanged(id)
{
    if (!g_has_custom_model[id])
        return FMRES_IGNORED

    static currentmodel[32]
    fm_get_user_model(id, currentmodel, sizeof currentmodel - 1)

    if (!equal(currentmodel, g_player_model[id]))
        fm_set_user_model(id, g_player_model[id])
    
    return FMRES_IGNORED
}

// Get user team (fakemeta way)
stock fm_get_user_team( id )
{
        return get_pdata_int( id, OFFSET_CSTEAMS )
} [/code]
- + jucatorii nu vor putea schimba modelele cu cl_minmodels sau model leet in consola s.a.m.d
- + folosire metoda safe_pdata

Voi face altceva mai ok cand am timp poate un update la player models a lui p.of.pw
NU IMI MAI DA-TI PM CU CERERE AJUTOR/SAMD, FOLOSITI FORUMUL, CITESC MAJORITATEA TOPICURILOR.
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV

Image

Image
bachusteam
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 14 Jul 2012, 10:14
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

24 Dec 2013, 14:46

CryWolf wrote:Eu nu asi folosi cstrike ca metoda de switch sau detectare a echipei fakemeta este mult mai utilizabil si mai ok
.SMA | Afiseaza codul
[code=php]
#include < amxmodx >
#include < fakemeta >

#define PLUGIN_NAME "Stripes admin models"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "AgentStrike"

const OFFSET_CSTEAMS = 114

new const g_szModel_T [ ] = "models/player/adm_stripes_te/adm_stripes_te.mdl";
new const g_szModel_CT [ ] = "models/player/adm_stripes_ct/adm_stripes_ct.mdl";

new g_has_custom_model[33]
new g_player_model[33][32]

public plugin_init( )
{
    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
    
    // ResetHUD
    
    register_event( "ResetHUD", "evReset_Hud", "be" );
    
    register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")
    register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")
}
public plugin_precache( )
{
    precache_model( g_szModel_T );
    precache_model( g_szModel_CT );
}

public evReset_Hud( id )
{
    if( UserIsAdmin ( id ) ) // Ow yes, good bool :D
    {
        set_task( 3.0, "reset_model", id );
    }
}

public reset_model( id )
{
    switch ( fm_get_user_team ( id ) )
    {
        case 0: fm_reset_user_model ( id );
        case 1: fm_set_user_model ( id, g_szModel_T );
        case 2: fm_set_user_model ( id, g_szModel_CT );
        default: fm_reset_user_model ( id );
    }
}

stock bool:UserIsAdmin( id )
{
    if( get_user_flags( id ) & ADMIN_KICK )
        return true;
    return false;
}

stock fm_set_user_model(player, const modelname[])
{
    engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname);

    g_has_custom_model[player] = true
}

stock fm_get_user_model(player, model[], len)
{
    engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}

stock fm_reset_user_model(player)
{
    g_has_custom_model[player] = false
    
    dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}

// new
public fw_SetClientKeyValue(id, const infobuffer[], const key[])
{
    if (g_has_custom_model[id] && equal(key, "model"))
        return FMRES_SUPERCEDE
        
    return FMRES_IGNORED
}

public fw_ClientUserInfoChanged(id)
{
    if (!g_has_custom_model[id])
        return FMRES_IGNORED

    static currentmodel[32]
    fm_get_user_model(id, currentmodel, sizeof currentmodel - 1)

    if (!equal(currentmodel, g_player_model[id]))
        fm_set_user_model(id, g_player_model[id])
    
    return FMRES_IGNORED
}

// Get user team (fakemeta way)
stock fm_get_user_team( id )
{
        return get_pdata_int( id, OFFSET_CSTEAMS )
} [/code]
- + jucatorii nu vor putea schimba modelele cu cl_minmodels sau model leet in consola s.a.m.d
- + folosire metoda safe_pdata

Voi face altceva mai ok cand am timp poate un update la player models a lui p.of.pw
Acest sma este ce am cerut eu? Ca nu inteleg pentru cine este pus. Stima
Cu colinde de Crăciun, va dorim un an mai bun, şi cu dragoste creştină să primiţi în dar lumină,
zurgălăi de flori de gheaţă să vă bucure de viaţă, mult noroc s-aveţi în toate, Craciun Fericit!
Clasic + Respawn Mod
Image
Clasic Mod
Image
GunGame Mod
Image
Ake
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 19 Dec 2013, 17:30
Detinator Steam: Da
Has thanked: 88 times
Been thanked: 2 times

26 Dec 2013, 20:47

CryWolf wrote:Eu nu asi folosi cstrike ca metoda de switch sau detectare a echipei fakemeta este mult mai utilizabil si mai ok
.SMA | Afiseaza codul
[code=php]
#include < amxmodx >
#include < fakemeta >

#define PLUGIN_NAME "Stripes admin models"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "AgentStrike"

const OFFSET_CSTEAMS = 114

new const g_szModel_T [ ] = "models/player/adm_stripes_te/adm_stripes_te.mdl";
new const g_szModel_CT [ ] = "models/player/adm_stripes_ct/adm_stripes_ct.mdl";

new g_has_custom_model[33]
new g_player_model[33][32]

public plugin_init( )
{
    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
    
    // ResetHUD
    
    register_event( "ResetHUD", "evReset_Hud", "be" );
    
    register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")
    register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")
}
public plugin_precache( )
{
    precache_model( g_szModel_T );
    precache_model( g_szModel_CT );
}

public evReset_Hud( id )
{
    if( UserIsAdmin ( id ) ) // Ow yes, good bool :D
    {
        set_task( 3.0, "reset_model", id );
    }
}

public reset_model( id )
{
    switch ( fm_get_user_team ( id ) )
    {
        case 0: fm_reset_user_model ( id );
        case 1: fm_set_user_model ( id, g_szModel_T );
        case 2: fm_set_user_model ( id, g_szModel_CT );
        default: fm_reset_user_model ( id );
    }
}

stock bool:UserIsAdmin( id )
{
    if( get_user_flags( id ) & ADMIN_KICK )
        return true;
    return false;
}

stock fm_set_user_model(player, const modelname[])
{
    engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname);

    g_has_custom_model[player] = true
}

stock fm_get_user_model(player, model[], len)
{
    engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}

stock fm_reset_user_model(player)
{
    g_has_custom_model[player] = false
    
    dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}

// new
public fw_SetClientKeyValue(id, const infobuffer[], const key[])
{
    if (g_has_custom_model[id] && equal(key, "model"))
        return FMRES_SUPERCEDE
        
    return FMRES_IGNORED
}

public fw_ClientUserInfoChanged(id)
{
    if (!g_has_custom_model[id])
        return FMRES_IGNORED

    static currentmodel[32]
    fm_get_user_model(id, currentmodel, sizeof currentmodel - 1)

    if (!equal(currentmodel, g_player_model[id]))
        fm_set_user_model(id, g_player_model[id])
    
    return FMRES_IGNORED
}

// Get user team (fakemeta way)
stock fm_get_user_team( id )
{
        return get_pdata_int( id, OFFSET_CSTEAMS )
}[/code]
- + jucatorii nu vor putea schimba modelele cu cl_minmodels sau model leet in consola s.a.m.d
- + folosire metoda safe_pdata

Voi face altceva mai ok cand am timp poate un update la player models a lui p.of.pw
Mi-a picat serverul de la asta :|
User avatar
CryWolf
Administrator
Administrator
Posts: 6505
Joined: 07 Aug 2008, 16:33
Detinator Steam: Da
Reputatie: Administrator
Fost Scripter
Manager CS2.eXtream.Ro
Fost Detinator ZM.eXtream.Ro
Fost manager CS.eXtream.Ro
Fost manager CSGO.eXtream.Ro
Fost manager global
Location: Botosani
Discord: crywolf1989
Has thanked: 202 times
Been thanked: 850 times
Contact:

27 Dec 2013, 10:45

Ce eroare ? adauga debug si dupa plugin ca sa vad mai concret
NU IMI MAI DA-TI PM CU CERERE AJUTOR/SAMD, FOLOSITI FORUMUL, CITESC MAJORITATEA TOPICURILOR.
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV

Image

Image
Ake
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 19 Dec 2013, 17:30
Detinator Steam: Da
Has thanked: 88 times
Been thanked: 2 times

27 Dec 2013, 12:28

CryWolf wrote:Ce eroare ? adauga debug si dupa plugin ca sa vad mai concret
Nu da erori sau creeaza log.. pur si simplu am pus varianta ta si a dat segmentation
bachusteam
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 14 Jul 2012, 10:14
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

27 Dec 2013, 23:58

ma ajuta si pe mine careva?
Clasic + Respawn Mod
Image
Clasic Mod
Image
GunGame Mod
Image
bachusteam
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 14 Jul 2012, 10:14
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

30 Dec 2013, 21:29

bachusteam wrote:Salut , puteti face acest plugin sa mearga doar la o anumita clasa de admin? adica asta: "abcdefghijkmnopqrstu"

exemplu din 7 clase de admini doar una singura sa il aiba, sper sa nu fie greu de realizat . MS
Careva?
Clasic + Respawn Mod
Image
Clasic Mod
Image
GunGame Mod
Image
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

31 Dec 2013, 08:58

bachusteam wrote:
bachusteam wrote:Salut , puteti face acest plugin sa mearga doar la o anumita clasa de admin? adica asta: "abcdefghijkmnopqrstu"

exemplu din 7 clase de admini doar una singura sa il aiba, sper sa nu fie greu de realizat . MS
Careva?
| Afiseaza codul
#include < amxmodx >
#include < cstrike >

#define PLUGIN_NAME "Stripes admin models"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "AgentStrike"

#pragma semicolon 1

new const g_szModel_T[ ] = "models/player/adm_stripes_te/adm_stripes_te.mdl";
new const g_szModel_CT[ ] = "models/player/adm_stripes_ct/adm_stripes_ct.mdl";

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	// ResetHUD
	
	register_event( "ResetHUD", "evReset_Hud", "be" );
}
public plugin_precache( )
{
	precache_model( g_szModel_T );
	precache_model( g_szModel_CT );
}
public evReset_Hud( id )
{
	if( UserIsAdmin( id ) ) // Ow yes, good bool :D
	{
		set_task( 3.0, "reset_model", id );
	}
}
public reset_model( id )
{
	if( get_user_team( id ) == 1 && get_user_flags( id ) == read_flags( "abcdefghijkmnopqrstu" ) )
	{
		cs_set_user_model( id, "adm_stripes_te" );
	}
	else if( get_user_team( id ) == 2 && get_user_flags( id ) == read_flags( "abcdefghijkmnopqrstu" ) )
	{
		cs_set_user_model( id, "adm_stripes_ct" );
	}
	else
	{
		cs_reset_user_model( id );
	}
}
stock bool:UserIsAdmin( id )
{
	if( get_user_flags( id ) & ADMIN_KICK )
		return true;
	return false;
}
Vezi asa.
Retras
bachusteam
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 14 Jul 2012, 10:14
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

01 Jan 2014, 23:50

Da merge asta .. Respect si ms pentru ca ma ajuti , poti sa mai adaugi inca o clasa? care sa aiba alt model? de exemplu ownerii si co-ownerii sa aiba skinuri diferite?

La Multi Ani!
Clasic + Respawn Mod
Image
Clasic Mod
Image
GunGame Mod
Image
Spank
Membru, skill +2
Membru, skill +2
Posts: 656
Joined: 14 Apr 2010, 14:30
Detinator Steam: Da
Detinator server CS: Clasic.Promns.Ro
SteamID: Danyel11
Location: Sibiu
Has thanked: 62 times
Been thanked: 4 times

02 Jan 2014, 12:09

Are cineva o sursa buna a acestui plugin, fara erori?
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests