Kaip suzinoti tam tikru vietu kordinates?

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
User avatar
Vebsteris
Jau po truputį tampa savu
Posts: 195
Joined: 2011 Aug 20 14:08

Re: Kaip suzinoti tam tikru vietu kordinates?

Post by Vebsteris »

life55 wrote:Bandau tik speti, sitas gun room:

Code: Select all

new const Float:g_flOrigins[ ][ 3 ] = {     { -405.0, 2900.0, 720.0 },    { -486.0, -1000.0, -275.0 },    { -405.0, 2949.0, 2422.0 }};
O sitas tada mario?:

Code: Select all

new const Float:g_flAngles[ ][ 3 ] = {    { 0.0, 270.0, 0.0 },    { 0.0, 270.0, 0.0 },    { 0.0, 270.0, 0.0 }};
Bet kur tada jail kordinates. Man cia kaskaip nelogiskai atrodo.
COOL STORY, BRO.

Matai žodžius Origins ir Angles?

ORIGIN - vieta
ANGLE - kampas

Jau tokius žodžius reikia mokėti.

"Man kažkaip nelogiškai atrodo" - nes visiškai nesupranti kas čia yra.

life55
Gana aktyvus vartotojas
Posts: 248
Joined: 2011 Nov 05 17:24
Skype: nezinoma

Re: Kaip suzinoti tam tikru vietu kordinates?

Post by life55 »

Ai supratau dekui, bet galetum paaiskint ir be riksmu. Anyway +KARMA uzdedu.

User avatar
Vebsteris
Jau po truputį tampa savu
Posts: 195
Joined: 2011 Aug 20 14:08

Re: Kaip suzinoti tam tikru vietu kordinates?

Post by Vebsteris »

Successful trolling is successful. ^^

life55
Gana aktyvus vartotojas
Posts: 248
Joined: 2011 Nov 05 17:24
Skype: nezinoma

Re: Kaip suzinoti tam tikru vietu kordinates?

Post by life55 »

nulusta dabar serveris, stai ka as ten pridirbau:

Code: Select all

