Page 1 of 1
ADMIN_LEVEL_B
Posted: 2014 Oct 10 11:24
by laimiukas3
ka reiketu pakeisti kad veiktu tik ADMIN_LEVEL_B ?:) dekui
Code: Select all
#include < amxmodx > #include < fakemeta > public plugin_precache( ){ precache_model( "models/modulis.mdl" );} public plugin_init( ){ new const VERSION[ ] = "1.3"; register_plugin( "Modulis", VERSION, "xPaw" ); set_pcvar_string( register_cvar( "santa_hat", VERSION, FCVAR_SERVER ), VERSION ); if( !get_pcvar_num( register_cvar( "amx_santahat", "1" ) ) ) { return; } new iEntity, iMaxPlayers = get_maxplayers( ), iInfoTarget = engfunc( EngFunc_AllocString, "info_target" ); new const MODEL[ ] = "models/Modulis.mdl"; for( new id = 1; id <= iMaxPlayers; id++ ) { iEntity = engfunc( EngFunc_CreateNamedEntity, iInfoTarget ); if( pev_valid( iEntity ) ) { engfunc( EngFunc_SetModel, iEntity, MODEL ); set_pev( iEntity, pev_movetype, MOVETYPE_FOLLOW ); set_pev( iEntity, pev_aiment, id ); set_pev( iEntity, pev_owner, id ); } }}
Re: ADMIN_LEVEL_B
Posted: 2014 Oct 10 13:18
by ArtHa123
Code: Select all
if(get_user_flags(0) & ADMIN_LEVEL_B){ new iEntity, iMaxPlayers = get_maxplayers( ), iInfoTarget = engfunc( EngFunc_AllocString, "info_target" ); new const MODEL[ ] = "models/Modulis.mdl"; for( new id = 1; id <= iMaxPlayers; id++ ) { iEntity = engfunc( EngFunc_CreateNamedEntity, iInfoTarget ); if( pev_valid( iEntity ) ) { engfunc( EngFunc_SetModel, iEntity, MODEL ); set_pev( iEntity, pev_movetype, MOVETYPE_FOLLOW ); set_pev( iEntity, pev_aiment, id ); set_pev( iEntity, pev_owner, id ); } }}
Re: ADMIN_LEVEL_B
Posted: 2014 Oct 10 14:03
by laimiukas3
ArtHa123 wrote:Code: Select all
if(get_user_flags(0) & ADMIN_LEVEL_B){ new iEntity, iMaxPlayers = get_maxplayers( ), iInfoTarget = engfunc( EngFunc_AllocString, "info_target" ); new const MODEL[ ] = "models/Modulis.mdl"; for( new id = 1; id <= iMaxPlayers; id++ ) { iEntity = engfunc( EngFunc_CreateNamedEntity, iInfoTarget ); if( pev_valid( iEntity ) ) { engfunc( EngFunc_SetModel, iEntity, MODEL ); set_pev( iEntity, pev_movetype, MOVETYPE_FOLLOW ); set_pev( iEntity, pev_aiment, id ); set_pev( iEntity, pev_owner, id ); } }}
//// Admin_kepure.sma
// C:\Users\FoX\Desktop\6153\cstrike\addons\amxmodx\scripting\Admin_kepure.sma(2
1) : warning 217: loose indentation
// C:\Users\FoX\Desktop\6153\cstrike\addons\amxmodx\scripting\Admin_kepure.sma(4
1) : error 001: expected token: "}", but found "-end of file-"
//
// 1 Error.
// Could not locate output file C:\Users\FoX\Desktop\6153\cstrike\addons\amxmodx
\scripting\compiled\Admin_kepure.amx (compile failed).
//
// Compilation Time: 0,22 sec
// ----------------------------------------
Press enter to exit ...
Code: Select all
#include < amxmodx >#include < fakemeta > public plugin_precache( ){ precache_model( "models/modulis.mdl" );} public plugin_init( ){ new const VERSION[ ] = "1.3"; register_plugin( "Modulis", VERSION, "xPaw" ); set_pcvar_string( register_cvar( "santa_hat", VERSION, FCVAR_SERVER ), VERSION ); if( !get_pcvar_num( register_cvar( "amx_santahat", "1" ) ) ) { return; } if(get_user_flags(0) & ADMIN_LEVEL_B){ new iEntity, iMaxPlayers = get_maxplayers( ), iInfoTarget = engfunc( EngFunc_AllocString, "info_target" ); new const MODEL[ ] = "models/Modulis.mdl"; for( new id = 1; id <= iMaxPlayers; id++ ) { iEntity = engfunc( EngFunc_CreateNamedEntity, iInfoTarget ); if( pev_valid( iEntity ) ) { engfunc( EngFunc_SetModel, iEntity, MODEL ); set_pev( iEntity, pev_movetype, MOVETYPE_FOLLOW ); set_pev( iEntity, pev_aiment, id ); set_pev( iEntity, pev_owner, id ); } }}
nekompiliuoja
Re: ADMIN_LEVEL_B
Posted: 2014 Oct 10 18:42
by hleV
ArtHa123 wrote:get_user_flags(0)
@ plugin_init()

Re: ADMIN_LEVEL_B
Posted: 2014 Oct 10 19:13
by ArtHa123
new id;
if(get_user_flags(id) & ADMIN_LEVEL_B)
or
if(get_user_flags() & ADMIN_LEVEL_B) (nesu tikras)
su } patikrink kas negerai, dariau ne per notepad, todėl sunku pačiam patikrinti
loose indentation, nes eiliavimas skiriasi.
Re: ADMIN_LEVEL_B
Posted: 2014 Oct 10 19:18
by hleV
↑ Tu gal neberašyk.
Esmė kad pluginas visiems entity [1; max players] intervale priskiria po "aim entity". Norint, kad hat'us turėtų tik žaidėjai su atitinkamu flag'u, reikia jiems prisijungus atitinkamą "aim entity" padaryt visible arba invisible.
(Netestavau.)
Code: Select all
#include < amxmodx >#include < fakemeta >#include <fakemeta_util> new HatEntities[33]; public plugin_precache( ){ precache_model( "models/modulis.mdl" );} public plugin_init( ){ new const VERSION[ ] = "1.3"; register_plugin( "Modulis", VERSION, "xPaw" ); set_pcvar_string( register_cvar( "santa_hat", VERSION, FCVAR_SERVER ), VERSION ); if( !get_pcvar_num( register_cvar( "amx_santahat", "1" ) ) ) { return; } new iEntity, iMaxPlayers = get_maxplayers( ), iInfoTarget = engfunc( EngFunc_AllocString, "info_target" ); new const MODEL[ ] = "models/Modulis.mdl"; for( new id = 1; id <= iMaxPlayers; id++ ) { HatEntities[id] = iEntity = engfunc( EngFunc_CreateNamedEntity, iInfoTarget ); if( pev_valid( iEntity ) ) { engfunc( EngFunc_SetModel, iEntity, MODEL ); set_pev( iEntity, pev_movetype, MOVETYPE_FOLLOW ); set_pev( iEntity, pev_aiment, id ); set_pev( iEntity, pev_owner, id ); } }} public client_authorized(client){ fm_set_entity_visibility(HatEntities[client], !!(get_user_flags(client) & ADMIN_LEVEL_B));}
Re: ADMIN_LEVEL_B
Posted: 2014 Dec 15 06:46
by laimiukas3
kaip padaryti kad ADMIN_LEVEL_B neduotu siutu modeliu
Code: Select all
#include < amxmodx >#include < engine >#include < cstrike >#include < hamsandwich > new const g_szHatModel[ CsTeams ][ ] = { "", "models/make/santa_capt.mdl", "models/make/santa_capct.mdl", ""}; new g_iHats[ 33 ]; public plugin_init( ) { register_plugin( "Santa Hat + Snow", "1.3", "xPaw" ); register_cvar( "santa_hat", "1.3", FCVAR_SERVER ); register_event( "TeamInfo", "EventTeamInfo", "a" ); RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );} public plugin_precache( ) { //create_entity( "env_snow" ); precache_model( g_szHatModel[ CS_TEAM_T ] ); precache_model( g_szHatModel[ CS_TEAM_CT ] );} public client_disconnect( id ) if( is_valid_ent( g_iHats[ id ] ) ) remove_entity( g_iHats[ id ] ); public FwdHamPlayerSpawn( const id ) { if( is_user_alive( id ) ) { new iEntity = g_iHats[ id ]; if( !is_valid_ent( iEntity ) ) { if( !( iEntity = g_iHats[ id ] = create_entity( "info_target" ) ) ) return; new CsTeams:iTeam = cs_get_user_team( id ); if( iTeam != CS_TEAM_T && iTeam != CS_TEAM_CT ) iTeam = CS_TEAM_T; entity_set_model( iEntity, g_szHatModel[ iTeam ] ); entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FOLLOW ); entity_set_edict( iEntity, EV_ENT_aiment, id ); } }} public EventTeamInfo( ) { new id = read_data( 1 ), iEntity = g_iHats[ id ]; if( !is_valid_ent( iEntity ) ) { if( iEntity > 0 ) g_iHats[ id ] = 0; return; } new szTeam[ 2 ]; read_data( 2, szTeam, 1 ); if( szTeam[ 0 ] == 'C' ) entity_set_model( iEntity, g_szHatModel[ CS_TEAM_CT ] ); else entity_set_model( iEntity, g_szHatModel[ CS_TEAM_T ] );}
Re: ADMIN_LEVEL_B
Posted: 2014 Dec 15 09:31
by MPD
Netestavau, bet turėtų veikti.
Code: Select all
#include < amxmodx >#include < engine >#include < cstrike >#include < hamsandwich > new const g_szHatModel[ CsTeams ][ ] = { "", "models/make/santa_capt.mdl", "models/make/santa_capct.mdl", ""}; new g_iHats[ 33 ]; public plugin_init( ) { register_plugin( "Santa Hat + Snow", "1.3", "xPaw" ); register_cvar( "santa_hat", "1.3", FCVAR_SERVER ); register_event( "TeamInfo", "EventTeamInfo", "a" ); RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );} public plugin_precache( ) { //create_entity( "env_snow" ); precache_model( g_szHatModel[ CS_TEAM_T ] ); precache_model( g_szHatModel[ CS_TEAM_CT ] );} public client_disconnect( id ) if( is_valid_ent( g_iHats[ id ] ) ) remove_entity( g_iHats[ id ] ); public FwdHamPlayerSpawn( const id ) { if( is_user_alive( id ) && !( get_user_flags( id ) & ADMIN_LEVEL_B ) ) { new iEntity = g_iHats[ id ]; if( !is_valid_ent( iEntity ) ) { if( !( iEntity = g_iHats[ id ] = create_entity( "info_target" ) ) ) return; new CsTeams:iTeam = cs_get_user_team( id ); if( iTeam != CS_TEAM_T && iTeam != CS_TEAM_CT ) iTeam = CS_TEAM_T; entity_set_model( iEntity, g_szHatModel[ iTeam ] ); entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FOLLOW ); entity_set_edict( iEntity, EV_ENT_aiment, id ); } }} public EventTeamInfo( ) { new id = read_data( 1 ); if ( get_user_flags( id ) & ADMIN_LEVEL_B ){ return; } new iEntity = g_iHats[ id ]; if( !is_valid_ent( iEntity ) ) { if( iEntity > 0 ) g_iHats[ id ] = 0; return; } new szTeam[ 2 ]; read_data( 2, szTeam, 1 ); if( szTeam[ 0 ] == 'C' ) entity_set_model( iEntity, g_szHatModel[ CS_TEAM_CT ] ); else entity_set_model( iEntity, g_szHatModel[ CS_TEAM_T ] );}
Re: ADMIN_LEVEL_B
Posted: 2014 Dec 15 20:16
by laimiukas3
MPD dekovoju