#include < amxmodx >#include < engine >#include < hamsandwich > #define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers ) new const g_szClassname[ ] = "trigger_rules_watch"; enum _:RoomTypes {    JAIL,    GUNROOM,    MARIOROOM}; enum _:CVARS {    CV_JAIL_NOKILL,    CV_JAIL_TIME,        CV_GUNROOM_NOKILL,    CV_GUNROOM_TIME,        CV_MARIOROOM_NOKILL,    CV_MARIOROOM_TIME}; new const g_szZones[ RoomTypes ][ ] = {    "Jail",    "Gun room",    "Mario room"}; new const Float:g_flOrigins[ ][ 3 ] = {    { -405.0, 2900.0, 720.0 },    { -1203.4, -164.1, 4.0 },    { 2282.9, -3130.7, 1092.0 }}; new const Float:g_flAngles[ ][ 3 ] = {    { 0.0, 270.0, 0.0 },    { -880.0, -48.0, 4.0 },    { 2851.5, -3441.7, 1092.0 }}; new g_iMaxPlayers;new g_iCounter[ 33 ];new bool:g_bNoKill[ 33 ];new Float:g_flLastTouch[ 33 ];new g_pCvars[ CVARS ], g_iCvars[ CVARS ]; public plugin_init( ) {    register_plugin( "surf_green: Rules Watcher", "1.1", "xPaw" );        register_cvar( "surf_green_rules_watcher", "1.1", FCVAR_SERVER | FCVAR_SPONLY );        g_iMaxPlayers = get_maxplayers( );        g_pCvars[ CV_JAIL_NOKILL ]      = register_cvar( "rw_ss2_jail_nokill",      "0" );    g_pCvars[ CV_JAIL_TIME ]        = register_cvar( "rw_ss2_jail_time",        "1" );        g_pCvars[ CV_GUNROOM_NOKILL ]   = register_cvar( "rw_ss2_gunroom_nokill",   "1" );    g_pCvars[ CV_GUNROOM_TIME ]     = register_cvar( "rw_ss2_gunroom_time",     "15" );        g_pCvars[ CV_MARIOROOM_NOKILL ] = register_cvar( "rw_ss2_marioroom_nokill", "1" );    g_pCvars[ CV_MARIOROOM_TIME ]   = register_cvar( "rw_ss2_marioroom_time",   "30" );        new szMap[ 12 ];    get_mapname( szMap, 11 );        if( equali( szMap, "surf_green" ) ) {        CreateTrigger( JAIL, Float:{ -579.0, 2983.0, 586.0 }, Float:{ -309.0, 3288.0, 796.0 } );        CreateTrigger( GUNROOM, Float:{ 2150.0, -2616.6, 1103.6 }, Float:{ 2165.0, -2533.5, 936.9 } );        CreateTrigger( MARIOROOM, Float:{ 2150.0, -2616.6, 1103.6 }, Float:{ 2165.0, -2533.5, 936.9 } );                register_touch( g_szClassname, "player", "FwdTriggerTouch" );        RegisterHam( Ham_Spawn,        "player", "FwdHamPlayerSpawn", 1 );        RegisterHam( Ham_TakeDamage,   "player", "FwdHamTakeDamage" );        RegisterHam( Ham_TraceAttack,  "player", "FwdHamTraceAttack" );                register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );                CacheCvars( );    }} public EventNewRound( )    CacheCvars( ); public FwdHamPlayerSpawn( const id ) {    if( is_user_alive( id ) ) {        g_bNoKill[ id ]     = false;        g_flLastTouch[ id ] = 0.0;        g_iCounter[ id ]    = 0;    }} public FwdHamTraceAttack( const id, const iAttacker ) {    if( IsPlayer( iAttacker ) && g_bNoKill[ id ] && id != iAttacker ) {        if( ( g_flLastTouch[ id ] + 0.1 ) >= get_gametime( ) )            return HAM_SUPERCEDE;        else            g_bNoKill[ id ] = false;    }        return HAM_IGNORED;} public FwdHamTakeDamage( const id, const iInflictor, const iAttacker ) {    if( IsPlayer( iAttacker ) && g_bNoKill[ id ] && id != iAttacker ) {        if( ( g_flLastTouch[ id ] + 0.1 ) >= get_gametime( ) )            return HAM_SUPERCEDE;        else            g_bNoKill[ id ] = false;    }        return HAM_IGNORED;} public FwdTriggerTouch( const iEntity, const id ) {    static Float:flGametime;    flGametime = get_gametime( );        if( flGametime > ( g_flLastTouch[ id ] + 1.2 ) ) {        g_iCounter[ id ] = 0;        g_flLastTouch[ id ] = flGametime;    }    else if( g_flLastTouch[ id ] < flGametime ) {        g_iCounter[ id ]++;                static iType, bool:bNoKill, iTime;        iType = entity_get_int( iEntity, EV_INT_iuser1 );                GetCvars( iType, bNoKill, iTime );                g_bNoKill[ id ] = bNoKill;                if( iTime > 0 ) {            if( g_iCounter[ id ] >= iTime ) {                if( iTime >= 5 ) {                    engclient_print( id, engprint_center, "^nYou stood more than %i seconds in%s%s.^nYou have been thrown out.", iTime, iType == MARIOROOM ? "^n" : " ", g_szZones[ iType ] );                                        client_cmd( id, "spk buttons/blip1" );                }                                entity_set_vector( id, EV_VEC_angles, g_flAngles[ iType ] );                entity_set_int( id, EV_INT_fixangle, 1 );                entity_set_origin( id, g_flOrigins[ iType ] );            }                        if( g_iCounter[ id ] < 5 ) {                if( iTime >= 5 )                    engclient_print( id, engprint_center, "%sYou are in %s.%s^n^nYou have %i seconds to leave it!", bNoKill ? "" : "^n", g_szZones[ iType ], bNoKill ? "^nYou can't kill anyone here." : "", iTime );                else                    engclient_print( id, engprint_center, "%sYou are in %s.%s", bNoKill ? "" : "^n", g_szZones[ iType ], bNoKill ? "^nYou can't kill anyone here." : "" );            }        }                g_flLastTouch[ id ] = flGametime + 1.0;    }} GetCvars( const iType, &bool:bNoKill, &iTime ) {    static CvarNoKill, CvarTime;        switch( iType ) {        case JAIL: {            CvarNoKill = CV_JAIL_NOKILL;            CvarTime = CV_JAIL_TIME;        }        case GUNROOM: {            CvarNoKill = CV_GUNROOM_NOKILL;            CvarTime = CV_GUNROOM_TIME;        }        case MARIOROOM: {            CvarNoKill = CV_MARIOROOM_NOKILL;            CvarTime = CV_MARIOROOM_TIME;        }    }        bNoKill = bool:( g_iCvars[ CvarNoKill ] );    iTime = g_iCvars[ CvarTime ];} CacheCvars( ) {    g_iCvars[ CV_JAIL_NOKILL ]      = get_pcvar_num( g_pCvars[ CV_JAIL_NOKILL ] );    g_iCvars[ CV_JAIL_TIME ]        = get_pcvar_num( g_pCvars[ CV_JAIL_TIME ] );        g_iCvars[ CV_GUNROOM_NOKILL ]   = get_pcvar_num( g_pCvars[ CV_GUNROOM_NOKILL ] );    g_iCvars[ CV_GUNROOM_TIME ]     = get_pcvar_num( g_pCvars[ CV_GUNROOM_TIME ] );        g_iCvars[ CV_MARIOROOM_NOKILL ] = get_pcvar_num( g_pCvars[ CV_MARIOROOM_NOKILL ] );    g_iCvars[ CV_MARIOROOM_TIME ]   = get_pcvar_num( g_pCvars[ CV_MARIOROOM_TIME ] );} CreateTrigger( const iType, const Float:flMins[ 3 ], const Float:flMaxs[ 3 ] ) {    new iEntity = create_entity( "info_target" );        if( !is_valid_ent( iEntity ) ) {        log_amx( "There was an error with creating ^"%s^"", g_szZones[ iType ] );                return 0;    }        entity_set_string( iEntity, EV_SZ_classname, g_szClassname );    entity_set_int( iEntity, EV_INT_iuser1, iType );    entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_NONE );    entity_set_int( iEntity, EV_INT_solid, SOLID_TRIGGER );    entity_set_size( iEntity, flMins, flMaxs );        return iEntity;}

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests